POST/datasets/{dataset_id}/pipeline/run

Run Pipeline

Runs the full knowledge pipeline over one or more datasources. response_mode selects a streaming or blocking response.

  • IdempotentThe SDK sends Idempotency-Key, so a retried request is only applied once.

1 parameter · 6 body fields
dataset_idstringrequired
Knowledge base ID, from [List Knowledge Bases](/en/api-reference/knowledge-bases/list-knowledge-bases). For a scoped key, [copy the ID from the Dify URL](/en/api-reference/guides/knowledge#knowledge-base-id).
datasource_info_listarray<LocalFile>required
List of datasource objects to process. The expected item structure depends on `datasource_type`.
datasource_typestringrequired
Type of the datasource. Determines which fields are expected in `datasource_info_list` items.
Allowed:local_fileonline_documentwebsite_crawlonline_drive
inputsobjectrequired
Key-value pairs for pipeline input variables defined in the workflow. Pass `{}` if the pipeline has no input variables.
is_publishedbooleanrequired
Whether to run the published version of the pipeline instead of the current draft. Run the draft to test unpublished changes.
response_modestringrequired
Response mode for the pipeline execution. `streaming` returns a Server-Sent Events stream, `blocking` waits and returns the complete result.
Allowed:streamingblocking
start_node_idstringrequired
ID of the node to start execution from, from [List Datasource Plugins](/en/api-reference/knowledge-pipeline/list-datasource-plugins).

5 status codes
200Pipeline execution result. Format depends on `response_mode`: streaming returns a `text/event-stream`, blocking returns a JSON object.
400`invalid_param` : The knowledge base has no processing pipeline configured, or the request body failed validation.

One documented failure

  • invalid_param

    Pipeline not found

    invalid_param

403- `forbidden` : API access is not enabled for this knowledge base. - `forbidden` : The API key is scoped to specific knowledge bases, and this knowledge base is not one of them.

One documented failure

  • forbidden

    Dataset api access is not enabled.

    forbidden (api access)

404`not_found` : No knowledge base matches `dataset_id`.

One documented failure

  • not_found

    Dataset not found.

    not_found

500`pipeline_run_error` : Pipeline execution failed.

One documented failure

  • pipeline_run_error

    Pipeline execution failed: connection timeout

    pipeline_run_error

Error handling

A 400 is returned: invalid_param : The knowledge base has no processing pipeline configured, or the request body failed validation. A 403 is returned: - forbidden : API access is not enabled for this knowledge base.

  • forbidden : The API key is scoped to specific knowledge bases, and this knowledge base is not one of them. A 404 is returned: not_found : No knowledge base matches dataset_id. A 500 is returned: pipeline_run_error : Pipeline execution failed.