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
_20curl -X POST \_20 "$LANGFLOW_URL/api/v1/flows/" \_20 -H "accept: application/json" \_20 -H "Content-Type: application/json" \_20 -H "x-api-key: $LANGFLOW_API_KEY" \_20 -d '{_20 "name": "string2",_20 "description": "string",_20 "icon": "string",_20 "icon_bg_color": "#FF0000",_20 "gradient": "string",_20 "data": {},_20 "is_component": false,_20 "updated_at": "2024-12-30T15:48:01.519Z",_20 "webhook": false,_20 "endpoint_name": "string",_20 "tags": [_20 "string"_20 ]_20}'
_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.
_45curl -X POST \_45 "$LANGFLOW_URL/api/v1/flows/batch/" \_45 -H "accept: application/json" \_45 -H "Content-Type: application/json" \_45 -H "x-api-key: $LANGFLOW_API_KEY" \_45 -d '{_45 "flows": [_45 {_45 "name": "string",_45 "description": "string",_45 "icon": "string",_45 "icon_bg_color": "string",_45 "gradient": "string",_45 "data": {},_45 "is_component": false,_45 "updated_at": "2024-12-30T18:36:02.737Z",_45 "webhook": false,_45 "endpoint_name": "string",_45 "tags": [_45 "string"_45 ],_45 "locked": false,_45 "user_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",_45 "project_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6"_45 },_45 {_45 "name": "string",_45 "description": "string",_45 "icon": "string",_45 "icon_bg_color": "string",_45 "gradient": "string",_45 "data": {},_45 "is_component": false,_45 "updated_at": "2024-12-30T18:36:02.737Z",_45 "webhook": false,_45 "endpoint_name": "string",_45 "tags": [_45 "string"_45 ],_45 "locked": false,_45 "user_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",_45 "project_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6"_45 }_45 ]_45}'
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" \_10 -H "x-api-key: $LANGFLOW_API_KEY"
_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" \_10 -H "x-api-key: $LANGFLOW_API_KEY"
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" \_10 -H "x-api-key: $LANGFLOW_API_KEY"
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" \_10 -H "x-api-key: $LANGFLOW_API_KEY"
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
_13curl -X PATCH \_13 "$LANGFLOW_URL/api/v1/flows/$FLOW_ID" \_13 -H "accept: application/json" \_13 -H "Content-Type: application/json" \_13 -H "x-api-key: $LANGFLOW_API_KEY" \_13 -d '{_13 "name": "string",_13 "description": "string",_13 "data": {},_13 "project_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",_13 "endpoint_name": "my_new_endpoint_name",_13 "locked": true_13}'
_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 -H "x-api-key: $LANGFLOW_API_KEY"
_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 -H "x-api-key: $LANGFLOW_API_KEY" \_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 -H "x-api-key: $LANGFLOW_API_KEY" \_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]