知识流水线
运行流水线
对一个或多个数据源运行完整的知识流水线。response_mode 选择流式或阻塞响应。
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"
}
'
{}
Authorizations
Path Parameters
知识库 ID,通过 获取知识库列表 获取。使用限定范围的密钥时,从 Dify 页面 URL 复制 ID。
Body
application/json
datasource_info_list
(Local File · object | Online Document · object | Website Crawl · object | Online Drive · object)[]
required
待处理的数据源对象列表。条目结构取决于 datasource_type。
- Local File
- Online Document
- Website Crawl
- Online Drive
Show child attributes
Show child attributes
数据源类型。决定 datasource_info_list 中条目所需的字段。
Available options:
local_file, online_document, website_crawl, online_drive 流水线输入变量的键值对,对应工作流中定义的流水线变量。如果流水线没有输入变量,传 {}。
是否运行流水线的已发布版本,而非当前草稿。运行草稿可测试未发布的更改。
流水线执行的响应模式。streaming 返回服务器发送事件流,blocking 等待并返回完整结果。
Available options:
streaming, blocking Response
流水线执行结果。格式取决于 response_mode:流式返回 text/event-stream,阻塞返回完整的 JSON 结果。
完整的流水线执行结果。当 response_mode 为 blocking 时返回。
Last modified on September 30, 2026
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"
}
'
{}