run_flow
Execute Langflow flows with custom inputs and retrieve results. Supports synchronous execution for testing, integration, and automation.
Instructions
Execute a Langflow flow with inputs and retrieve execution results.
Purpose: Run a workflow and receive its outputs. Essential for testing flows, integrating workflows into applications, and automating tasks. Supports both synchronous execution and streaming for real-time responses from LLM-based flows.
Parameters:
flow_id_or_name (required, string): Flow identifier (UUID) or flow name (case-sensitive)
input_request (required, object): Execution configuration containing:
input_value (optional, string): Primary input data for the flow (e.g., user message, data to process)
output_component (optional, string): Specific output component to return
output_type (optional, string): Expected output format (e.g., "chat", "text", "json")
input_type (optional, string): Type of input being provided (e.g., "chat", "text", "json")
session_id (optional, string): Session ID for conversation continuity
tweaks (optional, object): Component-specific parameter overrides (key: component_id, value: parameter object)
context (optional, object): Request context passed alongside the input request
stream (optional, boolean, default: false): Streaming is currently rejected by this MCP client because streamed responses are not JSON serializable
Returns: RunResponse object containing:
outputs (array): Flow execution results from output components
session_id (string): Unique session identifier for conversation continuity
Additional fields vary by flow configuration (message, data, artifacts)
Usage Examples:
Simple execution: { flow_id_or_name: "my-chatbot", input_request: { input_value: "Hello" } }
With output type: { flow_id_or_name: "data-processor", input_request: { input_value: "data", output_type: "json" } }
With context: { flow_id_or_name: "llm-chat", input_request: { input_value: "Explain AI" }, context: { tenant: "acme" } }
With tweaks: { flow_id_or_name: "flow-uuid", input_request: { input_value: "test", tweaks: { "component-id": { temperature: 0.7 } } } }
Best Practices:
Use flow ID (UUID) for production; names may change or conflict
Build flow first with build_flow to ensure it's valid before execution
Leave stream false; this MCP client currently returns JSON tool responses only
Cache session_id for multi-turn conversations to maintain context
Set appropriate timeout values for long-running flows
Test flows with various inputs before production deployment
Use tweaks sparingly; prefer configuring flows in Langflow UI
Common Errors:
"Flow not found": Verify flow_id_or_name exists using list_flows
"Flow has not been built": Run build_flow before executing
"Invalid input configuration": Ensure input_request matches flow's expected inputs
"Component configuration error": Check tweaks object matches component IDs and parameter names
"Execution timeout": Flow took too long; increase timeout or optimize flow
"Missing required input": Flow expects input_value but none provided
Related Tools:
build_flow: Compile flow before execution to validate structure
get_flow: Inspect flow structure to understand required inputs
get_build_status: Check build completion before running flow
trigger_webhook: Alternative execution method via webhook endpoint
list_flows: Find available flows to execute
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| stream | No | Streaming is currently rejected by this MCP client | |
| context | No | Request context passed alongside the input request | |
| input_request | Yes | Input request configuration | |
| flow_id_or_name | Yes | Flow ID (UUID) or flow name |