API examples
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
.
Export values
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.
- Export your Langflow URL in your terminal.
Langflow starts by default at
http://127.0.0.1:7860
.
_10export LANGFLOW_URL="http://127.0.0.1:7860"
- Export the
flow-id
in your terminal. Theflow-id
is found in the Publish pane or in the flow's URL.
_10export FLOW_ID="359cd752-07ea-46f2-9d3b-a4407ef618da"
- Export the
folder-id
in your terminal. To find your folder ID, call the Langflow /api/v1/folders/ endpoint for a list of folders.
- curl
- Result
_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"
- Export the Langflow API key as an environment variable. To create a Langflow API key, run the following command in the Langflow CLI.
- curl
- Result
_10langflow api-key
_10API Key Created Successfully:_10sk-...
Export the generated API key as an environment variable.
_10export LANGFLOW_API_KEY="sk-..."
Base
Use the base Langflow API to run your flow and retrieve configuration information.
Get all components
This operation returns a dictionary of all Langflow components.
- curl
- Result
_10curl -X GET \_10 "$LANGFLOW_URL/api/v1/all" \_10 -H "accept: application/json"
_10A dictionary of all Langflow components.
Run flow
Execute a specified flow by ID or name. The flow is executed as a batch, but LLM responses can be streamed.
This example runs a Basic Prompting flow with a given flow_id
and passes a JSON object as the input value.
The parameters are passed in the request body. In this example, the values are the default values.
- curl
- Result
_11curl -X POST \_11 "$LANGFLOW_URL/api/v1/run/$FLOW_ID" \_11 -H "Content-Type: application/json" \_11 -d '{_11 "input_value": "Tell me about something interesting!",_11 "session_id": "chat-123",_11 "input_type": "chat",_11 "output_type": "chat",_11 "output_component": "",_11 "tweaks": null_11 }'
_29{_29 "session_id": "chat-123",_29 "outputs": [{_29 "inputs": {_29 "input_value": "Tell me about something interesting!"_29 },_29 "outputs": [{_29 "results": {_29 "message": {_29 "text": "Sure! Have you ever heard of the phenomenon known as \"bioluminescence\"? It's a fascinating natural occurrence where living organisms produce and emit light. This ability is found in various species, including certain types of jellyfish, fireflies, and deep-sea creatures like anglerfish.\n\nBioluminescence occurs through a chemical reaction in which a light-emitting molecule called luciferin reacts with oxygen, catalyzed by an enzyme called luciferase. The result is a beautiful glow that can serve various purposes, such as attracting mates, deterring predators, or luring prey.\n\nOne of the most stunning displays of bioluminescence can be seen in the ocean, where certain plankton emit light when disturbed, creating a mesmerizing blue glow in the water. This phenomenon is often referred to as \"sea sparkle\" and can be seen in coastal areas around the world.\n\nBioluminescence not only captivates our imagination but also has practical applications in science and medicine, including the development of biosensors and imaging techniques. It's a remarkable example of nature's creativity and complexity!",_29 "sender": "Machine",_29 "sender_name": "AI",_29 "session_id": "chat-123",_29 "timestamp": "2025-03-03T17:17:37+00:00",_29 "flow_id": "d2bbd92b-187e-4c84-b2d4-5df365704201",_29 "properties": {_29 "source": {_29 "id": "OpenAIModel-d1wOZ",_29 "display_name": "OpenAI",_29 "source": "gpt-4o-mini"_29 },_29 "icon": "OpenAI"_29 },_29 "component_id": "ChatOutput-ylMzN"_29 }_29 }_29 }]_29 }]_29}
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.
- curl
- Result
_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 -d '{_10 "message": "Tell me something interesting!",_10 "session_id": "chat-123"_10 }'
_19{"event": "add_message", "data": {"timestamp": "2025-03-03T17:20:18", "sender": "User", "sender_name": "User", "session_id": "chat-123", "text": "Tell me about something interesting!", "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": "0103a21b-ebf7-4c02-9d72-017fb297f812", "flow_id": "d2bbd92b-187e-4c84-b2d4-5df365704201"}}_19_19{"event": "add_message", "data": {"timestamp": "2025-03-03T17:20:18", "sender": "Machine", "sender_name": "AI", "session_id": "chat-123", "text": "", "files": [], "error": false, "edit": false, "properties": {"text_color": "", "background_color": "", "edited": false, "source": {"id": "OpenAIModel-d1wOZ", "display_name": "OpenAI", "source": "gpt-4o-mini"}, "icon": "OpenAI", "allow_markdown": false, "positive_feedback": null, "state": "complete", "targets": []}, "category": "message", "content_blocks": [], "id": "27b66789-e673-4c65-9e81-021752925161", "flow_id": "d2bbd92b-187e-4c84-b2d4-5df365704201"}}_19_19{"event": "token", "data": {"chunk": " Have", "id": "27b66789-e673-4c65-9e81-021752925161", "timestamp": "2025-03-03 17:20:18 UTC"}}_19_19{"event": "token", "data": {"chunk": " you", "id": "27b66789-e673-4c65-9e81-021752925161", "timestamp": "2025-03-03 17:20:18 UTC"}}_19_19{"event": "token", "data": {"chunk": " ever", "id": "27b66789-e673-4c65-9e81-021752925161", "timestamp": "2025-03-03 17:20:18 UTC"}}_19_19{"event": "token", "data": {"chunk": " heard", "id": "27b66789-e673-4c65-9e81-021752925161", "timestamp": "2025-03-03 17:20:18 UTC"}}_19_19{"event": "token", "data": {"chunk": " of", "id": "27b66789-e673-4c65-9e81-021752925161", "timestamp": "2025-03-03 17:20:18 UTC"}}_19_19{"event": "token", "data": {"chunk": " the", "id": "27b66789-e673-4c65-9e81-021752925161", "timestamp": "2025-03-03 17:20:18 UTC"}}_19_19{"event": "token", "data": {"chunk": " phenomenon", "id": "27b66789-e673-4c65-9e81-021752925161", "timestamp": "2025-03-03 17:20:18 UTC"}}_19_19{"event": "end", "data": {"result": {"session_id": "chat-123", "message": "Sure! Have you ever heard of the phenomenon known as \"bioluminescence\"?..."}}}
This result is abbreviated, but illustrates where the end
event completes the LLM's token streaming response.
Run endpoint headers and parameters
Parameters can be passed to the /run
endpoint in three ways:
- URL path:
flow_id
as part of the endpoint path - Query string:
stream
parameter in the URL - Request body: JSON object containing the remaining parameters
Headers
Header | Info | Example |
---|---|---|
Content-Type | Required. Specifies the JSON format. | "application/json" |
accept | Required. Specifies the response format. | "application/json" |
x-api-key | Optional. Required only if authentication is enabled. | "sk-..." |
Parameters
Parameter | Type | Info |
---|---|---|
flow_id | UUID/string | Required. Part of URL: /run/{flow_id} |
stream | boolean | Optional. Query parameter: /run/{flow_id}?stream=true |
input_value | string | Optional. JSON body field. Main input text/prompt. Default: null |
input_type | string | Optional. JSON body field. Input type ("chat" or "text"). Default: "chat" |
output_type | string | Optional. JSON body field. Output type ("chat", "any", "debug"). Default: "chat" |
output_component | string | Optional. JSON body field. Target component for output. Default: "" |
tweaks | object | Optional. JSON body field. Component adjustments. Default: null |
session_id | string | Optional. JSON body field. Conversation context ID. Default: null |
Example request
_17curl -X POST \_17 "http://$LANGFLOW_URL/api/v1/run/$FLOW_ID?stream=true" \_17 -H "Content-Type: application/json" \_17 -H "accept: application/json" \_17 -H "x-api-key: sk-..." \_17 -d '{_17 "input_value": "Tell me a story",_17 "input_type": "chat",_17 "output_type": "chat",_17 "output_component": "chat_output",_17 "session_id": "chat-123",_17 "tweaks": {_17 "component_id": {_17 "parameter_name": "value"_17 }_17 }_17 }'
Webhook run flow
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.
- curl
- Result
_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}
Process
This endpoint is deprecated. Use the /run
endpoint instead.
Predict
This endpoint is deprecated. Use the /run
endpoint instead.
Get task status
Get the status of a task.
- curl
- Result
_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}
Create upload file (Deprecated)
This endpoint is deprecated. Use the /file
endpoint instead.
Get version
Get the version of the Langflow API.
- curl
- Result
_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}
Get config
Retrieve the Langflow configuration information.
- curl
- Result
_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}
Build
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.
Build flow
This endpoint is meant to be used by the frontend and is not optimized for external use.
To run your flow, use the /run
endpoint instead.
This endpoint builds and executes a flow, returning a job ID that can be used to stream execution events.
- Send a POST request to the
/build/{flow_id}/flow
endpoint.
- curl
- Result
_10curl -X POST \_10 "$LANGFLOW_URL/api/v1/build/$FLOW_ID/flow" \_10 -H "accept: application/json" \_10 -H "Content-Type: application/json" \_10 -d '{_10 "inputs": {_10 "input_value": "Tell me a story"_10 }_10 }'
_10{_10 "job_id": "123e4567-e89b-12d3-a456-426614174000"_10}
- After receiving a job ID from the build endpoint, use the
/build/{job_id}/events
endpoint to stream the execution results:
- curl
- Result
_10curl -X GET \_10 "$LANGFLOW_URL/api/v1/build/123e4567-e89b-12d3-a456-426614174000/events" \_10 -H "accept: application/json"
_10{"event": "vertices_sorted", "data": {"ids": ["ChatInput-XtBLx"], "to_run": ["Prompt-x74Ze", "ChatOutput-ylMzN", "ChatInput-XtBLx", "OpenAIModel-d1wOZ"]}}_10_10{"event": "add_message", "data": {"timestamp": "2025-03-03T17:42:23", "sender": "User", "sender_name": "User", "session_id": "d2bbd92b-187e-4c84-b2d4-5df365704201", "text": "Tell me a story", "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": "28879bd8-6a68-4dd5-b658-74d643a4dd92", "flow_id": "d2bbd92b-187e-4c84-b2d4-5df365704201"}}_10_10// ... Additional events as the flow executes ..._10_10{"event": "end", "data": {}}
The events endpoint accepts an optional stream
query parameter which defaults to true
.
To disable streaming and get all events at once, set stream
to false
.
_10curl -X GET \_10 "$LANGFLOW_URL/api/v1/build/123e4567-e89b-12d3-a456-426614174000/events?stream=false" \_10 -H "accept: application/json"
Build endpoint headers and parameters
Headers
Header | Info | Example |
---|---|---|
Content-Type | Required. Specifies the JSON format. | "application/json" |
accept | Required. Specifies the response format. | "application/json" |
x-api-key | Optional. Required only if authentication is enabled. | "sk-..." |
The /build/{flow_id}/flow
endpoint accepts the following parameters in its request body:
Parameters
Parameter | Type | Description |
---|---|---|
inputs | object | Optional. Input values for flow components. |
data | object | Optional. Flow data to override stored configuration. |
files | array[string] | Optional. List of file paths to use. |
stop_component_id | string | Optional. ID of the component where the execution should stop. |
start_component_id | string | Optional. ID of the component where the execution should start. |
log_builds | boolean | Optional. Control build logging. Default: true . |
Configure the build endpoint
The /build
endpoint accepts optional 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"}'
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.
- curl
- Result
_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{"job_id":"0bcc7f23-40b4-4bfa-9b8a-a44181fd1175"}
Files
Use the /files
endpoint to add or delete files between your local machine and Langflow.
Upload file
Upload a file to an existing flow.
This example uploads the_oscar_award.csv
.
- curl
- Result
_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}
Upload image files
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.
For more information, see Supported environment variables.
- To send an image to your flow with the API, POST the image file to the
v1/files/upload/<YOUR-FLOW-ID>
endpoint of your flow.
_10curl -X POST "$LANGFLOW_URL/api/v1/files/upload/a430cc57-06bb-4c11-be39-d3d4de68d2c4" \_10 -H "Content-Type: multipart/form-data" \_10 -F "file=@image-file.png"
The API returns the image file path in the format "file_path":"<YOUR-FLOW-ID>/<TIMESTAMP>_<FILE-NAME>"}
.
_10{"flowId":"a430cc57-06bb-4c11-be39-d3d4de68d2c4","file_path":"a430cc57-06bb-4c11-be39-d3d4de68d2c4/2024-11-27_14-47-50_image-file.png"}
- Post the image file to the Chat Input component of a Basic prompting flow. Pass the file path value as an input in the Tweaks section of the curl call to Langflow.
_12curl -X POST \_12 "$LANGFLOW_URL/api/v1/run/a430cc57-06bb-4c11-be39-d3d4de68d2c4?stream=false" \_12 -H 'Content-Type: application/json'\_12 -d '{_12 "output_type": "chat",_12 "input_type": "chat",_12 "tweaks": {_12 "ChatInput-b67sL": {_12 "files": "a430cc57-06bb-4c11-be39-d3d4de68d2c4/2024-11-27_14-47-50_image-file.png",_12 "input_value": "what do you see?"_12 }_12}}'
Your chatbot describes the image file you sent.
_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 files
List all files associated with a specific flow.
- curl
- Result
_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 file
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.
- curl
- Result
_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 image
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.
- curl
- Result
_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 file
Delete a specific file from a flow.
This example deletes the 2024-12-30_15-42-44_image-file.png
file from Langflow.
- curl
- Result
_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}
Flows
Use the /flows
endpoint to create, read, update, and delete flows.
Create flow
Create a new flow.
- curl
- Result
_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"}
Read flows
Retrieve a list of flows with pagination support.
- curl
- Result
_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.
- curl
- Result
_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 flow
Read a specific flow by its ID.
- curl
- Result
_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 flow
Update an existing flow by its ID.
This example changes the value for endpoint_name
from a random UUID to my_new_endpoint_name
.
- curl
- Result
_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 flow
Delete a specific flow by its ID.
- curl
- Result
_10curl -X DELETE \_10 "$LANGFLOW_URL/api/v1/flows/$FLOW_ID" \_10 -H "accept: application/json"
_10{_10 "message": "Flow deleted successfully"_10}
Create flows
Create multiple new flows.
- curl
- Result
_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
Upload flows from a file.
This example uploads a local file named agent-with-astra-db-tool.json
.
- curl
- Result
_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
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.
- curl
- Result
_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
Read basic examples
Retrieve a list of basic example flows.
- curl
- Result
_10curl -X GET \_10 "$LANGFLOW_URL/api/v1/flows/basic_examples/" \_10 -H "accept: application/json"
_10A list of example flows.
Folders
Use the /folders
endpoint to create, read, update, and delete folders.
Folders store your flows and components.
Read folders
Get a list of Langflow folders.
- curl
- Result
_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 folder
Create a new folder.
- curl
- Result
_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}'
Read folder
Retrieve details of a specific folder.
To find the UUID of your folder, call the read folders endpoint.
- curl
- Result
_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]