Run Workflow by ID
Available for: Workflow apps.
Run a specific published workflow version, identified by the workflow_id in the path. Request body, response, and streaming behavior match Run Workflow; only the executed version differs.
Authorizations
Every request authenticates with an API key: Authorization: Bearer {API_KEY}. App endpoints take an app API key; knowledge endpoints take a knowledge base API key (Get Started).
Keep keys server-side; never embed them in client code. Requests with a missing or invalid key fail with HTTP 401 (unauthorized).
Path Parameters
Published workflow version to run. Returned in the workflow_id field of Run Workflow responses and Get Workflow Run Detail. Must reference a published version; a draft version ID is rejected with bad_request.
Body
Key-value pairs for workflow input variables. Discover the variable names and types your app expects from the user_input_form field of Get App Parameters.
File-type variables take an array of file objects with type, transfer_method, and either url or upload_file_id.
End-user identifier, defined by your app and unique within it. Scopes data access: a workflow run and its files are only visible to later requests that carry the same user. See End User Identity.
Response mode. Use blocking for synchronous responses (Cloudflare timeout is 100 s), or streaming for Server-Sent Events. When omitted, defaults to blocking behavior.
streaming, blocking File list. Suitable when files need to be combined with text for input, available only when the model supports Vision capability. To attach a local file, first upload it via Upload File and use the returned id as upload_file_id with transfer_method: local_file.
- Option 1
- Option 2
Response
Successful response. The content type and structure depend on the response_mode parameter in the request.
- If
response_modeisblocking, returnsapplication/jsonwith aWorkflowBlockingResponseobject. - If
response_modeisstreaming, returnstext/event-streamwith a stream ofChunkWorkflowEventobjects.
Task ID for the in-progress execution. Use this with Stop Workflow Task to cancel a running workflow. Only valid during execution.
Persistent identifier for this workflow run record. Use this with Get Workflow Run Detail to retrieve results after execution.