v21

latestOpenAPI 3.1.0raw.githubusercontent.com2026-08-01144108427.9 KB
Base

Simplified Run Flow

Executes a specified flow by ID with support for streaming and telemetry (API key auth).

This endpoint executes a flow identified by ID or name, with options for streaming the response and tracking execution metrics. It handles both streaming and non-streaming execution modes. This endpoint uses API key authentication (Bearer token).

Args: background_tasks (BackgroundTasks): FastAPI background task manager flow (FlowRead | None): The flow to execute, loaded via dependency input_request (SimplifiedAPIRequest | None): Input parameters for the flow stream (bool): Whether to stream the response api_key_user (UserRead): Authenticated user from API key context (dict | None): Optional context to pass to the flow http_request (Request): The incoming HTTP request for extracting global variables

Returns: Union[StreamingResponse, RunResponse]: Either a streaming response for real-time results or a RunResponse with the complete execution results

Raises: HTTPException: For flow not found (404) or invalid input (400) APIException: For internal execution errors (500)

Notes: - Supports both streaming and non-streaming execution modes - Tracks execution time and success/failure via telemetry - Handles graceful client disconnection in streaming mode - Provides detailed error handling with appropriate HTTP status codes - Extracts global variables from HTTP headers with prefix X-LANGFLOW-GLOBAL-VAR-* - Merges extracted variables with the context parameter as "request_variables" - In streaming mode, uses EventManager to handle events: - "add_message": New messages during execution - "token": Individual tokens during streaming - "end": Final execution result - Authentication: Requires API key (Bearer token)

post/api/v1/run/{flow_id_or_name}

Path parameters

flow_id_or_namestring required

Query parameters

streamboolean

Request body

contextobject nullable

Example request

{
  "input_request": {
    "tweaks": {
      "Component Name": {
        "parameter_name": "value"
      },
      "component_id": {
        "parameter_name": "value"
      },
      "parameter_name": "value",
      "stream": false,
      "temperature": 0.7
    }
  }
}

Response

Successful Response

{"stackTrail":"paths:/api/v1/run/{flow_id_or_name}:post:responses:200:content:application/json:schema","oasType":"schema","type":"unknown"}