diff --git a/404.html b/404.html index 51c08e3167..9632735879 100644 --- a/404.html +++ b/404.html @@ -10,7 +10,7 @@ - +
diff --git a/Concepts/concepts-flows.html b/Concepts/concepts-flows.html index 6f028d0b16..4b24547f88 100644 --- a/Concepts/concepts-flows.html +++ b/Concepts/concepts-flows.html @@ -10,7 +10,7 @@ - + diff --git a/Deployment/deployment-docker.html b/Deployment/deployment-docker.html index 95450a4c0d..a37b1aff4a 100644 --- a/Deployment/deployment-docker.html +++ b/Deployment/deployment-docker.html @@ -10,7 +10,7 @@ - + diff --git a/agents-overview.html b/agents-overview.html index 02943cd3e6..649fc3b5de 100644 --- a/agents-overview.html +++ b/agents-overview.html @@ -10,7 +10,7 @@ - + diff --git a/agents-tool-calling-agent-component.html b/agents-tool-calling-agent-component.html index 752b606f4c..920764e837 100644 --- a/agents-tool-calling-agent-component.html +++ b/agents-tool-calling-agent-component.html @@ -10,7 +10,7 @@ - + diff --git a/api-reference-api-examples.html b/api-reference-api-examples.html index bdec3f00de..675bf6d5b6 100644 --- a/api-reference-api-examples.html +++ b/api-reference-api-examples.html @@ -10,7 +10,7 @@ - + @@ -24,8 +24,9 @@This page provides examples and practices for managing Langflow using the Langflow API.
The Langflow API's OpenAPI spec can be viewed and tested at your Langflow deployment's docs endpoint.
For example, http://127.0.0.1:7860/docs.
You might find it helpful to set the following environment variables:
+You might find it helpful to set the following environment variables in your terminal.
+The examples in this guide use environment variables for these values.
http://127.0.0.1:7860.flow-id is found in the API pane or
folder-id in your terminal.
To find your folder ID, call the Langflow /api/v1/folders/ endpoint for a list of folders.
_10curl -X 'GET' \_10 "$LANGFLOW_URL/api/v1/folders/" \_10 -H 'accept: application/json'
_10[_10 {_10 "name": "My Projects",_10 "description": "Manage your own projects. Download and upload folders.",_10 "id": "1415de42-8f01-4f36-bf34-539f23e47466",_10 "parent_id": null_10 }_10]
_10curl -X GET \_10 "$LANGFLOW_URL/api/v1/folders/" \_10 -H "accept: application/json"
_10[_10 {_10 "name": "My Projects",_10 "description": "Manage your own projects. Download and upload folders.",_10 "id": "1415de42-8f01-4f36-bf34-539f23e47466",_10 "parent_id": null_10 }_10]
Export the folder-id as an environment variable.
_10export FOLDER_ID="1415de42-8f01-4f36-bf34-539f23e47466"
_10langflow api-key
_10API Key Created Successfully:_10sk-...
Export the generated API key as an environment variable.
_10export LANGFLOW_API_KEY="sk-..."
The examples in this guide use environment variables for these values.
+Use the base Langflow API to run your flow and retrieve configuration information.
+This operation returns a dictionary of all Langflow components.
+
_10curl -X GET \_10 "$LANGFLOW_URL/api/v1/all" \_10 -H "accept: application/json"
_10A dictionary of all Langflow components.
Execute a specified flow by ID or name.
+The flow is executed as a batch, but LLM responses can be streamed.
+For more configuration options when building your flow, use the /build endpoint instead.
_10curl -X POST \_10 "$LANGFLOW_URL/api/v1/run/$FLOW_ID?stream=false" \_10 -H "accept: application/json" \_10 -H "Content-Type: application/json" \_10 -d '{}'
_10{"session_id":"947eaf64-bc35-4431-ae52-8b30d819915b","outputs":[{"inputs":{},"outputs":[{"results":{"message":{"text_key":"text","data":{"timestamp":"2025-02-04T21:44:02+00:00","sender":"Machine","sender_name":"AI","session_id":"947eaf64-bc35-4431-ae52-8b30d819915b","text":"Hello! 🌟 I'm excited to help you get started on your journey to building something fresh! What do you have in mind? Whether it's a project, an idea, or a concept, let's dive in and make it happen!","files":[],"error":false,"edit":false,"properties":{"text_color":"","background_color":"","edited":false,"source":{"id":"OpenAIModel-g7uMN","display_name":"OpenAI","source":"gpt-4o-mini"},"icon":"OpenAI","allow_markdown":false,"positive_feedback":null,"state":"complete","targets":[]},"category":"message","content_blocks":[],"id":"dcb15280-a16c-489a-9818-bec697fd123e","flow_id":"947eaf64-bc35-4431-ae52-8b30d819915b"},"default_value":"","text":"Hello! 🌟 I'm excited to help you get started on your journey to building something fresh! What do you have in mind? Whether it's a project, an idea, or a concept, let's dive in and make it happen!","sender":"Machine","sender_name":"AI","files":[],"session_id":"947eaf64-bc35-4431-ae52-8b30d819915b","timestamp":"2025-02-04T21:44:02+00:00","flow_id":"947eaf64-bc35-4431-ae52-8b30d819915b","error":false,"edit":false,"properties":{"text_color":"","background_color":"","edited":false,"source":{"id":"OpenAIModel-g7uMN","display_name":"OpenAI","source":"gpt-4o-mini"},"icon":"OpenAI","allow_markdown":false,"positive_feedback":null,"state":"complete","targets":[]},"category":"message","content_blocks":[]}},"artifacts":{"message":"Hello! 🌟 I'm excited to help you get started on your journey to building something fresh! What do you have in mind? Whether it's a project, an idea, or a concept, let's dive in and make it happen!","sender":"Machine","sender_name":"AI","files":[],"type":"object"},"outputs":{"message":{"message":{"timestamp":"2025-02-04T21:44:02","sender":"Machine","sender_name":"AI","session_id":"947eaf64-bc35-4431-ae52-8b30d819915b","text":"Hello! 🌟 I'm excited to help you get started on your journey to building something fresh! What do you have in mind? Whether it's a project, an idea, or a concept, let's dive in and make it happen!","files":[],"error":false,"edit":false,"properties":{"text_color":"","background_color":"","edited":false,"source":{"id":"OpenAIModel-g7uMN","display_name":"OpenAI","source":"gpt-4o-mini"},"icon":"OpenAI","allow_markdown":false,"positive_feedback":null,"state":"complete","targets":[]},"category":"message","content_blocks":[],"id":"dcb15280-a16c-489a-9818-bec697fd123e","flow_id":"947eaf64-bc35-4431-ae52-8b30d819915b"},"type":"message"}},"logs":{"message":[]},"messages":[{"message":"Hello! 🌟 I'm excited to help you get started on your journey to building something fresh! What do you have in mind? Whether it's a project, an idea, or a concept, let's dive in and make it happen!","sender":"Machine","sender_name":"AI","session_id":"947eaf64-bc35-4431-ae52-8b30d819915b","stream_url":null,"component_id":"ChatOutput-HnFx1","files":[],"type":"message"}],"timedelta":null,"duration":null,"component_display_name":"Chat Output","component_id":"ChatOutput-HnFx1","used_frozen_result":false}]}]}
To stream LLM token responses, append the ?stream=true query parameter to the request. LLM chat responses are streamed back as token events until the end event closes the connection.
_10curl -X POST \_10 "$LANGFLOW_URL/api/v1/run/$FLOW_ID?stream=true" \_10 -H "accept: application/json" \_10 -H "Content-Type: application/json" \_10 -H "x-api-key: $LANGFLOW_API_KEY" \_10 -d '{"message": "Tell me something interesting!"}'
_13{"event": "add_message", "data": {"timestamp": "2025-02-05T14:46:24", "sender": "User", "sender_name": "User", "session_id": "947eaf64-bc35-4431-ae52-8b30d819915b", "text": "Hello", "files": [], "error": false, "edit": false, "properties": {"text_color": "", "background_color": "", "edited": false, "source": {"id": null, "display_name": null, "source": null}, "icon": "", "allow_markdown": false, "positive_feedback": null, "state": "complete", "targets": []}, "category": "message", "content_blocks": [], "id": "1d6044d6-332c-431a-a50c-dcea5deee4ab", "flow_id": "947eaf64-bc35-4431-ae52-8b30d819915b"}}_13_13{"event": "add_message", "data": {"timestamp": "2025-02-05T14:46:24", "sender": "Machine", "sender_name": "AI", "session_id": "947eaf64-bc35-4431-ae52-8b30d819915b", "text": "", "files": [], "error": false, "edit": false, "properties": {"text_color": "", "background_color": "", "edited": false, "source": {"id": "OpenAIModel-g7uMN", "display_name": "OpenAI", "source": "gpt-4o-mini"}, "icon": "OpenAI", "allow_markdown": false, "positive_feedback": null, "state": "complete", "targets": []}, "category": "message", "content_blocks": [], "id": "be9db128-eaac-49db-bfd7-ed63406ebbcf", "flow_id": "947eaf64-bc35-4431-ae52-8b30d819915b"}}_13_13{"event": "token", "data": {"chunk": "", "id": "be9db128-eaac-49db-bfd7-ed63406ebbcf", "timestamp": "2025-02-05 14:46:25 UTC"}}_13_13{"event": "token", "data": {"chunk": "Hello", "id": "be9db128-eaac-49db-bfd7-ed63406ebbcf", "timestamp": "2025-02-05 14:46:25 UTC"}}_13_13{"event": "token", "data": {"chunk": "!", "id": "be9db128-eaac-49db-bfd7-ed63406ebbcf", "timestamp": "2025-02-05 14:46:25 UTC"}}_13_13{"event": "token", "data": {"chunk": " \ud83c\udf1f", "id": "be9db128-eaac-49db-bfd7-ed63406ebbcf", "timestamp": "2025-02-05 14:46:25 UTC"}}_13_13{"event": "end", "data": {"result": {"session_id": "947eaf64-bc35-4431-ae52-8b30d819915b", "outputs": [{"inputs": {}, "outputs": [{"results": {"message": {"text_key": "text", "data": {"timestamp": "2025-02-05T14:46:24+00:00", "sender": "Machine", "sender_name": "AI", "session_id": "947eaf64-bc35-4431-ae52-8b30d819915b", "text": "", "files": [], "error": false, "edit": false, "properties": {"text_color": "", "background_color": "", "edited": false, "source": {"id": "OpenAIModel-g7uMN", "display_name": "OpenAI", "source": "gpt-4o-mini"}, "icon": "OpenAI", "allow_markdown": false, "positive_feedback": null, "state": "complete", "targets": []}, "category": "message", "content_blocks": [], "id": "be9db128-eaac-49db-bfd7-ed63406ebbcf", "flow_id": "947eaf64-bc35-4431-ae52-8b30d819915b"}, "default_value": "", "text": "", "sender": "Machine", "sender_name": "AI", "files": [], "session_id": "947eaf64-bc35-4431-ae52-8b30d819915b", "timestamp": "2025-02-05T14:46:24+00:00", "flow_id": "947eaf64-bc35-4431-ae52-8b30d819915b", "error": false, "edit": false, "properties": {"text_color": "", "background_color": "", "edited": false, "source": {"id": "OpenAIModel-g7uMN", "display_name": "OpenAI", "source": "gpt-4o-mini"}, "icon": "OpenAI", "allow_markdown": false, "positive_feedback": null, "state": "complete", "targets": []}, "category": "message", "content_blocks": []}, "text": ""}, "artifacts": {"message": "", "sender": "Machine", "sender_name": "AI", "stream_url": "/api/v1/build/947eaf64-bc35-4431-ae52-8b30d819915b/ChatOutput-HnFx1/stream", "files": [], "type": "stream"}, "outputs": {"message": {"message": {"timestamp": "2025-02-05T14:46:24", "sender": "Machine", "sender_name": "AI", "session_id": "947eaf64-bc35-4431-ae52-8b30d819915b", "text": "Hello! \ud83c\udf1f I'm excited to help you get started on your journey to building something fresh! What do you have in mind? Whether it's a project, an idea, or a concept, let's dive in and make it happen!", "files": [], "error": false, "edit": false, "properties": {"text_color": "", "background_color": "", "edited": false, "source": {"id": "OpenAIModel-g7uMN", "display_name": "OpenAI", "source": "gpt-4o-mini"}, "icon": "OpenAI", "allow_markdown": false, "positive_feedback": null, "state": "complete", "targets": []}, "category": "message", "content_blocks": [], "id": "be9db128-eaac-49db-bfd7-ed63406ebbcf", "flow_id": "947eaf64-bc35-4431-ae52-8b30d819915b"}, "type": "message"}}, "logs": {"message": []}, "messages": [], "timedelta": null, "duration": null, "component_display_name": "Chat Output", "component_id": "ChatOutput-HnFx1", "used_frozen_result": false}]}]}}}
This result is abbreviated, but illustrates where the end event completes the LLM's token streaming response.
The webhook endpoint triggers flow execution with an HTTP POST request.
+When a Webhook component is added to the workspace, a new Webhook cURL tab becomes available in the API pane that contains an HTTP POST request for triggering the webhook component, similar to the call in this example.
+To test the Webhook component in your flow, see the Webhook component.
+
_10curl -X POST \_10 "$LANGFLOW_URL/api/v1/webhook/$FLOW_ID" \_10 -H "Content-Type: application/json" \_10 -d '{"data": "example-data"}'
_10{_10 {"message":"Task started in the background","status":"in progress"}_10}
This endpoint is deprecated. Use the /run endpoint instead.
This endpoint is deprecated. Use the /run endpoint instead.
Get the status of a task.
+
_10curl -X GET \_10 "$LANGFLOW_URL/api/v1/task/TASK_ID" \_10 -H "accept: application/json"
_10{_10 "status": "Task status",_10 "result": "Task result if completed"_10}
This endpoint is deprecated. Use the /file endpoint instead.
Get the version of the Langflow API.
+
_10curl -X GET \_10 "$LANGFLOW_URL/api/v1/version" \_10 -H "accept: application/json"
_10{_10 "version": "1.1.1",_10 "main_version": "1.1.1",_10 "package": "Langflow"_10}
Retrieve the Langflow configuration information.
+
_10curl -X GET \_10 "$LANGFLOW_URL/api/v1/config" \_10 -H "accept: application/json"
_10{_10 "feature_flags": {_10 "mvp_components": false_10 },_10 "frontend_timeout": 0,_10 "auto_saving": true,_10 "auto_saving_interval": 1000,_10 "health_check_max_retries": 5,_10 "max_file_size_upload": 100_10}
Use the /build endpoint to build vertices and flows.
Use the /build endpoint to build vertices and flows, and execute those flows with streaming event responses.
The /build endpoint offers additional configuration for running flows.
For a simpler execution of your flows, use the /run endpoint instead.
This example builds a flow with a given flow_id.
LLM chat responses are streamed back as token events until the end event closes the connection.
_10curl -X 'POST' \_10 "$LANGFLOW_URL/api/v1/build/$FLOW_ID/flow" \_10 -H 'accept: application/json' \_10 -H 'Content-Type: application/json' \_10 -H "x-api-key: $LANGFLOW_API_KEY" \_10 -d '{"message": "hello, how are you doing?"}'
_13{"event": "vertices_sorted", "data": {"ids": ["Prompt-CDhMB", "ChatInput-8VNJS"], "to_run": ["ChatOutput-Up0tW", "OpenAIModel-mXCyV", "Prompt-CDhMB", "ChatInput-8VNJS"]}}_13_13{"event": "add_message", "data": {"timestamp": "2025-01-13T21:27:27", "sender": "User", "sender_name": "User", "session_id": "b68d9bfb-6382-455a-869b-b99a3a3a3cf6", "text": "", "files": [], "error": false, "edit": false, "properties": {"text_color": "", "background_color": "", "edited": false, "source": {"id": null, "display_name": null, "source": null}, "icon": "", "allow_markdown": false, "positive_feedback": null, "state": "complete", "targets": []}, "category": "message", "content_blocks": [], "id": "3942f4e3-4fff-4507-bb58-c96c7b6b8515", "flow_id": "b68d9bfb-6382-455a-869b-b99a3a3a3cf6"}}_13_13{"event": "end_vertex", "data": {"build_data": {"id": "Prompt-CDhMB", "inactivated_vertices": [], "next_vertices_ids": [], "top_level_vertices": [], "valid": true, "params": "None", "data": {"results": {}, "outputs": {"prompt": {"message": "You are a helpful AI assistant", "type": "text"}}, "logs": {"prompt": []}, "message": {"prompt": {"repr": "You are a helpful AI assistant", "raw": "You are a helpful AI assistant", "type": "text"}}, "artifacts": {"prompt": {"repr": "You are a helpful AI assistant", "raw": "You are a helpful AI assistant", "type": "text"}}, "timedelta": 0.007543042069301009, "duration": "8 ms", "used_frozen_result": false}, "timestamp": "2025-01-13T21:27:27.231841Z"}}}_13_13{"event": "token", "data": {"chunk": "", "id": "fda55d2e-d24c-498e-92a8-03ca2141265e", "timestamp": "2025-01-13 21:27:27 UTC"}}_13_13{"event": "token", "data": {"chunk": "Hello", "id": "fda55d2e-d24c-498e-92a8-03ca2141265e", "timestamp": "2025-01-13 21:27:27 UTC"}}_13_13{"event": "token", "data": {"chunk": "!", "id": "fda55d2e-d24c-498e-92a8-03ca2141265e", "timestamp": "2025-01-13 21:27:27 UTC"}}_13_13{"event": "end", "data": {}}
_10curl -X POST \_10 "$LANGFLOW_URL/api/v1/build/$FLOW_ID/flow" \_10 -H "accept: application/json" \_10 -H "Content-Type: application/json" \_10 -H "x-api-key: $LANGFLOW_API_KEY" \_10 -d '{"input_value": "hello, how are you doing?"}'
_15{"event": "vertices_sorted", "data": {"ids": ["ChatInput-TAEvF"], "to_run": ["Prompt-2gtLN", "ChatInput-TAEvF", "ChatOutput-HnFx1", "OpenAIModel-g7uMN"]}}_15_15{"event": "add_message", "data": {"timestamp": "2025-02-05T14:45:33", "sender": "User", "sender_name": "User", "session_id": "947eaf64-bc35-4431-ae52-8b30d819915b", "text": "Hello", "files": [], "error": false, "edit": false, "properties": {"text_color": "", "background_color": "", "edited": false, "source": {"id": null, "display_name": null, "source": null}, "icon": "", "allow_markdown": false, "positive_feedback": null, "state": "complete", "targets": []}, "category": "message", "content_blocks": [], "id": "12be981b-9816-4361-b0f9-ce65d0ba6cc1", "flow_id": "947eaf64-bc35-4431-ae52-8b30d819915b"}}_15_15{"event": "end_vertex", "data": {"build_data": {"id": "ChatInput-TAEvF", "inactivated_vertices": [], "next_vertices_ids": ["Prompt-2gtLN"], "top_level_vertices": ["Prompt-2gtLN"], "valid": true, "params": "- Files: []\n Message: Hello\n Sender: User\n Sender Name: User\n Type: object\n", "data": {"results": {"message": {"text_key": "text", "data": {"timestamp": "2025-02-05T14:45:33+00:00", "sender": "User", "sender_name": "User", "session_id": "947eaf64-bc35-4431-ae52-8b30d819915b", "text": "Hello", "files": [], "error": false, "edit": false, "properties": {"text_color": "", "background_color": "", "edited": false, "source": {"id": null, "display_name": null, "source": null}, "icon": "", "allow_markdown": false, "positive_feedback": null, "state": "complete", "targets": []}, "category": "message", "content_blocks": [], "id": "12be981b-9816-4361-b0f9-ce65d0ba6cc1", "flow_id": "947eaf64-bc35-4431-ae52-8b30d819915b"}, "default_value": "", "text": "Hello", "sender": "User", "sender_name": "User", "files": [], "session_id": "947eaf64-bc35-4431-ae52-8b30d819915b", "timestamp": "2025-02-05T14:45:33+00:00", "flow_id": "947eaf64-bc35-4431-ae52-8b30d819915b", "error": false, "edit": false, "properties": {"text_color": "", "background_color": "", "edited": false, "source": {"id": null, "display_name": null, "source": null}, "icon": "", "allow_markdown": false, "positive_feedback": null, "state": "complete", "targets": []}, "category": "message", "content_blocks": []}}, "outputs": {"message": {"message": {"timestamp": "2025-02-05T14:45:33+00:00", "sender": "User", "sender_name": "User", "session_id": "947eaf64-bc35-4431-ae52-8b30d819915b", "text": "Hello", "files": [], "error": false, "edit": false, "properties": {"text_color": "", "background_color": "", "edited": false, "source": {"id": null, "display_name": null, "source": null}, "icon": "", "allow_markdown": false, "positive_feedback": null, "state": "complete", "targets": []}, "category": "message", "content_blocks": [], "id": "12be981b-9816-4361-b0f9-ce65d0ba6cc1", "flow_id": "947eaf64-bc35-4431-ae52-8b30d819915b"}, "type": "message"}}, "logs": {"message": []}, "message": {"message": "Hello", "sender": "User", "sender_name": "User", "files": [], "type": "object"}, "artifacts": {"message": "Hello", "sender": "User", "sender_name": "User", "files": [], "type": "object"}, "timedelta": 0.01409304200205952, "duration": "14 ms", "used_frozen_result": false}, "timestamp": "2025-02-05T14:45:33.486696Z"}}}_15_15{"event": "end_vertex", "data": {"build_data": {"id": "Prompt-2gtLN", "inactivated_vertices": [], "next_vertices_ids": ["OpenAIModel-g7uMN"], "top_level_vertices": ["OpenAIModel-g7uMN"], "valid": true, "params": "None", "data": {"results": {}, "outputs": {"prompt": {"message": "Answer the user as if you were a GenAI expert, enthusiastic about helping them get started building something fresh.", "type": "text"}}, "logs": {"prompt": []}, "message": {"prompt": {"repr": "Answer the user as if you were a GenAI expert, enthusiastic about helping them get started building something fresh.", "raw": "Answer the user as if you were a GenAI expert, enthusiastic about helping them get started building something fresh.", "type": "text"}}, "artifacts": {"prompt": {"repr": "Answer the user as if you were a GenAI expert, enthusiastic about helping them get started building something fresh.", "raw": "Answer the user as if you were a GenAI expert, enthusiastic about helping them get started building something fresh.", "type": "text"}}, "timedelta": 0.005742790992371738, "duration": "6 ms", "used_frozen_result": false}, "timestamp": "2025-02-05T14:45:33.503829Z"}}}_15_15{"event": "end_vertex", "data": {"build_data": {"id": "OpenAIModel-g7uMN", "inactivated_vertices": [], "next_vertices_ids": ["ChatOutput-HnFx1"], "top_level_vertices": ["ChatOutput-HnFx1"], "valid": true, "params": "None", "data": {"results": {}, "outputs": {"text_output": {"message": "Hello! \ud83c\udf1f I'm excited to help you get started on your journey to building something fresh! What do you have in mind? Whether it's a project, an idea, or a concept, let's dive in and make it happen!", "type": "text"}, "model_output": {"message": "", "type": "unknown"}}, "logs": {"text_output": []}, "message": {"text_output": {"repr": "Hello! \ud83c\udf1f I'm excited to help you get started on your journey to building something fresh! What do you have in mind? Whether it's a project, an idea, or a concept, let's dive in and make it happen!", "raw": "Hello! \ud83c\udf1f I'm excited to help you get started on your journey to building something fresh! What do you have in mind? Whether it's a project, an idea, or a concept, let's dive in and make it happen!", "type": "text"}}, "artifacts": {"text_output": {"repr": "Hello! \ud83c\udf1f I'm excited to help you get started on your journey to building something fresh! What do you have in mind? Whether it's a project, an idea, or a concept, let's dive in and make it happen!", "raw": "Hello! \ud83c\udf1f I'm excited to help you get started on your journey to building something fresh! What do you have in mind? Whether it's a project, an idea, or a concept, let's dive in and make it happen!", "type": "text"}}, "timedelta": 1.8065362079942133, "duration": "1.81 seconds", "used_frozen_result": false}, "timestamp": "2025-02-05T14:45:35.310876Z"}}}_15_15{"event": "add_message", "data": {"timestamp": "2025-02-05T14:45:35", "sender": "Machine", "sender_name": "AI", "session_id": "947eaf64-bc35-4431-ae52-8b30d819915b", "text": "Hello! \ud83c\udf1f I'm excited to help you get started on your journey to building something fresh! What do you have in mind? Whether it's a project, an idea, or a concept, let's dive in and make it happen!", "files": [], "error": false, "edit": false, "properties": {"text_color": "", "background_color": "", "edited": false, "source": {"id": "OpenAIModel-g7uMN", "display_name": "OpenAI", "source": "gpt-4o-mini"}, "icon": "OpenAI", "allow_markdown": false, "positive_feedback": null, "state": "complete", "targets": []}, "category": "message", "content_blocks": [], "id": "56db271c-1dab-4a47-8464-d0058ac0943b", "flow_id": "947eaf64-bc35-4431-ae52-8b30d819915b"}}_15_15{"event": "end_vertex", "data": {"build_data": {"id": "ChatOutput-HnFx1", "inactivated_vertices": [], "next_vertices_ids": [], "top_level_vertices": [], "valid": true, "params": "- Files: []\n Message: Hello! \ud83c\udf1f I'm excited to help you get started on your journey to building\n something fresh! What do you have in mind? Whether it's a project, an idea, or\n a concept, let's dive in and make it happen!\n Sender: Machine\n Sender Name: AI\n Type: object\n", "data": {"results": {"message": {"text_key": "text", "data": {"timestamp": "2025-02-05T14:45:35+00:00", "sender": "Machine", "sender_name": "AI", "session_id": "947eaf64-bc35-4431-ae52-8b30d819915b", "text": "Hello! \ud83c\udf1f I'm excited to help you get started on your journey to building something fresh! What do you have in mind? Whether it's a project, an idea, or a concept, let's dive in and make it happen!", "files": [], "error": false, "edit": false, "properties": {"text_color": "", "background_color": "", "edited": false, "source": {"id": "OpenAIModel-g7uMN", "display_name": "OpenAI", "source": "gpt-4o-mini"}, "icon": "OpenAI", "allow_markdown": false, "positive_feedback": null, "state": "complete", "targets": []}, "category": "message", "content_blocks": [], "id": "56db271c-1dab-4a47-8464-d0058ac0943b", "flow_id": "947eaf64-bc35-4431-ae52-8b30d819915b"}, "default_value": "", "text": "Hello! \ud83c\udf1f I'm excited to help you get started on your journey to building something fresh! What do you have in mind? Whether it's a project, an idea, or a concept, let's dive in and make it happen!", "sender": "Machine", "sender_name": "AI", "files": [], "session_id": "947eaf64-bc35-4431-ae52-8b30d819915b", "timestamp": "2025-02-05T14:45:35+00:00", "flow_id": "947eaf64-bc35-4431-ae52-8b30d819915b", "error": false, "edit": false, "properties": {"text_color": "", "background_color": "", "edited": false, "source": {"id": "OpenAIModel-g7uMN", "display_name": "OpenAI", "source": "gpt-4o-mini"}, "icon": "OpenAI", "allow_markdown": false, "positive_feedback": null, "state": "complete", "targets": []}, "category": "message", "content_blocks": []}}, "outputs": {"message": {"message": {"timestamp": "2025-02-05T14:45:35+00:00", "sender": "Machine", "sender_name": "AI", "session_id": "947eaf64-bc35-4431-ae52-8b30d819915b", "text": "Hello! \ud83c\udf1f I'm excited to help you get started on your journey to building something fresh! What do you have in mind? Whether it's a project, an idea, or a concept, let's dive in and make it happen!", "files": [], "error": false, "edit": false, "properties": {"text_color": "", "background_color": "", "edited": false, "source": {"id": "OpenAIModel-g7uMN", "display_name": "OpenAI", "source": "gpt-4o-mini"}, "icon": "OpenAI", "allow_markdown": false, "positive_feedback": null, "state": "complete", "targets": []}, "category": "message", "content_blocks": [], "id": "56db271c-1dab-4a47-8464-d0058ac0943b", "flow_id": "947eaf64-bc35-4431-ae52-8b30d819915b"}, "type": "message"}}, "logs": {"message": []}, "message": {"message": "Hello! \ud83c\udf1f I'm excited to help you get started on your journey to building something fresh! What do you have in mind? Whether it's a project, an idea, or a concept, let's dive in and make it happen!", "sender": "Machine", "sender_name": "AI", "files": [], "type": "object"}, "artifacts": {"message": "Hello! \ud83c\udf1f I'm excited to help you get started on your journey to building something fresh! What do you have in mind? Whether it's a project, an idea, or a concept, let's dive in and make it happen!", "sender": "Machine", "sender_name": "AI", "files": [], "type": "object"}, "timedelta": 0.02948787499917671, "duration": "29 ms", "used_frozen_result": false}, "timestamp": "2025-02-05T14:45:35.345598Z"}}}_15_15{"event": "end", "data": {}}
This output is abbreviated, but the order of events illustrates how Langflow runs components.
vertices_sorted event:
_10ChatInput-8VNJS → Prompt-CDhMB → OpenAIModel-mXCyV → ChatOutput-Up0tW
_10ChatInput → Prompt → OpenAIModel → ChatOutput
add_message event.end_vertex event.token event represents individual pieces of text as they'r
end event tells you the flow executed with no errors.
If your flow executes with errors, the error event handler prints the errors to the playground.You can also pass values for start_component_id and stop_component_id in the body of the command to control where the flow run will start and stop.
+
The /build endpoint accepts values for start_component_id and stop_component_id to control where the flow run will start and stop.
+Setting stop_component_id for a component triggers the same behavior as clicking the Play button on that component, where all dependent components leading up to that component are also run.
For example, to stop flow execution at the Open AI model component, run the following command:
_10curl -X 'POST' \_10 "$LANGFLOW_URL/api/v1/build/$FLOW_ID/flow" \_10 -H 'accept: application/json' \_10 -H 'Content-Type: application/json' \_10 -H "x-api-key: $LANGFLOW_API_KEY" \_10 -d '{"stop_component_id": "OpenAIModel-Uksag"}'
Use the /flows endpoint to create, read, update, and delete flows.
Create a new flow.
-
_22curl -X 'POST' \_22 "$LANGFLOW_URL/api/v1/flows/" \_22 -H 'accept: application/json' \_22 -H 'Content-Type: application/json' \_22 -d '{_22 "name": "string2",_22 "description": "string",_22 "icon": "string",_22 "icon_bg_color": "#FF0000",_22 "gradient": "string",_22 "data": {},_22 "is_component": false,_22 "updated_at": "2024-12-30T15:48:01.519Z",_22 "webhook": false,_22 "endpoint_name": "string",_22 "tags": [_22 "string"_22 ],_22 "locked": false,_22 "user_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",_22 "folder_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6"_22}'
_25{_25 "name": "Untitled document (2)",_25 "description": "Conversational Cartography Unlocked.",_25 "icon": null,_25 "icon_bg_color": null,_25 "gradient": null,_25 "data": {_25 "nodes": [],_25 "edges": [],_25 "viewport": {_25 "zoom": 1,_25 "x": 0,_25 "y": 0_25 }_25 },_25 "is_component": false,_25 "updated_at": "2024-12-30T15:48:53+00:00",_25 "webhook": false,_25 "endpoint_name": null,_25 "tags": null,_25 "locked": false,_25 "id": "91be355a-3cd1-46b2-89c0-6b416391ad95",_25 "user_id": "f58396d4-a387-4bb8-b749-f40825c3d9f3",_25 "folder_id": "1415de42-8f01-4f36-bf34-539f23e47466"_25}
Retrieve a list of flows with pagination support.
-
_10curl -X 'GET' \_10 "$LANGFLOW_URL/api/v1/flows/?remove_example_flows=false&components_only=false&get_all=true&header_flows=false&page=1&size=50" \_10 -H 'accept: application/json'
_10A JSON object containing a list of flows.
To retrieve only the flows from a specific folder, pass folder_id in the query string.
_10curl -X 'GET' \_10 "$LANGFLOW_URL/api/v1/flows/?remove_example_flows=true&components_only=false&get_all=false&folder_id=$FOLDER_ID&header_flows=false&page=1&size=1" \_10 -H 'accept: application/json'
_10A JSON object containing a list of flows.
Read a specific flow by its ID.
-
_10curl -X 'GET' \_10 "$LANGFLOW_URL/api/v1/flows/$FLOW_ID" \_10 -H 'accept: application/json'
_12{_12 "name": "Basic Prompting",_12 "description": "Perform basic prompting with an OpenAI model.",_12 "icon": "Braces",_12 "icon_bg_color": null,_12 "gradient": "2",_12 "data": {_12 "nodes": [_12 ..._12 ]_12 }_12}
Update an existing flow by its ID.
-This example changes the value for endpoint_name from a random UUID to my_new_endpoint_name.
_12curl -X 'PATCH' \_12 "$LANGFLOW_URL/api/v1/flows/$FLOW_ID" \_12 -H 'accept: application/json' \_12 -H 'Content-Type: application/json' \_12 -d '{_12 "name": "string",_12 "description": "string",_12 "data": {},_12 "folder_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",_12 "endpoint_name": "my_new_endpoint_name",_12 "locked": true_12}'
_17{_17 "name": "string",_17 "description": "string",_17 "icon": "Braces",_17 "icon_bg_color": null,_17 "gradient": "2",_17 "data": {},_17 "is_component": false,_17 "updated_at": "2024-12-30T18:30:22+00:00",_17 "webhook": false,_17 "endpoint_name": "my_new_endpoint_name",_17 "tags": null,_17 "locked": true,_17 "id": "01ce083d-748b-4b8d-97b6-33adbb6a528a",_17 "user_id": "f58396d4-a387-4bb8-b749-f40825c3d9f3",_17 "folder_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6"_17}
Delete a specific flow by its ID.
-
_10curl -X 'DELETE' \_10 "$LANGFLOW_URL/api/v1/flows/$FLOW_ID" \_10 -H 'accept: application/json'
_10{_10 "message": "Flow deleted successfully"_10}
Create multiple new flows.
-
_44curl -X 'POST' \_44 "$LANGFLOW_URL/api/v1/flows/batch/" \_44 -H 'accept: application/json' \_44 -H 'Content-Type: application/json' \_44 -d '{_44 "flows": [_44 {_44 "name": "string",_44 "description": "string",_44 "icon": "string",_44 "icon_bg_color": "string",_44 "gradient": "string",_44 "data": {},_44 "is_component": false,_44 "updated_at": "2024-12-30T18:36:02.737Z",_44 "webhook": false,_44 "endpoint_name": "string",_44 "tags": [_44 "string"_44 ],_44 "locked": false,_44 "user_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",_44 "folder_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6"_44 },_44 {_44 "name": "string",_44 "description": "string",_44 "icon": "string",_44 "icon_bg_color": "string",_44 "gradient": "string",_44 "data": {},_44 "is_component": false,_44 "updated_at": "2024-12-30T18:36:02.737Z",_44 "webhook": false,_44 "endpoint_name": "string",_44 "tags": [_44 "string"_44 ],_44 "locked": false,_44 "user_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",_44 "folder_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6"_44 }_44 ]_44}'
_10[_10 {_10 // FlowRead objects_10 }_10]
Upload flows from a file.
-This example uploads a local file named agent-with-astra-db-tool.json.
_10curl -X 'POST' \_10 "$LANGFLOW_URL/api/v1/flows/upload/?folder_id=$FOLDER_ID" \_10 -H 'accept: application/json' \_10 -H 'Content-Type: multipart/form-data' \_10 -F 'file=@agent-with-astra-db-tool.json;type=application/json'
_11[_11 {_11 "name": "agent-with-astra-db-tool",_11 "description": "",_11 "icon": null,_11 "icon_bg_color": null,_11 "gradient": null,_11 "data": {}_11 ..._11 }_11]
To specify a target folder for the flow, include the query parameter folder_id.
-The target folder_id must already exist before uploading a flow. Call the /api/v1/folders/ endpoint for a list of available folders.
_10curl -X 'POST' \_10 "$LANGFLOW_URL/api/v1/flows/upload/?folder_id=$FOLDER_ID" \_10 -H 'accept: application/json' \_10 -H 'Content-Type: multipart/form-data' \_10 -F 'file=@agent-with-astra-db-tool.json;type=application/json'
Download all flows as a ZIP file.
-This endpoint downloads a ZIP file containing flows for all flow-id values listed in the command's body.
_10curl -X 'POST' \_10 "$LANGFLOW_URL/api/v1/flows/download/" \_10 -H 'accept: application/json' \_10 -H 'Content-Type: application/json' \_10 -d '[_10 "e1e40c77-0541-41a9-88ab-ddb3419398b5", "92f9a4c5-cfc8-4656-ae63-1f0881163c28"_10]' \_10 --output langflow-flows.zip
_10 % Total % Received % Xferd Average Speed Time Time Time Current_10 Dload Upload Total Spent Left Speed_10100 76437 0 76353 100 84 4516k 5088 --:--:-- --:--:-- --:--:-- 4665k
Retrieve a list of basic example flows.
-
_10curl -X 'GET' \_10 "$LANGFLOW_URL/api/v1/flows/basic_examples/" \_10 -H 'accept: application/json'
_10A list of example flows.
Use the /monitor endpoint to monitor and modify messages passed between Langflow components, vertex builds, and transactions.
Retrieve Vertex builds for a specific flow.
-
_10curl -X 'GET' \_10 "$LANGFLOW_URL/api/v1/monitor/builds?flow_id=$FLOW_ID" \_10 -H 'accept: application/json'
_10{"vertex_builds":{"ChatInput-NCmix":[{"data":{"results":{"message":{"text_key":"text","data":{"timestamp":"2024-12-23 19:10:57","sender":"User","sender_name":"User","session_id":"01ce083d-748b-4b8d-97b6-33adbb6a528a","text":"Hello","files":[],"error":"False","edit":"False","properties":{"text_color":"","background_color":"","edited":"False","source":{"id":"None","display_name":"None","source":"None"},"icon":"","allow_markdown":"False","positive_feedback":"None","state":"complete","targets":[]},"category":"message","content_blocks":[],"id":"c95bed34-f906-4aa6-84e4-68553f6db772","flow_id":"01ce083d-748b-4b8d-97b6-33adbb6a528a"},"default_value":"","text":"Hello","sender":"User","sender_name":"User","files":[],"session_id":"01ce083d-748b-4b8d-97b6-33adbb6a528a","timestamp":"2024-12-23 19:10:57+00:00","flow_id":"01ce083d-748b-4b8d-97b6-33adbb6a528a","error":"False","edit":"False","properties":{"text_color":"","background_color":"","edited":"False","source":{"id":"None","display_name":"None","source":"None"},"icon":"","allow_markdown":"False","positive_feedback":"None","state":"complete","targets":[]},"category":"message","content_blocks":[]}},"outputs":{"message":{"message":{"timestamp":"2024-12-23T19:10:57","sender":"User","sender_name":"User","session_id":"01ce083d-748b-4b8d-97b6-33adbb6a528a","text":"Hello","files":[],"error":false,"edit":false,"properties":{"text_color":"","background_color":"","edited":false,"source":{"id":null,"display_name":null,"source":null},"icon":"","allow_markdown":false,"positive_feedback":null,"state":"complete","targets":[]},"category":"message","content_blocks":[],"id":"c95bed34-f906-4aa6-84e4-68553f6db772","flow_id":"01ce083d-748b-4b8d-97b6-33adbb6a528a"},"type":"object"}},"logs":{"message":[]},"message":{"message":"Hello","sender":"User","sender_name":"User","files":[],"type":"object"},"artifacts":{"message":"Hello","sender":"User","sender_name":"User","files":[],"type":"object"},"timedelta":0.015060124918818474,"duration":"15 ms","used_frozen_result":false},"artifacts":{"message":"Hello","sender":"User","sender_name":"User","files":[],"type":"object"},"params":"- Files: []\n Message: Hello\n Sender: User\n Sender Name: User\n Type: object\n","valid":true,"build_id":"40aa200e-74db-4651-b698-f80301d2b26b","id":"ChatInput-NCmix","timestamp":"2024-12-23T19:10:58.772766Z","flow_id":"01ce083d-748b-4b8d-97b6-33adbb6a528a"}],"Prompt-BEn9c":[{"data":{"results":{},"outputs":{"prompt":{"message":"Answer the user as if you were a GenAI expert, enthusiastic about helping them get started building something fresh.","type":"text"}},"logs":{"prompt":[]},"message":{"prompt":{"repr":"Answer the user as if you were a GenAI expert, enthusiastic about helping them get started building something fresh.","raw":"Answer the user as if you were a GenAI expert, enthusiastic about helping them get started building something fresh.","type":"text"}},"artifacts":{"prompt":{"repr":"Answer the user as if you were a GenAI expert, enthusiastic about helping them get started building something fresh.","raw":"Answer the user as if you were a GenAI expert, enthusiastic about helping them get started building something fresh.","type":"text"}},"timedelta":0.0057758750626817346,"duration":"6 ms","used_frozen_result":false},"artifacts":{"prompt":{"repr":"Answer the user as if you were a GenAI expert, enthusiastic about helping them get started building something fresh.","raw":"Answer the user as if you were a GenAI expert, enthusiastic about helping them get started building something fresh.","type":"text"}},"params":"None","valid":true,"build_id":"39bbbfde-97fd-42a5-a9ed-d42a5c5d532b","id":"Prompt-BEn9c","timestamp":"2024-12-23T19:10:58.781019Z","flow_id":"01ce083d-748b-4b8d-97b6-33adbb6a528a"}],"OpenAIModel-7AjrN":[{"data":{"results":{},"outputs":{"text_output":{"message":"Hello! 🌟 I'm excited to help you get started on your journey to building something fresh! What do you have in mind? Whether it's a project, an idea, or a concept, let's dive in and make it happen!","type":"text"},"model_output":{"message":"","type":"unknown"}},"logs":{"text_output":[]},"message":{"text_output":{"repr":"Hello! 🌟 I'm excited to help you get started on your journey to building something fresh! What do you have in mind? Whether it's a project, an idea, or a concept, let's dive in and make it happen!","raw":"Hello! 🌟 I'm excited to help you get started on your journey to building something fresh! What do you have in mind? Whether it's a project, an idea, or a concept, let's dive in and make it happen!","type":"text"}},"artifacts":{"text_output":{"repr":"Hello! 🌟 I'm excited to help you get started on your journey to building something fresh! What do you have in mind? Whether it's a project, an idea, or a concept, let's dive in and make it happen!","raw":"Hello! 🌟 I'm excited to help you get started on your journey to building something fresh! What do you have in mind? Whether it's a project, an idea, or a concept, let's dive in and make it happen!","type":"text"}},"timedelta":1.034765167045407,"duration":"1.03 seconds","used_frozen_result":false},"artifacts":{"text_output":{"repr":"Hello! 🌟 I'm excited to help you get started on your journey to building something fresh! What do you have in mind? Whether it's a project, an idea, or a concept, let's dive in and make it happen!","raw":"Hello! 🌟 I'm excited to help you get started on your journey to building something fresh! What do you have in mind? Whether it's a project, an idea, or a concept, let's dive in and make it happen!","type":"text"}},"params":"None","valid":true,"build_id":"4f0ae730-a266-4d35-b89f-7b825c620a0f","id":"OpenAIModel-7AjrN","timestamp":"2024-12-23T19:10:58.790484Z","flow_id":"01ce083d-748b-4b8d-97b6-33adbb6a528a"}],"ChatOutput-sfUhT":[{"data":{"results":{"message":{"text_key":"text","data":{"timestamp":"2024-12-23 19:10:58","sender":"Machine","sender_name":"AI","session_id":"01ce083d-748b-4b8d-97b6-33adbb6a528a","text":"Hello! 🌟 I'm excited to help you get started on your journey to building something fresh! What do you have in mind? Whether it's a project, an idea, or a concept, let's dive in and make it happen!","files":[],"error":"False","edit":"False","properties":{"text_color":"","background_color":"","edited":"False","source":{"id":"OpenAIModel-7AjrN","display_name":"OpenAI","source":"gpt-4o-mini"},"icon":"OpenAI","allow_markdown":"False","positive_feedback":"None","state":"complete","targets":[]},"category":"message","content_blocks":[],"id":"5688356d-9f30-40ca-9907-79a7a2fc16fd","flow_id":"01ce083d-748b-4b8d-97b6-33adbb6a528a"},"default_value":"","text":"Hello! 🌟 I'm excited to help you get started on your journey to building something fresh! What do you have in mind? Whether it's a project, an idea, or a concept, let's dive in and make it happen!","sender":"Machine","sender_name":"AI","files":[],"session_id":"01ce083d-748b-4b8d-97b6-33adbb6a528a","timestamp":"2024-12-23 19:10:58+00:00","flow_id":"01ce083d-748b-4b8d-97b6-33adbb6a528a","error":"False","edit":"False","properties":{"text_color":"","background_color":"","edited":"False","source":{"id":"OpenAIModel-7AjrN","display_name":"OpenAI","source":"gpt-4o-mini"},"icon":"OpenAI","allow_markdown":"False","positive_feedback":"None","state":"complete","targets":[]},"category":"message","content_blocks":[]}},"outputs":{"message":{"message":{"timestamp":"2024-12-23T19:10:58","sender":"Machine","sender_name":"AI","session_id":"01ce083d-748b-4b8d-97b6-33adbb6a528a","text":"Hello! 🌟 I'm excited to help you get started on your journey to building something fresh! What do you have in mind? Whether it's a project, an idea, or a concept, let's dive in and make it happen!","files":[],"error":false,"edit":false,"properties":{"text_color":"","background_color":"","edited":false,"source":{"id":"OpenAIModel-7AjrN","display_name":"OpenAI","source":"gpt-4o-mini"},"icon":"OpenAI","allow_markdown":false,"positive_feedback":null,"state":"complete","targets":[]},"category":"message","content_blocks":[],"id":"5688356d-9f30-40ca-9907-79a7a2fc16fd","flow_id":"01ce083d-748b-4b8d-97b6-33adbb6a528a"},"type":"object"}},"logs":{"message":[]},"message":{"message":"Hello! 🌟 I'm excited to help you get started on your journey to building something fresh! What do you have in mind? Whether it's a project, an idea, or a concept, let's dive in and make it happen!","sender":"Machine","sender_name":"AI","files":[],"type":"object"},"artifacts":{"message":"Hello! 🌟 I'm excited to help you get started on your journey to building something fresh! What do you have in mind? Whether it's a project, an idea, or a concept, let's dive in and make it happen!","sender":"Machine","sender_name":"AI","files":[],"type":"object"},"timedelta":0.017838125000707805,"duration":"18 ms","used_frozen_result":false},"artifacts":{"message":"Hello! 🌟 I'm excited to help you get started on your journey to building something fresh! What do you have in mind? Whether it's a project, an idea, or a concept, let's dive in and make it happen!","sender":"Machine","sender_name":"AI","files":[],"type":"object"},"params":"- Files: []\n Message: Hello! 🌟 I'm excited to help you get started on your journey to building\n something fresh! What do you have in mind? Whether it's a project, an idea, or\n a concept, let's dive in and make it happen!\n Sender: Machine\n Sender Name: AI\n Type: object\n","valid":true,"build_id":"1e8b908b-aba7-403b-9e9b-eca92bb78668","id":"ChatOutput-sfUhT","timestamp":"2024-12-23T19:10:58.813268Z","flow_id":"01ce083d-748b-4b8d-97b6-33adbb6a528a"}]}}
Delete Vertex builds for a specific flow.
-
_10curl -X 'DELETE' \_10 "$LANGFLOW_URL/api/v1/monitor/builds?flow_id=$FLOW_ID" \_10 -H 'accept: */*'
_10204 No Content
Retrieve messages with optional filters.
-
_10curl -X 'GET' \_10 'http://127.0.0.1:7860/api/v1/monitor/messages' \_10 -H 'accept: application/json'
_10A list of all messages.
You can filter messages by flow_id, session_id, sender, and sender_name.
-Results can be ordered with the order_by query string.
This example retrieves messages sent by Machine and AI in a given chat session (session_id) and orders the messages by timestamp.
_10curl -X "GET" \_10 "$LANGFLOW_URL/api/v1/monitor/messages?flow_id=$FLOW_ID&session_id=01ce083d-748b-4b8d-97b6-33adbb6a528a&sender=Machine&sender_name=AI&order_by=timestamp" \_10 -H "accept: application/json"
_30[_30 {_30 "id": "1c1d6134-9b8b-4079-931c-84dcaddf19ba",_30 "flow_id": "01ce083d-748b-4b8d-97b6-33adbb6a528a",_30 "timestamp": "2024-12-23 19:20:11 UTC",_30 "sender": "Machine",_30 "sender_name": "AI",_30 "session_id": "01ce083d-748b-4b8d-97b6-33adbb6a528a",_30 "text": "Hello! It's great to see you here! What exciting project or idea are you thinking about diving into today? Whether it's something fresh and innovative or a classic concept with a twist, I'm here to help you get started! Let's brainstorm together!",_30 "files": "[]",_30 "edit": false,_30 "properties": {_30 "text_color": "",_30 "background_color": "",_30 "edited": false,_30 "source": {_30 "id": "OpenAIModel-7AjrN",_30 "display_name": "OpenAI",_30 "source": "gpt-4o-mini"_30 },_30 "icon": "OpenAI",_30 "allow_markdown": false,_30 "positive_feedback": null,_30 "state": "complete",_30 "targets": []_30 },_30 "category": "message",_30 "content_blocks": []_30 }_30]
Delete specific messages by their IDs.
-This example deletes the message retrieved in the previous Get messages example.
-
_10curl -v -X 'DELETE' \_10 '$LANGFLOW_URL/api/v1/monitor/messages' \_10 -H 'accept: */*' \_10 -H 'Content-Type: application/json' \_10 -d '[_10 "1c1d6134-9b8b-4079-931c-84dcaddf19ba"_10]'
_10204 No Content
To delete multiple messages, list the IDs within the array.
-
_10curl -v -X 'DELETE' \_10 '$LANGFLOW_URL/api/v1/monitor/messages' \_10 -H 'accept: */*' \_10 -H 'Content-Type: application/json' \_10 -d '["MESSAGE_ID_1", "MESSAGE_ID_2"]'
Update a specific message by its ID.
-This example updates the text value of message 3ab66cc6-c048-48f8-ab07-570f5af7b160.
_10curl -X 'PUT' \_10 "$LANGFLOW_URL/api/v1/monitor/messages/3ab66cc6-c048-48f8-ab07-570f5af7b160" \_10 -H 'accept: application/json' \_10 -H 'Content-Type: application/json' \_10 -d '{_10 "text": "testing 1234"_10}'
_10{"timestamp":"2024-12-23T18:49:06","sender":"string","sender_name":"string","session_id":"01ce083d-748b-4b8d-97b6-33adbb6a528a","text":"testing 1234","files":["string"],"error":true,"edit":true,"properties":{"text_color":"string","background_color":"string","edited":false,"source":{"id":"string","display_name":"string","source":"string"},"icon":"string","allow_markdown":false,"positive_feedback":true,"state":"complete","targets":[]},"category":"message","content_blocks":[],"id":"3ab66cc6-c048-48f8-ab07-570f5af7b160","flow_id":"01ce083d-748b-4b8d-97b6-33adbb6a528a"}
Update the session ID for messages.
-This example updates the session_ID value 01ce083d-748b-4b8d-97b6-33adbb6a528a to different_session_id.
_10curl -X 'PATCH' \_10 "$LANGFLOW_URL/api/v1/monitor/messages/session/01ce083d-748b-4b8d-97b6-33adbb6a528a?new_session_id=different_session_id" \_10 -H 'accept: application/json'
_30[_30 {_30 "id": "8dd7f064-e63a-4773-b472-ca0475249dfd",_30 "flow_id": "01ce083d-748b-4b8d-97b6-33adbb6a528a",_30 "timestamp": "2024-12-23 18:49:55 UTC",_30 "sender": "User",_30 "sender_name": "User",_30 "session_id": "different_session_id",_30 "text": "message",_30 "files": "[]",_30 "edit": false,_30 "properties": {_30 "text_color": "",_30 "background_color": "",_30 "edited": false,_30 "source": {_30 "id": null,_30 "display_name": null,_30 "source": null_30 },_30 "icon": "",_30 "allow_markdown": false,_30 "positive_feedback": null,_30 "state": "complete",_30 "targets": []_30 },_30 "category": "message",_30 "content_blocks": []_30 },_30]
Delete all messages for a specific session.
-
_10curl -X 'DELETE' \_10 '$LANGFLOW_URL/api/v1/monitor/messages/session/different_session_id_2' \_10 -H 'accept: */*'
_10HTTP/1.1 204 No Content
Retrieve all transactions (interactions between components) for a specific flow.
-
_10curl -X 'GET' \_10 '$LANGFLOW_URL/api/v1/monitor/transactions?flow_id=$FLOW_ID&page=1&size=50' \_10 -H 'accept: application/json'
_19{_19 "items": [_19 {_19 "timestamp": "2024-12-23T20:05:01.061Z",_19 "vertex_id": "string",_19 "target_id": "string",_19 "inputs": {},_19 "outputs": {},_19 "status": "string",_19 "error": "string",_19 "flow_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",_19 "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6"_19 }_19 ],_19 "total": 0,_19 "page": 1,_19 "size": 1,_19 "pages": 0_19}
Use the /folders endpoint to create, read, update, and delete folders.
Folders store your flows and components.
-Get a list of Langflow folders.
-
_10curl -X 'GET' \_10 '$LANGFLOW_URL/api/v1/folders/' \_10 -H 'accept: application/json'
_10[_10 {_10 "name": "My Projects",_10 "description": "Manage your own projects. Download and upload folders.",_10 "id": "1415de42-8f01-4f36-bf34-539f23e47466",_10 "parent_id": null_10 }_10]
Create a new folder.
-
_10curl -X 'POST' \_10 "$LANGFLOW_URL/api/v1/folders/" \_10 -H 'accept: application/json' \_10 -H 'Content-Type: application/json' \_10 -d '{_10 "name": "new_folder_name",_10 "description": "string",_10 "components_list": [],_10 "flows_list": []_10}'
_10{_10 "name": "new_folder_name",_10 "description": "string",_10 "id": "b408ddb9-6266-4431-9be8-e04a62758331",_10 "parent_id": null_10}
To add flows and components at folder creation, retrieve the components_list and flows_list values from the /api/v1/store/components and /api/v1/flows/read endpoints and add them to the request body.
Adding a flow to a folder moves the flow from its previous location. The flow is not copied.
-
_14curl -X 'POST' \_14 "$LANGFLOW_URL/api/v1/folders/" \_14 -H 'accept: application/json' \_14 -H 'Content-Type: application/json' \_14 -d '{_14 "name": "new_folder_name",_14 "description": "string",_14 "components_list": [_14 "3fa85f64-5717-4562-b3fc-2c963f66afa6"_14 ],_14 "flows_list": [_14 "3fa85f64-5717-4562-b3fc-2c963f66afa6"_14 ]_14}'
Retrieve details of a specific folder.
-To find the UUID of your folder, call the read folders endpoint.
-
_10curl -X 'GET' \_10 '$LANGFLOW_URL/api/v1/folders/$FOLDER_ID' \_10 -H 'accept: application/json'
_10[_10 {_10 "name": "My Projects",_10 "description": "Manage your own projects. Download and upload folders.",_10 "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",_10 "parent_id": null_10 }_10]
Update the information of a specific folder with a PATCH request.
Each PATCH request updates the folder with the values you send. -Only the fields you include in your request are updated. -If you send the same values multiple times, the update is still processed, even if the values are unchanged.
-
_15curl -X 'PATCH' \_15 '$LANGFLOW_URL/api/v1/folders/b408ddb9-6266-4431-9be8-e04a62758331' \_15 -H 'accept: application/json' \_15 -H 'Content-Type: application/json' \_15 -d '{_15 "name": "string",_15 "description": "string",_15 "parent_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",_15 "components": [_15 "3fa85f64-5717-4562-b3fc-2c963f66afa6"_15 ],_15 "flows": [_15 "3fa85f64-5717-4562-b3fc-2c963f66afa6"_15 ]_15}'
_10{_10 "name": "string",_10 "description": "string",_10 "id": "b408ddb9-6266-4431-9be8-e04a62758331",_10 "parent_id": null_10}
Delete a specific folder.
-
_10curl -X 'DELETE' \_10 '$LANGFLOW_URL/api/v1/folders/$FOLDER_ID' \_10 -H 'accept: */*'
_10204 No Content
Download all flows from a folder as a zip file.
-The --output flag is optional.
_10curl -X 'GET' \_10 '$LANGFLOW_URL/api/v1/folders/download/b408ddb9-6266-4431-9be8-e04a62758331' \_10 -H 'accept: application/json' \_10 --output langflow-folder.zip
_10The folder contents.
Upload a folder to Langflow.
-
_10curl -X 'POST' \_10 '$LANGFLOW_URL/api/v1/folders/upload/' \_10 -H 'accept: application/json' \_10 -H 'Content-Type: multipart/form-data' \_10 -F 'file=@20241230_135006_langflow_flows.zip;type=application/zip'
_10The folder contents are uploaded to Langflow.
_10curl -X POST \_10 "$LANGFLOW_URL/api/v1/build/$FLOW_ID/flow" \_10 -H "accept: application/json" \_10 -H "Content-Type: application/json" \_10 -H "x-api-key: $LANGFLOW_API_KEY" \_10 -d '{"stop_component_id": "OpenAIModel-Uksag"}'
The /build endpoint also accepts inputs for data directly, instead of using the values stored in the Langflow database.
+This is useful for running flows without having to pass custom values through the UI.
_14curl -X POST \_14 "$LANGFLOW_URL/api/v1/build/$FLOW_ID/flow" \_14 -H "accept: application/json" \_14 -H "Content-Type: application/json" \_14 -d '{_14 "data": {_14 "nodes": [],_14 "edges": []_14 },_14 "inputs": {_14 "input_value": "Your custom input here",_14 "session": "session_id"_14 }_14 }'
_10{"event": "vertices_sorted", "data": {"ids": [], "to_run": []}}_10_10{"event": "end", "data": {}}
Use the /files endpoint to add or delete files between your local machine and Langflow.
Upload a file to an existing flow.
This example uploads the_oscar_award.csv.
_10curl -X 'POST' \_10 '$LANGFLOW_URL/api/v1/files/upload/$FLOW_ID' \_10 -H 'accept: application/json' \_10 -H 'Content-Type: multipart/form-data' \_10 -F 'file=@the_oscar_award.csv'
_10{_10 "flowId": "92f9a4c5-cfc8-4656-ae63-1f0881163c28",_10 "file_path": "92f9a4c5-cfc8-4656-ae63-1f0881163c28/2024-12-30_15-19-43_the_oscar_award.csv"_10}
_10curl -X POST \_10 "$LANGFLOW_URL/api/v1/files/upload/$FLOW_ID" \_10 -H "accept: application/json" \_10 -H "Content-Type: multipart/form-data" \_10 -F "file=@the_oscar_award.csv"
_10{_10 "flowId": "92f9a4c5-cfc8-4656-ae63-1f0881163c28",_10 "file_path": "92f9a4c5-cfc8-4656-ae63-1f0881163c28/2024-12-30_15-19-43_the_oscar_award.csv"_10}
Send image files to the Langflow API for AI analysis.
The default file limit is 100 MB. To configure this value, change the LANGFLOW_MAX_FILE_SIZE_UPLOAD environment variable.
@@ -202,23 +137,92 @@ Pass the file path value as an input in the Tweaks section of t
_10"text": "This flowchart appears to represent a complex system for processing financial inquiries using various AI agents and tools. Here's a breakdown of its components and how they might work together..."
List all files associated with a specific flow.
-
_10curl -X 'GET' \_10 "$LANGFLOW_URL/api/v1/files/list/$FLOW_ID" \_10 -H 'accept: application/json'
_10{_10 "files": [_10 "2024-12-30_15-19-43_the_oscar_award.csv"_10 ]_10}
_10curl -X GET \_10 "$LANGFLOW_URL/api/v1/files/list/$FLOW_ID" \_10 -H "accept: application/json"
_10{_10 "files": [_10 "2024-12-30_15-19-43_the_oscar_award.csv"_10 ]_10}
Download a specific file for a given flow.
To look up the file name in Langflow, use the /list endpoint.
This example downloads the 2024-12-30_15-19-43_the_oscar_award.csv file from Langflow to a file named output-file.csv.
The --output flag is optional.
_10curl -X 'GET' \_10 "$LANGFLOW_URL/api/v1/files/download/$FLOW_ID/2024-12-30_15-19-43_the_oscar_award.csv" \_10 -H 'accept: application/json' \_10 --output output-file.csv
_10The file contents.
_10curl -X GET \_10 "$LANGFLOW_URL/api/v1/files/download/$FLOW_ID/2024-12-30_15-19-43_the_oscar_award.csv" \_10 -H "accept: application/json" \_10 --output output-file.csv
_10The file contents.
Download an image file for a given flow.
To look up the file name in Langflow, use the /list endpoint.
This example downloads the 2024-12-30_15-42-44_image-file.png file from Langflow to a file named output-image.png.
The --output flag is optional.
_10curl -X 'GET' \_10 "$LANGFLOW_URL/api/v1/files/images/$FLOW_ID/2024-12-30_15-42-44_image-file.png" \_10 -H 'accept: application/json' \_10 --output output-image.png
_10Image file content.
_10curl -X GET \_10 "$LANGFLOW_URL/api/v1/files/images/$FLOW_ID/2024-12-30_15-42-44_image-file.png" \_10 -H "accept: application/json" \_10 --output output-image.png
_10Image file content.
Delete a specific file from a flow.
This example deletes the 2024-12-30_15-42-44_image-file.png file from Langflow.
_10curl -X 'DELETE' \_10 "$LANGFLOW_URL/api/v1/files/delete/$FLOW_ID/2024-12-30_15-42-44_image-file.png" \_10 -H 'accept: application/json'
_10{_10 "message": "File 2024-12-30_15-42-44_image-file.png deleted successfully"_10}
_10curl -X DELETE \_10 "$LANGFLOW_URL/api/v1/files/delete/$FLOW_ID/2024-12-30_15-42-44_image-file.png" \_10 -H "accept: application/json"
_10{_10 "message": "File 2024-12-30_15-42-44_image-file.png deleted successfully"_10}
Use the /flows endpoint to create, read, update, and delete flows.
Create a new flow.
+
_19curl -X POST \_19 "$LANGFLOW_URL/api/v1/flows/" \_19 -H "accept: application/json" \_19 -H "Content-Type: application/json" \_19 -d '{_19 "name": "string2",_19 "description": "string",_19 "icon": "string",_19 "icon_bg_color": "#FF0000",_19 "gradient": "string",_19 "data": {},_19 "is_component": false,_19 "updated_at": "2024-12-30T15:48:01.519Z",_19 "webhook": false,_19 "endpoint_name": "string",_19 "tags": [_19 "string"_19 ]_19}'
_10{"name":"string2","description":"string","icon":"string","icon_bg_color":"#FF0000","gradient":"string","data":{},"is_component":false,"updated_at":"2025-02-04T21:07:36+00:00","webhook":false,"endpoint_name":"string","tags":["string"],"locked":false,"id":"e8d81c37-714b-49ae-ba82-e61141f020ee","user_id":"f58396d4-a387-4bb8-b749-f40825c3d9f3","folder_id":"1415de42-8f01-4f36-bf34-539f23e47466"}
Retrieve a list of flows with pagination support.
+
_10curl -X GET \_10 "$LANGFLOW_URL/api/v1/flows/?remove_example_flows=false&components_only=false&get_all=true&header_flows=false&page=1&size=50" \_10 -H "accept: application/json"
_10A JSON object containing a list of flows.
To retrieve only the flows from a specific folder, pass folder_id in the query string.
_10curl -X GET \_10 "$LANGFLOW_URL/api/v1/flows/?remove_example_flows=true&components_only=false&get_all=false&folder_id=$FOLDER_ID&header_flows=false&page=1&size=1" \_10 -H "accept: application/json"
_10A JSON object containing a list of flows.
Read a specific flow by its ID.
+
_10curl -X GET \_10 "$LANGFLOW_URL/api/v1/flows/$FLOW_ID" \_10 -H "accept: application/json"
_12{_12 "name": "Basic Prompting",_12 "description": "Perform basic prompting with an OpenAI model.",_12 "icon": "Braces",_12 "icon_bg_color": null,_12 "gradient": "2",_12 "data": {_12 "nodes": [_12 ..._12 ]_12 }_12}
Update an existing flow by its ID.
+This example changes the value for endpoint_name from a random UUID to my_new_endpoint_name.
_12curl -X PATCH \_12 "$LANGFLOW_URL/api/v1/flows/$FLOW_ID" \_12 -H "accept: application/json" \_12 -H "Content-Type: application/json" \_12 -d '{_12 "name": "string",_12 "description": "string",_12 "data": {},_12 "folder_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",_12 "endpoint_name": "my_new_endpoint_name",_12 "locked": true_12}'
_17{_17 "name": "string",_17 "description": "string",_17 "icon": "Braces",_17 "icon_bg_color": null,_17 "gradient": "2",_17 "data": {},_17 "is_component": false,_17 "updated_at": "2024-12-30T18:30:22+00:00",_17 "webhook": false,_17 "endpoint_name": "my_new_endpoint_name",_17 "tags": null,_17 "locked": true,_17 "id": "01ce083d-748b-4b8d-97b6-33adbb6a528a",_17 "user_id": "f58396d4-a387-4bb8-b749-f40825c3d9f3",_17 "folder_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6"_17}
Delete a specific flow by its ID.
+
_10curl -X DELETE \_10 "$LANGFLOW_URL/api/v1/flows/$FLOW_ID" \_10 -H "accept: application/json"
_10{_10 "message": "Flow deleted successfully"_10}
Create multiple new flows.
+
_44curl -X POST \_44 "$LANGFLOW_URL/api/v1/flows/batch/" \_44 -H "accept: application/json" \_44 -H "Content-Type: application/json" \_44 -d '{_44 "flows": [_44 {_44 "name": "string",_44 "description": "string",_44 "icon": "string",_44 "icon_bg_color": "string",_44 "gradient": "string",_44 "data": {},_44 "is_component": false,_44 "updated_at": "2024-12-30T18:36:02.737Z",_44 "webhook": false,_44 "endpoint_name": "string",_44 "tags": [_44 "string"_44 ],_44 "locked": false,_44 "user_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",_44 "folder_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6"_44 },_44 {_44 "name": "string",_44 "description": "string",_44 "icon": "string",_44 "icon_bg_color": "string",_44 "gradient": "string",_44 "data": {},_44 "is_component": false,_44 "updated_at": "2024-12-30T18:36:02.737Z",_44 "webhook": false,_44 "endpoint_name": "string",_44 "tags": [_44 "string"_44 ],_44 "locked": false,_44 "user_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",_44 "folder_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6"_44 }_44 ]_44}'
_10[_10 {_10 // FlowRead objects_10 }_10]
Upload flows from a file.
+This example uploads a local file named agent-with-astra-db-tool.json.
_10curl -X POST \_10 "$LANGFLOW_URL/api/v1/flows/upload/?folder_id=$FOLDER_ID" \_10 -H "accept: application/json" \_10 -H "Content-Type: multipart/form-data" \_10 -F "file=@agent-with-astra-db-tool.json;type=application/json"
_11[_11 {_11 "name": "agent-with-astra-db-tool",_11 "description": "",_11 "icon": null,_11 "icon_bg_color": null,_11 "gradient": null,_11 "data": {}_11 ..._11 }_11]
To specify a target folder for the flow, include the query parameter folder_id.
+The target folder_id must already exist before uploading a flow. Call the /api/v1/folders/ endpoint for a list of available folders.
_10curl -X POST \_10 "$LANGFLOW_URL/api/v1/flows/upload/?folder_id=$FOLDER_ID" \_10 -H "accept: application/json" \_10 -H "Content-Type: multipart/form-data" \_10 -F "file=@agent-with-astra-db-tool.json;type=application/json"
Download all flows as a ZIP file.
+This endpoint downloads a ZIP file containing flows for all flow-id values listed in the command's body.
_10curl -X POST \_10 "$LANGFLOW_URL/api/v1/flows/download/" \_10 -H "accept: application/json" \_10 -H "Content-Type: application/json" \_10 -d '[_10 "e1e40c77-0541-41a9-88ab-ddb3419398b5",_10 "92f9a4c5-cfc8-4656-ae63-1f0881163c28"_10]' \_10 --output langflow-flows.zip
_10 % Total % Received % Xferd Average Speed Time Time Time Current_10 Dload Upload Total Spent Left Speed_10100 76437 0 76353 100 84 4516k 5088 --:--:-- --:--:-- --:--:-- 4665k
Retrieve a list of basic example flows.
+
_10curl -X GET \_10 "$LANGFLOW_URL/api/v1/flows/basic_examples/" \_10 -H "accept: application/json"
_10A list of example flows.
Use the /folders endpoint to create, read, update, and delete folders.
Folders store your flows and components.
+Get a list of Langflow folders.
+
_10curl -X GET \_10 "$LANGFLOW_URL/api/v1/folders/" \_10 -H "accept: application/json"
_10[_10 {_10 "name": "My Projects",_10 "description": "Manage your own projects. Download and upload folders.",_10 "id": "1415de42-8f01-4f36-bf34-539f23e47466",_10 "parent_id": null_10 }_10]
Create a new folder.
+
_10curl -X POST \_10 "$LANGFLOW_URL/api/v1/folders/" \_10 -H "accept: application/json" \_10 -H "Content-Type: application/json" \_10 -d '{_10 "name": "new_folder_name",_10 "description": "string",_10 "components_list": [],_10 "flows_list": []_10}'
_10{_10 "name": "new_folder_name",_10 "description": "string",_10 "id": "b408ddb9-6266-4431-9be8-e04a62758331",_10 "parent_id": null_10}
To add flows and components at folder creation, retrieve the components_list and flows_list values from the /api/v1/store/components and /api/v1/flows/read endpoints and add them to the request body.
Adding a flow to a folder moves the flow from its previous location. The flow is not copied.
+
_14curl -X POST \_14 "$LANGFLOW_URL/api/v1/folders/" \_14 -H "accept: application/json" \_14 -H "Content-Type: application/json" \_14 -d '{_14 "name": "new_folder_name",_14 "description": "string",_14 "components_list": [_14 "3fa85f64-5717-4562-b3fc-2c963f66afa6"_14 ],_14 "flows_list": [_14 "3fa85f64-5717-4562-b3fc-2c963f66afa6"_14 ]_14}'
Retrieve details of a specific folder.
+To find the UUID of your folder, call the read folders endpoint.
+
_10curl -X GET \_10 "$LANGFLOW_URL/api/v1/folders/$FOLDER_ID" \_10 -H "accept: application/json"
_10[_10 {_10 "name": "My Projects",_10 "description": "Manage your own projects. Download and upload folders.",_10 "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",_10 "parent_id": null_10 }_10]
Update the information of a specific folder with a PATCH request.
Each PATCH request updates the folder with the values you send. +Only the fields you include in your request are updated. +If you send the same values multiple times, the update is still processed, even if the values are unchanged.
+
_15curl -X PATCH \_15 "$LANGFLOW_URL/api/v1/folders/b408ddb9-6266-4431-9be8-e04a62758331" \_15 -H "accept: application/json" \_15 -H "Content-Type: application/json" \_15 -d '{_15 "name": "string",_15 "description": "string",_15 "parent_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",_15 "components": [_15 "3fa85f64-5717-4562-b3fc-2c963f66afa6"_15 ],_15 "flows": [_15 "3fa85f64-5717-4562-b3fc-2c963f66afa6"_15 ]_15}'
_10{_10 "name": "string",_10 "description": "string",_10 "id": "b408ddb9-6266-4431-9be8-e04a62758331",_10 "parent_id": null_10}
Delete a specific folder.
+
_10curl -X DELETE \_10 "$LANGFLOW_URL/api/v1/folders/$FOLDER_ID" \_10 -H "accept: */*"
_10204 No Content
Download all flows from a folder as a zip file.
+The --output flag is optional.
_10curl -X GET \_10 "$LANGFLOW_URL/api/v1/folders/download/b408ddb9-6266-4431-9be8-e04a62758331" \_10 -H "accept: application/json" \_10 --output langflow-folder.zip
_10The folder contents.
Upload a folder to Langflow.
+
_10curl -X POST \_10 "$LANGFLOW_URL/api/v1/folders/upload/" \_10 -H "accept: application/json" \_10 -H "Content-Type: multipart/form-data" \_10 -F "file=@20241230_135006_langflow_flows.zip;type=application/zip"
_10The folder contents are uploaded to Langflow.
Retrieve logs for your Langflow flow.
This endpoint requires log retrieval to be enabled in your Langflow application.
@@ -229,7 +233,7 @@ Pass the file path value as an input in the Tweaks section of t
_10uv run langflow run --env-file .env
Stream logs in real-time using Server-Sent Events (SSE).
-
_10curl -X 'GET' \_10 "$LANGFLOW_URL/logs-stream" \_10 -H 'accept: text/event-stream'
_17keepalive_17_17{"1736355791151": "2025-01-08T12:03:11.151218-0500 DEBUG Building Chat Input\n"}_17_17{"1736355791485": "2025-01-08T12:03:11.485380-0500 DEBUG consumed event add_message-153bcd5d-ef4d-4ece-8cc0-47c6b6a9ef92 (time in queue, 0.0000, client 0.0001)\n"}_17_17{"1736355791499": "2025-01-08T12:03:11.499704-0500 DEBUG consumed event end_vertex-3d7125cd-7b8a-44eb-9113-ed5b785e3cf3 (time in queue, 0.0056, client 0.0047)\n"}_17_17{"1736355791502": "2025-01-08T12:03:11.502510-0500 DEBUG consumed event end-40d0b363-5618-4a23-bbae-487cd0b9594d (time in queue, 0.0001, client 0.0004)\n"}_17_17{"1736355791513": "2025-01-08T12:03:11.513097-0500 DEBUG Logged vertex build: 729ff2f8-6b01-48c8-9ad0-3743c2af9e8a\n"}_17_17{"1736355791834": "2025-01-08T12:03:11.834982-0500 DEBUG Telemetry data sent successfully.\n"}_17_17{"1736355791941": "2025-01-08T12:03:11.941840-0500 DEBUG Telemetry data sent successfully.\n"}_17_17keepalive
_10curl -X GET \_10 "$LANGFLOW_URL/logs-stream" \_10 -H "accept: text/event-stream"
_17keepalive_17_17{"1736355791151": "2025-01-08T12:03:11.151218-0500 DEBUG Building Chat Input\n"}_17_17{"1736355791485": "2025-01-08T12:03:11.485380-0500 DEBUG consumed event add_message-153bcd5d-ef4d-4ece-8cc0-47c6b6a9ef92 (time in queue, 0.0000, client 0.0001)\n"}_17_17{"1736355791499": "2025-01-08T12:03:11.499704-0500 DEBUG consumed event end_vertex-3d7125cd-7b8a-44eb-9113-ed5b785e3cf3 (time in queue, 0.0056, client 0.0047)\n"}_17_17{"1736355791502": "2025-01-08T12:03:11.502510-0500 DEBUG consumed event end-40d0b363-5618-4a23-bbae-487cd0b9594d (time in queue, 0.0001, client 0.0004)\n"}_17_17{"1736355791513": "2025-01-08T12:03:11.513097-0500 DEBUG Logged vertex build: 729ff2f8-6b01-48c8-9ad0-3743c2af9e8a\n"}_17_17{"1736355791834": "2025-01-08T12:03:11.834982-0500 DEBUG Telemetry data sent successfully.\n"}_17_17{"1736355791941": "2025-01-08T12:03:11.941840-0500 DEBUG Telemetry data sent successfully.\n"}_17_17keepalive
Retrieve logs with optional query parameters.
The default values for all three parameters is 0.
With these values, the endpoint returns the last 10 lines of logs.
_10curl -X 'GET' \_10 "$LANGFLOW_URL/logs?lines_before=0&lines_after=0×tamp=0" \_10 -H 'accept: application/json'
_12{_12 "1736354770500": "2025-01-08T11:46:10.500363-0500 DEBUG Creating starter project Document Q&A\n",_12 "1736354770511": "2025-01-08T11:46:10.511146-0500 DEBUG Creating starter project Image Sentiment Analysis\n",_12 "1736354770521": "2025-01-08T11:46:10.521018-0500 DEBUG Creating starter project SEO Keyword Generator\n",_12 "1736354770532": "2025-01-08T11:46:10.532677-0500 DEBUG Creating starter project Sequential Tasks Agents\n",_12 "1736354770544": "2025-01-08T11:46:10.544010-0500 DEBUG Creating starter project Custom Component Generator\n",_12 "1736354770555": "2025-01-08T11:46:10.555513-0500 DEBUG Creating starter project Prompt Chaining\n",_12 "1736354770588": "2025-01-08T11:46:10.588105-0500 DEBUG Create service ServiceType.CHAT_SERVICE\n",_12 "1736354771021": "2025-01-08T11:46:11.021817-0500 DEBUG Telemetry data sent successfully.\n",_12 "1736354775619": "2025-01-08T11:46:15.619545-0500 DEBUG Create service ServiceType.STORE_SERVICE\n",_12 "1736354775699": "2025-01-08T11:46:15.699661-0500 DEBUG File 046-rocket.svg retrieved successfully from flow /Users/mendon.kissling/Library/Caches/langflow/profile_pictures/Space.\n"_12}
Use the base Langflow API for running your flow and retrieving configuration information.
-This operation returns a dictionary of all Langflow components.
-
_10curl -X 'GET' \_10 "$LANGFLOW_URL/api/v1/all" \_10 -H 'accept: application/json'
_10A dictionary of all Langflow components.
Execute a specified flow by ID or name.
-
_20curl -X 'POST' \_20 "$LANGFLOW_URL/api/v1/run/$FLOW_ID?stream=false" \_20 -H 'accept: application/json' \_20 -H 'Content-Type: application/json' \_20 -d '{_20 "input_value": "string",_20 "input_type": "chat",_20 "output_type": "chat",_20 "output_component": "",_20 "tweaks": {_20 "Component Name": {_20 "parameter_name": "value"_20 },_20 "component_id": {_20 "parameter_name": "value"_20 },_20 "parameter_name": "value"_20 },_20 "session_id": "string"_20}'
_10{_10 "result": "Flow execution result",_10 "session_id": "session_uuid"_10}
The webhook endpoint triggers flow execution with an HTTP POST request.
-
_10curl -X POST \_10 "$LANGFLOW_URL/api/v1/webhook/$FLOW_ID" \_10 -H "Content-Type: application/json" \_10 -d '{"path": "/tmp/test_file.txt"}'
_10{_10 {"message":"Task started in the background","status":"in progress"}_10}
This endpoint is deprecated. Use the /run endpoint instead.
This endpoint is deprecated. Use the /run endpoint instead.
Get the status of a task.
-
_10curl -X 'GET' \_10 "$LANGFLOW_URL/api/v1/task/TASK_ID" \_10 -H 'accept: application/json'
_10{_10 "status": "Task status",_10 "result": "Task result if completed"_10}
This endpoint is deprecated. Use the /file endpoint instead.
Get the version of the Langflow API.
-
_10curl -X 'GET' \_10 "$LANGFLOW_URL/api/v1/version" \_10 -H 'accept: application/json'
_10{_10 "version": "1.1.1",_10 "main_version": "1.1.1",_10 "package": "Langflow"_10}
Retrieve the Langflow configuration information.
-
_10curl -X 'GET' \_10 "$LANGFLOW_URL/api/v1/config" \_10 -H 'accept: application/json'
_10{_10 "feature_flags": {_10 "mvp_components": false_10 },_10 "frontend_timeout": 0,_10 "auto_saving": true,_10 "auto_saving_interval": 1000,_10 "health_check_max_retries": 5,_10 "max_file_size_upload": 100_10}
_10curl -X GET \_10 "$LANGFLOW_URL/logs?lines_before=0&lines_after=0×tamp=0" \_10 -H "accept: application/json"
_12{_12 "1736354770500": "2025-01-08T11:46:10.500363-0500 DEBUG Creating starter project Document Q&A\n",_12 "1736354770511": "2025-01-08T11:46:10.511146-0500 DEBUG Creating starter project Image Sentiment Analysis\n",_12 "1736354770521": "2025-01-08T11:46:10.521018-0500 DEBUG Creating starter project SEO Keyword Generator\n",_12 "1736354770532": "2025-01-08T11:46:10.532677-0500 DEBUG Creating starter project Sequential Tasks Agents\n",_12 "1736354770544": "2025-01-08T11:46:10.544010-0500 DEBUG Creating starter project Custom Component Generator\n",_12 "1736354770555": "2025-01-08T11:46:10.555513-0500 DEBUG Creating starter project Prompt Chaining\n",_12 "1736354770588": "2025-01-08T11:46:10.588105-0500 DEBUG Create service ServiceType.CHAT_SERVICE\n",_12 "1736354771021": "2025-01-08T11:46:11.021817-0500 DEBUG Telemetry data sent successfully.\n",_12 "1736354775619": "2025-01-08T11:46:15.619545-0500 DEBUG Create service ServiceType.STORE_SERVICE\n",_12 "1736354775699": "2025-01-08T11:46:15.699661-0500 DEBUG File 046-rocket.svg retrieved successfully from flow /Users/mendon.kissling/Library/Caches/langflow/profile_pictures/Space.\n"_12}
Use the /monitor endpoint to monitor and modify messages passed between Langflow components, vertex builds, and transactions.
Retrieve Vertex builds for a specific flow.
+
_10curl -X GET \_10 "$LANGFLOW_URL/api/v1/monitor/builds?flow_id=$FLOW_ID" \_10 -H "accept: application/json"
_10{"vertex_builds":{"ChatInput-NCmix":[{"data":{"results":{"message":{"text_key":"text","data":{"timestamp":"2024-12-23 19:10:57","sender":"User","sender_name":"User","session_id":"01ce083d-748b-4b8d-97b6-33adbb6a528a","text":"Hello","files":[],"error":"False","edit":"False","properties":{"text_color":"","background_color":"","edited":"False","source":{"id":"None","display_name":"None","source":"None"},"icon":"","allow_markdown":"False","positive_feedback":"None","state":"complete","targets":[]},"category":"message","content_blocks":[],"id":"c95bed34-f906-4aa6-84e4-68553f6db772","flow_id":"01ce083d-748b-4b8d-97b6-33adbb6a528a"},"default_value":"","text":"Hello","sender":"User","sender_name":"User","files":[],"session_id":"01ce083d-748b-4b8d-97b6-33adbb6a528a","timestamp":"2024-12-23 19:10:57+00:00","flow_id":"01ce083d-748b-4b8d-97b6-33adbb6a528a","error":"False","edit":"False","properties":{"text_color":"","background_color":"","edited":"False","source":{"id":"None","display_name":"None","source":"None"},"icon":"","allow_markdown":"False","positive_feedback":"None","state":"complete","targets":[]},"category":"message","content_blocks":[]}},"outputs":{"message":{"message":{"timestamp":"2024-12-23T19:10:57","sender":"User","sender_name":"User","session_id":"01ce083d-748b-4b8d-97b6-33adbb6a528a","text":"Hello","files":[],"error":false,"edit":false,"properties":{"text_color":"","background_color":"","edited":false,"source":{"id":null,"display_name":null,"source":null},"icon":"","allow_markdown":false,"positive_feedback":null,"state":"complete","targets":[]},"category":"message","content_blocks":[],"id":"c95bed34-f906-4aa6-84e4-68553f6db772","flow_id":"01ce083d-748b-4b8d-97b6-33adbb6a528a"},"type":"object"}},"logs":{"message":[]},"message":{"message":"Hello","sender":"User","sender_name":"User","files":[],"type":"object"},"artifacts":{"message":"Hello","sender":"User","sender_name":"User","files":[],"type":"object"},"timedelta":0.015060124918818474,"duration":"15 ms","used_frozen_result":false},"artifacts":{"message":"Hello","sender":"User","sender_name":"User","files":[],"type":"object"},"params":"- Files: []\n Message: Hello\n Sender: User\n Sender Name: User\n Type: object\n","valid":true,"build_id":"40aa200e-74db-4651-b698-f80301d2b26b","id":"ChatInput-NCmix","timestamp":"2024-12-23T19:10:58.772766Z","flow_id":"01ce083d-748b-4b8d-97b6-33adbb6a528a"}],"Prompt-BEn9c":[{"data":{"results":{},"outputs":{"prompt":{"message":"Answer the user as if you were a GenAI expert, enthusiastic about helping them get started building something fresh.","type":"text"}},"logs":{"prompt":[]},"message":{"prompt":{"repr":"Answer the user as if you were a GenAI expert, enthusiastic about helping them get started building something fresh.","raw":"Answer the user as if you were a GenAI expert, enthusiastic about helping them get started building something fresh.","type":"text"}},"artifacts":{"prompt":{"repr":"Answer the user as if you were a GenAI expert, enthusiastic about helping them get started building something fresh.","raw":"Answer the user as if you were a GenAI expert, enthusiastic about helping them get started building something fresh.","type":"text"}},"timedelta":0.0057758750626817346,"duration":"6 ms","used_frozen_result":false},"artifacts":{"prompt":{"repr":"Answer the user as if you were a GenAI expert, enthusiastic about helping them get started building something fresh.","raw":"Answer the user as if you were a GenAI expert, enthusiastic about helping them get started building something fresh.","type":"text"}},"params":"None","valid":true,"build_id":"39bbbfde-97fd-42a5-a9ed-d42a5c5d532b","id":"Prompt-BEn9c","timestamp":"2024-12-23T19:10:58.781019Z","flow_id":"01ce083d-748b-4b8d-97b6-33adbb6a528a"}],"OpenAIModel-7AjrN":[{"data":{"results":{},"outputs":{"text_output":{"message":"Hello! 🌟 I'm excited to help you get started on your journey to building something fresh! What do you have in mind? Whether it's a project, an idea, or a concept, let's dive in and make it happen!","type":"text"},"model_output":{"message":"","type":"unknown"}},"logs":{"text_output":[]},"message":{"text_output":{"repr":"Hello! 🌟 I'm excited to help you get started on your journey to building something fresh! What do you have in mind? Whether it's a project, an idea, or a concept, let's dive in and make it happen!","raw":"Hello! 🌟 I'm excited to help you get started on your journey to building something fresh! What do you have in mind? Whether it's a project, an idea, or a concept, let's dive in and make it happen!","type":"text"}},"artifacts":{"text_output":{"repr":"Hello! 🌟 I'm excited to help you get started on your journey to building something fresh! What do you have in mind? Whether it's a project, an idea, or a concept, let's dive in and make it happen!","raw":"Hello! 🌟 I'm excited to help you get started on your journey to building something fresh! What do you have in mind? Whether it's a project, an idea, or a concept, let's dive in and make it happen!","type":"text"}},"timedelta":1.034765167045407,"duration":"1.03 seconds","used_frozen_result":false},"artifacts":{"text_output":{"repr":"Hello! 🌟 I'm excited to help you get started on your journey to building something fresh! What do you have in mind? Whether it's a project, an idea, or a concept, let's dive in and make it happen!","raw":"Hello! 🌟 I'm excited to help you get started on your journey to building something fresh! What do you have in mind? Whether it's a project, an idea, or a concept, let's dive in and make it happen!","type":"text"}},"params":"None","valid":true,"build_id":"4f0ae730-a266-4d35-b89f-7b825c620a0f","id":"OpenAIModel-7AjrN","timestamp":"2024-12-23T19:10:58.790484Z","flow_id":"01ce083d-748b-4b8d-97b6-33adbb6a528a"}],"ChatOutput-sfUhT":[{"data":{"results":{"message":{"text_key":"text","data":{"timestamp":"2024-12-23 19:10:58","sender":"Machine","sender_name":"AI","session_id":"01ce083d-748b-4b8d-97b6-33adbb6a528a","text":"Hello! 🌟 I'm excited to help you get started on your journey to building something fresh! What do you have in mind? Whether it's a project, an idea, or a concept, let's dive in and make it happen!","files":[],"error":"False","edit":"False","properties":{"text_color":"","background_color":"","edited":"False","source":{"id":"OpenAIModel-7AjrN","display_name":"OpenAI","source":"gpt-4o-mini"},"icon":"OpenAI","allow_markdown":"False","positive_feedback":"None","state":"complete","targets":[]},"category":"message","content_blocks":[],"id":"5688356d-9f30-40ca-9907-79a7a2fc16fd","flow_id":"01ce083d-748b-4b8d-97b6-33adbb6a528a"},"default_value":"","text":"Hello! 🌟 I'm excited to help you get started on your journey to building something fresh! What do you have in mind? Whether it's a project, an idea, or a concept, let's dive in and make it happen!","sender":"Machine","sender_name":"AI","files":[],"session_id":"01ce083d-748b-4b8d-97b6-33adbb6a528a","timestamp":"2024-12-23 19:10:58+00:00","flow_id":"01ce083d-748b-4b8d-97b6-33adbb6a528a","error":"False","edit":"False","properties":{"text_color":"","background_color":"","edited":"False","source":{"id":"OpenAIModel-7AjrN","display_name":"OpenAI","source":"gpt-4o-mini"},"icon":"OpenAI","allow_markdown":"False","positive_feedback":"None","state":"complete","targets":[]},"category":"message","content_blocks":[]}},"outputs":{"message":{"message":{"timestamp":"2024-12-23T19:10:58","sender":"Machine","sender_name":"AI","session_id":"01ce083d-748b-4b8d-97b6-33adbb6a528a","text":"Hello! 🌟 I'm excited to help you get started on your journey to building something fresh! What do you have in mind? Whether it's a project, an idea, or a concept, let's dive in and make it happen!","files":[],"error":false,"edit":false,"properties":{"text_color":"","background_color":"","edited":false,"source":{"id":"OpenAIModel-7AjrN","display_name":"OpenAI","source":"gpt-4o-mini"},"icon":"OpenAI","allow_markdown":false,"positive_feedback":null,"state":"complete","targets":[]},"category":"message","content_blocks":[],"id":"5688356d-9f30-40ca-9907-79a7a2fc16fd","flow_id":"01ce083d-748b-4b8d-97b6-33adbb6a528a"},"type":"object"}},"logs":{"message":[]},"message":{"message":"Hello! 🌟 I'm excited to help you get started on your journey to building something fresh! What do you have in mind? Whether it's a project, an idea, or a concept, let's dive in and make it happen!","sender":"Machine","sender_name":"AI","files":[],"type":"object"},"artifacts":{"message":"Hello! 🌟 I'm excited to help you get started on your journey to building something fresh! What do you have in mind? Whether it's a project, an idea, or a concept, let's dive in and make it happen!","sender":"Machine","sender_name":"AI","files":[],"type":"object"},"timedelta":0.017838125000707805,"duration":"18 ms","used_frozen_result":false},"artifacts":{"message":"Hello! 🌟 I'm excited to help you get started on your journey to building something fresh! What do you have in mind? Whether it's a project, an idea, or a concept, let's dive in and make it happen!","sender":"Machine","sender_name":"AI","files":[],"type":"object"},"params":"- Files: []\n Message: Hello! 🌟 I'm excited to help you get started on your journey to building\n something fresh! What do you have in mind? Whether it's a project, an idea, or\n a concept, let's dive in and make it happen!\n Sender: Machine\n Sender Name: AI\n Type: object\n","valid":true,"build_id":"1e8b908b-aba7-403b-9e9b-eca92bb78668","id":"ChatOutput-sfUhT","timestamp":"2024-12-23T19:10:58.813268Z","flow_id":"01ce083d-748b-4b8d-97b6-33adbb6a528a"}]}}
Delete Vertex builds for a specific flow.
+
_10curl -X DELETE \_10 "$LANGFLOW_URL/api/v1/monitor/builds?flow_id=$FLOW_ID" \_10 -H "accept: */*"
_10204 No Content
Retrieve messages with optional filters.
+
_10curl -X GET \_10 "$LANGFLOW_URL/api/v1/monitor/messages" \_10 -H "accept: application/json"
_10A list of all messages.
You can filter messages by flow_id, session_id, sender, and sender_name.
+Results can be ordered with the order_by query string.
This example retrieves messages sent by Machine and AI in a given chat session (session_id) and orders the messages by timestamp.
_10curl -X GET \_10 "$LANGFLOW_URL/api/v1/monitor/messages?flow_id=$FLOW_ID&session_id=01ce083d-748b-4b8d-97b6-33adbb6a528a&sender=Machine&sender_name=AI&order_by=timestamp" \_10 -H "accept: application/json"
_30[_30 {_30 "id": "1c1d6134-9b8b-4079-931c-84dcaddf19ba",_30 "flow_id": "01ce083d-748b-4b8d-97b6-33adbb6a528a",_30 "timestamp": "2024-12-23 19:20:11 UTC",_30 "sender": "Machine",_30 "sender_name": "AI",_30 "session_id": "01ce083d-748b-4b8d-97b6-33adbb6a528a",_30 "text": "Hello! It's great to see you here! What exciting project or idea are you thinking about diving into today? Whether it's something fresh and innovative or a classic concept with a twist, I'm here to help you get started! Let's brainstorm together!",_30 "files": "[]",_30 "edit": false,_30 "properties": {_30 "text_color": "",_30 "background_color": "",_30 "edited": false,_30 "source": {_30 "id": "OpenAIModel-7AjrN",_30 "display_name": "OpenAI",_30 "source": "gpt-4o-mini"_30 },_30 "icon": "OpenAI",_30 "allow_markdown": false,_30 "positive_feedback": null,_30 "state": "complete",_30 "targets": []_30 },_30 "category": "message",_30 "content_blocks": []_30 }_30]
Delete specific messages by their IDs.
+This example deletes the message retrieved in the previous Get messages example.
+
_10curl -v -X DELETE \_10 "$LANGFLOW_URL/api/v1/monitor/messages" \_10 -H "accept: */*" \_10 -H "Content-Type: application/json" \_10 -d '["MESSAGE_ID_1", "MESSAGE_ID_2"]'
_10204 No Content
Update a specific message by its ID.
+This example updates the text value of message 3ab66cc6-c048-48f8-ab07-570f5af7b160.
_10curl -X PUT \_10 "$LANGFLOW_URL/api/v1/monitor/messages/3ab66cc6-c048-48f8-ab07-570f5af7b160" \_10 -H "accept: application/json" \_10 -H "Content-Type: application/json" \_10 -d '{_10 "text": "testing 1234"_10}'
_10{"timestamp":"2024-12-23T18:49:06","sender":"string","sender_name":"string","session_id":"01ce083d-748b-4b8d-97b6-33adbb6a528a","text":"testing 1234","files":["string"],"error":true,"edit":true,"properties":{"text_color":"string","background_color":"string","edited":false,"source":{"id":"string","display_name":"string","source":"string"},"icon":"string","allow_markdown":false,"positive_feedback":true,"state":"complete","targets":[]},"category":"message","content_blocks":[],"id":"3ab66cc6-c048-48f8-ab07-570f5af7b160","flow_id":"01ce083d-748b-4b8d-97b6-33adbb6a528a"}
Update the session ID for messages.
+This example updates the session_ID value 01ce083d-748b-4b8d-97b6-33adbb6a528a to different_session_id.
_10curl -X PATCH \_10 "$LANGFLOW_URL/api/v1/monitor/messages/session/01ce083d-748b-4b8d-97b6-33adbb6a528a?new_session_id=different_session_id" \_10 -H "accept: application/json"
_30[_30 {_30 "id": "8dd7f064-e63a-4773-b472-ca0475249dfd",_30 "flow_id": "01ce083d-748b-4b8d-97b6-33adbb6a528a",_30 "timestamp": "2024-12-23 18:49:55 UTC",_30 "sender": "User",_30 "sender_name": "User",_30 "session_id": "different_session_id",_30 "text": "message",_30 "files": "[]",_30 "edit": false,_30 "properties": {_30 "text_color": "",_30 "background_color": "",_30 "edited": false,_30 "source": {_30 "id": null,_30 "display_name": null,_30 "source": null_30 },_30 "icon": "",_30 "allow_markdown": false,_30 "positive_feedback": null,_30 "state": "complete",_30 "targets": []_30 },_30 "category": "message",_30 "content_blocks": []_30 },_30]
Delete all messages for a specific session.
+
_10curl -X DELETE \_10 "$LANGFLOW_URL/api/v1/monitor/messages/session/different_session_id_2" \_10 -H "accept: */*"
_10HTTP/1.1 204 No Content
Retrieve all transactions (interactions between components) for a specific flow.
+
_10curl -X GET \_10 "$LANGFLOW_URL/api/v1/monitor/transactions?flow_id=$FLOW_ID&page=1&size=50" \_10 -H "accept: application/json"
_19{_19 "items": [_19 {_19 "timestamp": "2024-12-23T20:05:01.061Z",_19 "vertex_id": "string",_19 "target_id": "string",_19 "inputs": {},_19 "outputs": {},_19 "status": "string",_19 "error": "string",_19 "flow_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",_19 "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6"_19 }_19 ],_19 "total": 0,_19 "page": 1,_19 "size": 1,_19 "pages": 0_19}