工作流运行
流式获取工作流事件
适用于:Chatflow、Workflow。
在工作流运行暂停或原始 SSE 连接断开后恢复 Server-Sent Events 流。对于已结束的运行,流仅发送单个 workflow_finished 事件后关闭。
如需查看进行中运行的节点级状态与进度,可在调用时附带 include_state_snapshot=true:流会先重放各已执行节点的状态,再流式发送新事件。
GET
/
workflow
/
{workflow_run_id}
/
events
curl -N --request GET \
--url 'https://{api_base_url}/workflow/{workflow_run_id}/events?user={user}' \
--header 'Authorization: Bearer {api_key}'
event: ping
data: {"event": "human_input_form_filled", "task_id": "c3800678-a077-43df-a102-53f23ed20b88", "workflow_run_id": "fb47b2e6-5e43-4f90-be01-d5c5a088d156", "data": {"node_id": "approval_node", "node_title": "Approval", "rendered_content": "请审阅草稿。", "action_id": "approve", "action_text": "批准", "submitted_data": {"comment": "没问题,可以发布。"}}}
data: {"event": "node_started", "task_id": "c3800678-a077-43df-a102-53f23ed20b88", "workflow_run_id": "fb47b2e6-5e43-4f90-be01-d5c5a088d156", "data": {"id": "node_exec_2", "node_id": "node_1", "node_type": "llm", "title": "LLM Node", "index": 2, "created_at": 1705407705}}
data: {"event": "reasoning_chunk", "task_id": "c3800678-a077-43df-a102-53f23ed20b88", "workflow_run_id": "fb47b2e6-5e43-4f90-be01-d5c5a088d156", "data": {"reasoning": "Approved, now translating.", "node_id": "node_1", "is_final": false}}
data: {"event": "reasoning_chunk", "task_id": "c3800678-a077-43df-a102-53f23ed20b88", "workflow_run_id": "fb47b2e6-5e43-4f90-be01-d5c5a088d156", "data": {"reasoning": "", "node_id": "node_1", "is_final": true}}
data: {"event": "text_chunk", "task_id": "c3800678-a077-43df-a102-53f23ed20b88", "workflow_run_id": "fb47b2e6-5e43-4f90-be01-d5c5a088d156", "data": {"text": "Bonjour", "from_variable_selector": ["node_1", "text"]}}
data: {"event": "workflow_finished", "task_id": "c3800678-a077-43df-a102-53f23ed20b88", "workflow_run_id": "fb47b2e6-5e43-4f90-be01-d5c5a088d156", "data": {"id": "fb47b2e6-5e43-4f90-be01-d5c5a088d156", "workflow_id": "7c3e33d4-2a8b-4e5f-9b1a-d3c6e8f12345", "status": "succeeded", "outputs": {"result": "Bonjour"}, "elapsed_time": 2.1, "total_tokens": 42, "total_steps": 2, "created_at": 1705407629, "finished_at": 1705407706}}
Authorizations
Query Parameters
为 true 时,从持久化状态快照重放,在流式发送新事件前附带已执行节点的状态摘要。
设为 true 时,流会在多次 workflow_paused 事件之间保持打开(适用于工作流包含多个连续人工介入节点的场景)。默认在首次暂停时关闭流。
Last modified on August 18, 2026
Was this page helpful?
⌘I
curl -N --request GET \
--url 'https://{api_base_url}/workflow/{workflow_run_id}/events?user={user}' \
--header 'Authorization: Bearer {api_key}'
event: ping
data: {"event": "human_input_form_filled", "task_id": "c3800678-a077-43df-a102-53f23ed20b88", "workflow_run_id": "fb47b2e6-5e43-4f90-be01-d5c5a088d156", "data": {"node_id": "approval_node", "node_title": "Approval", "rendered_content": "请审阅草稿。", "action_id": "approve", "action_text": "批准", "submitted_data": {"comment": "没问题,可以发布。"}}}
data: {"event": "node_started", "task_id": "c3800678-a077-43df-a102-53f23ed20b88", "workflow_run_id": "fb47b2e6-5e43-4f90-be01-d5c5a088d156", "data": {"id": "node_exec_2", "node_id": "node_1", "node_type": "llm", "title": "LLM Node", "index": 2, "created_at": 1705407705}}
data: {"event": "reasoning_chunk", "task_id": "c3800678-a077-43df-a102-53f23ed20b88", "workflow_run_id": "fb47b2e6-5e43-4f90-be01-d5c5a088d156", "data": {"reasoning": "Approved, now translating.", "node_id": "node_1", "is_final": false}}
data: {"event": "reasoning_chunk", "task_id": "c3800678-a077-43df-a102-53f23ed20b88", "workflow_run_id": "fb47b2e6-5e43-4f90-be01-d5c5a088d156", "data": {"reasoning": "", "node_id": "node_1", "is_final": true}}
data: {"event": "text_chunk", "task_id": "c3800678-a077-43df-a102-53f23ed20b88", "workflow_run_id": "fb47b2e6-5e43-4f90-be01-d5c5a088d156", "data": {"text": "Bonjour", "from_variable_selector": ["node_1", "text"]}}
data: {"event": "workflow_finished", "task_id": "c3800678-a077-43df-a102-53f23ed20b88", "workflow_run_id": "fb47b2e6-5e43-4f90-be01-d5c5a088d156", "data": {"id": "fb47b2e6-5e43-4f90-be01-d5c5a088d156", "workflow_id": "7c3e33d4-2a8b-4e5f-9b1a-d3c6e8f12345", "status": "succeeded", "outputs": {"result": "Bonjour"}, "elapsed_time": 2.1, "total_tokens": 42, "total_steps": 2, "created_at": 1705407629, "finished_at": 1705407706}}