毕昇后端
  1. Workflow
毕昇后端
  • OpenAPI
    • Workflow
      • InvokeWorkflow
        POST
      • StopWorkflow
        POST
      • ProcessInputFile
        POST
  1. Workflow

InvokeWorkflow

开发中
POST
/api/v2/workflow/invoke
工作流使用说明文档

请求参数

Body 参数application/json
workflow_id
string 
工作流唯一ID
必需
stream
boolean 
是否流式
可选
是否流式,默认true
默认值:
true
input
object 
用户输入
可选
用户输入,在workflow是待输入状态时传入用户输入的内容
message_id
string 
消息唯一ID
可选
用户输入时需要传消息ID
session_id
string 
一次调用的唯一ID
可选
workflow运行期间唯一的标识,首次不用传后续传此参数。不传此参数默认是重新运行workflow
示例
{
    "workflow_id": "f460a816-edb2-488d-8ccb-701aed1c737d",
    "stream": false
}

示例代码

Shell
JavaScript
Java
Swift
Go
PHP
Python
HTTP
C
C#
Objective-C
Ruby
OCaml
Dart
R
请求示例请求示例
Shell
JavaScript
Java
Swift
curl --location --request POST '/api/v2/workflow/invoke' \
--header 'Content-Type: application/json' \
--data-raw '{
    "workflow_id": "f460a816-edb2-488d-8ccb-701aed1c737d",
    "stream": false
}'

返回响应

🟢200成功
application/json
Body
session_id
string 
会话ID
必需
一次调用的唯一标识
events
object 
事件
必需
返回的事件数据详情,具体格式参考示例
示例
data: {"session_id": "005a69272748406f9c6596b05063e536_async_task_id", "data": {"event": "guide_word", "message_id": null, "status": "end", "node_id": "start_d5a7c", "node_execution_id": "ec89f1cda99e43df88454ab92079b113", "output_schema": {"message": "请给我出一个脑筋急转弯,我会尝试猜出答案。当前可以试试出这个题:什么酒不能喝?", "output_key": null, "files": null, "source_url": null, "extra": null}, "input_schema": null}}

data: {"session_id": "005a69272748406f9c6596b05063e536_async_task_id", "data": {"event": "guide_question", "message_id": null, "status": "end", "node_id": "start_d5a7c", "node_execution_id": "ec89f1cda99e43df88454ab92079b113", "output_schema": {"message": ["什么酒不能喝", ""], "output_key": null, "files": null, "source_url": null, "extra": null}, "input_schema": null}}

data: {"session_id": "005a69272748406f9c6596b05063e536_async_task_id", "data": {"event": "input", "message_id": "384733", "status": "end", "node_id": "input_2c795", "node_execution_id": null, "output_schema": null, "input_schema": {"input_type": "dialog_input", "value": [{"key": "user_input", "type": "text", "value": null, "label": null, "multi": false, "required": true, "options": null}]}}}

修改于 2025-03-07 06:55:27
上一页
OpenAPI
下一页
StopWorkflow
Built with