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.


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

Create flows

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


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


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

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" \
_10
-H "x-api-key: $LANGFLOW_API_KEY"

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" \
_10
-H "x-api-key: $LANGFLOW_API_KEY"

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" \
_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.


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

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" \
_10
-H "x-api-key: $LANGFLOW_API_KEY"

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

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
-H "x-api-key: $LANGFLOW_API_KEY" \
_10
-F "file=@agent-with-astra-db-tool.json;type=application/json"

Search