Flow management endpoints
Use the /flows
endpoint to create, read, update, and delete flows.
If you want to use the Langflow API to run a flow, see Flow trigger endpoints.
Create flow
Creates 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}'
_17{_17 "name": "string2",_17 "description": "string",_17 "icon": "string",_17 "icon_bg_color": "#FF0000",_17 "gradient": "string",_17 "data": {},_17 "is_component": false,_17 "updated_at": "2025-02-04T21:07:36+00:00",_17 "webhook": false,_17 "endpoint_name": "string",_17 "tags": ["string"],_17 "locked": false,_17 "id": "e8d81c37-714b-49ae-ba82-e61141f020ee",_17 "user_id": "f58396d4-a387-4bb8-b749-f40825c3d9f3",_17 "project_id": "1415de42-8f01-4f36-bf34-539f23e47466"_17}
Create flows
Creates multiple new flows, returning an array of flow objects.
_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 "project_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 "project_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6"_44 }_44 ]_44}'
Read flow
Retrieves 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}
Read flows
Returns a JSON object containing a list of flows.
Retrieve all flows with pagination:
_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"
To retrieve flows from a specific project, use the project_id
query parameter:
_10curl -X GET \_10 "$LANGFLOW_URL/api/v1/flows/?remove_example_flows=true&components_only=false&get_all=false&project_id=$PROJECT_ID&header_flows=false&page=1&size=1" \_10 -H "accept: application/json"
Read sample flows
Retrieves a list of sample flows:
_10curl -X GET \_10 "$LANGFLOW_URL/api/v1/flows/basic_examples/" \_10 -H "accept: application/json"
Update flow
Updates 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 "project_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 "project_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6"_17}
Delete flow
Deletes 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}
Export flows
Exports specified flows to a ZIP file.
This endpoint downloads a ZIP file containing Langflow JSON files for each flow ID listed in the request 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
Import flows
Imports flows by uploading a Langflow-compatible JSON file.
To specify a target project for the flow, include the query parameter project_id
.
The target project_id
must already exist before uploading a flow. Call the /api/v1/projects/ endpoint for a list of available projects.
This example uploads a local file named agent-with-astra-db-tool.json
to a project specified by a PROJECT_ID
variable.
- curl
- Result
_10curl -X POST \_10 "$LANGFLOW_URL/api/v1/flows/upload/?project_id=$PROJECT_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]