Skip to main content

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.


_19
curl -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
}'

Create flows

Creates multiple new flows, returning an array of flow objects.


_44
curl -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.


_10
curl -X GET \
_10
"$LANGFLOW_URL/api/v1/flows/$FLOW_ID" \
_10
-H "accept: application/json"

Read flows

Returns a JSON object containing a list of flows.

Retrieve all flows with pagination:


_10
curl -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:


_10
curl -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:


_10
curl -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.


_12
curl -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
}'

Delete flow

Deletes a specific flow by its ID.


_10
curl -X DELETE \
_10
"$LANGFLOW_URL/api/v1/flows/$FLOW_ID" \
_10
-H "accept: application/json"

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.


_10
curl -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

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.


_10
curl -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"

Search