Skip to main content
post/workflows/run
Request example
Response
post/workflows/run

Authorization

Authorizationstringheaderrequired#

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).

Body

application/json
filesobject[]#
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.
inputsobjectrequired#

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.

response_modeenum<string>#
Response mode. Use blocking for synchronous responses (Cloudflare timeout is 100 s), or streaming for Server-Sent Events. When omitted, defaults to blocking behavior.
Options:streamingblocking
userstringrequired#
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.

Responses

Successful response. The content type and structure depend on the response_mode parameter in the request.

  • If response_mode is blocking, returns application/json with a WorkflowBlockingResponse object.
  • If response_mode is streaming, returns text/event-stream with a stream of ChunkWorkflowEvent objects.
dataobject#
task_idstring#
Task ID for the in-progress execution. Use this with Stop Workflow Task to cancel a running workflow. Only valid during execution.
workflow_run_idstring#
Persistent identifier for this workflow run record. Use this with Get Workflow Run Detail to retrieve results after execution.