Knowledge Pipeline
Run Pipeline
Runs the full knowledge pipeline over one or more datasources. response_mode selects a streaming or blocking response.
POST
/
datasets
/
{dataset_id}
/
pipeline
/
run
curl --request POST \
--url https://{api_base_url}/datasets/{dataset_id}/pipeline/run \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"datasource_info_list": [
{
"name": "quarterly-report.pdf",
"reference": "a1b2c3d4-e5f6-7890-abcd-ef1234567890"
}
],
"datasource_type": "local_file",
"inputs": {},
"is_published": true,
"response_mode": "blocking",
"start_node_id": "1719288585006"
}
'{
"data": {
"created_at": 1741267200,
"finished_at": 1741267210,
"id": "f1e2d3c4-b5a6-7890-abcd-ef0987654321",
"outputs": {},
"status": "succeeded"
},
"task_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"workflow_run_id": "f1e2d3c4-b5a6-7890-abcd-ef0987654321"
}Authorizations
Every request authenticates with an API key: Authorization: Bearer {API_KEY}. App endpoints take an app API key; knowledge endpoints take a knowledge base API key (Get Started).
Keep keys server-side; never embed them in client code. Requests with a missing or invalid key fail with HTTP 401 (unauthorized).
Path Parameters
Knowledge base ID, from List Knowledge Bases. For a scoped key, copy the ID from the Dify URL.
Body
application/json
Response
Pipeline execution result. Format depends on response_mode: streaming returns a text/event-stream, blocking returns a JSON object.
Complete pipeline execution result. Returned when response_mode is blocking.
Was this page helpful?
⌘I
curl --request POST \
--url https://{api_base_url}/datasets/{dataset_id}/pipeline/run \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"datasource_info_list": [
{
"name": "quarterly-report.pdf",
"reference": "a1b2c3d4-e5f6-7890-abcd-ef1234567890"
}
],
"datasource_type": "local_file",
"inputs": {},
"is_published": true,
"response_mode": "blocking",
"start_node_id": "1719288585006"
}
'{
"data": {
"created_at": 1741267200,
"finished_at": 1741267210,
"id": "f1e2d3c4-b5a6-7890-abcd-ef0987654321",
"outputs": {},
"status": "succeeded"
},
"task_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"workflow_run_id": "f1e2d3c4-b5a6-7890-abcd-ef0987654321"
}