---
title: "Run Pipeline"
method: POST
path: "/datasets/{dataset_id}/pipeline/run"
tags: ["Knowledge Pipeline"]
---

# Run Pipeline

`POST /datasets/{dataset_id}/pipeline/run`

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

## Path parameters

- `dataset_id` string, uuid, required

## Request body

- object
  - `inputs` object, required — Key-value pairs for pipeline input variables defined in the workflow. Pass `{}` if the pipeline has no input variables.
  - `datasource_type` 'local_file' | 'online_document' | 'website_crawl' | 'online_drive', required — Type of the datasource. Determines which fields are expected in `datasource_info_list` items.
  - `datasource_info_list` union[], required — List of datasource objects to process. The expected item structure depends on `datasource_type`.
    - union
      - object
        - `reference` string, required — Use the `id` returned by the [Upload Pipeline File](/en/api-reference/knowledge-pipeline/upload-pipeline-file) endpoint. `related_id` is accepted as an alias.
        - `name` string — Document title. Defaults to `"untitled"`.
      - object
        - `workspace_id` string, required — ID of the workspace or database in the external platform (e.g., a Notion workspace ID).
        - `page` object, required — Page details.
          - `page_id` string, required — Page identifier.
          - `type` string, required — Page type defined by the datasource plugin (e.g., `"page"`, `"database"`).
          - `page_name` string — Display name. Defaults to `"untitled"`.
        - `credential_id` string — Credential for authenticating with the external platform. Managed via the Dify console. If omitted, the provider's default credential is used.
      - object
        - `url` string, required — URL to crawl.
        - `title` string — Used as the document name. Defaults to `"untitled"`.
      - object
        - `id` string, required — File or folder ID.
        - `type` 'file' | 'folder', required — Whether this entry is a single file or a folder to expand.
        - `bucket` string — Storage bucket name. Required by some drive providers (e.g., S3-compatible stores); omit if the provider does not use buckets.
        - `name` string — File name. Defaults to `"untitled"`.
  - `start_node_id` string, required — ID of the node to start execution from, from [List Datasource Plugins](/en/api-reference/knowledge-pipeline/list-datasource-plugins).
  - `is_published` boolean, required — Whether to run the published version of the pipeline instead of the current draft. Run the draft to test unpublished changes.
  - `response_mode` 'streaming' | 'blocking', required — Response mode for the pipeline execution. `streaming` returns a Server-Sent Events stream, `blocking` waits and returns the complete result.

## Response `200`

Pipeline execution result. Format depends on `response_mode`: streaming returns a `text/event-stream`, blocking returns a JSON object.

- object — Complete pipeline execution result. Returned when `response_mode` is `blocking`.

## Other responses

- `400` — `invalid_param` : The knowledge base has no processing pipeline configured, or the request body failed validation.
- `403` — `forbidden` : API access is not enabled for this knowledge base.
- `404` — `not_found` : No knowledge base matches `dataset_id`.
- `500` — `pipeline_run_error` : Pipeline execution failed.

---

[API](https://skmtc.net/langgenius/apis/dify-service-api.md) · [All operations](https://skmtc.net/langgenius/apis/dify-service-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/langgenius/dify-service-api/revisions/e49b3db72bad/schema)
