langflow icon indicating copy to clipboard operation
langflow copied to clipboard

Feature Request: Support Triggering Components via API (e.g., `/inject`)

Open FILM6912 opened this issue 1 year ago • 4 comments

Currently, components can only be triggered from the UI or through internal flows. Would it be possible to support API-based triggers, such as:

  • An endpoint like /inject
  • Allow sending HTTP requests (POST/GET) to directly trigger a component
  • Useful for integration with external systems that need to programmatically start a component

Use Case:

  • Triggering flows via external APIs
  • Easier integration with third-party tools (similar to Node-RED’s HTTP in/out nodes)
  • Adds flexibility to control components without relying on the UI

Example:

POST /inject
Content-Type: application/json

{
  "component": "my_component",
  "data": { "value": 123 }
}

Questions:

  • Is there a roadmap or plan to support API-based triggers like this?

FILM6912 avatar Sep 15 '25 02:09 FILM6912

Hi! I’d like to work on this issue.

soumyavoorugonda avatar Sep 15 '25 03:09 soumyavoorugonda

@soumyavoorugonda Many thanks! Kindly update me when it’s done.

FILM6912 avatar Sep 15 '25 06:09 FILM6912

https://github.com/langflow-ai/langflow/issues/9857

danieltsegaye8264-hash avatar Sep 15 '25 07:09 danieltsegaye8264-hash

@FILM6912 A possible workaround:

You can use the Webhook component or even the API request and add a trigger field to the components you want to trigger, which can be one or more components (example in the image).

This trigger field ensures the order of execution, without necessarily needing to pass an input to the connected component.

inputs = [
        MessageInput(
            name="trigger",
            display_name="Trigger",
            info="Trigger input to connect with flow (not used in processing).",
            required=False,
            advanced=True,
            show=True
        ),
Image

Empreiteiro avatar Sep 15 '25 18:09 Empreiteiro