Workflow Application
Execute Workflow
POST /workflows/run
Execute a workflow. Cannot be executed without a published workflow.
Request Body
-
inputs (object) Required
- Allows passing variable values defined by the App
- inputs parameter contains multiple key/value pairs
- Text generation applications require at least one key/value pair
-
response_mode (string) Required Return response mode, supports:
streaming
Streaming mode (recommended)blocking
Blocking mode
-
user (string) Required
- User identifier, used to define the identity of end users
- Rules defined by developers, must ensure user identifiers are unique within the application
-
files (array[object]) Optional File list, suitable for inputting files (images) combined with text understanding and answering questions
type
(string) Supported type: imagetransfer_method
(string) Transfer method,remote_url
/local_file
url
(string) Image URLupload_file_id
(string) Upload file ID
Response
CompletionResponse (blocking mode)
task_id
(string) Task IDworkflow_run_id
(string) Workflow execution IDdata
(object)id
(string) Workflow execution IDworkflow_id
(string) Associated Workflow IDstatus
(string) Execution statusoutputs
(json) Output contenterror
(string) Error reasonelapsed_time
(float) Time consumedtotal_tokens
(int) Total tokens usedtotal_steps
(int) Total stepscreated_at
(timestamp) Run timefinished_at
(timestamp) End time
ChunkCompletionResponse (streaming mode)
Streaming event types include:
- workflow_started
- node_started
- node_finished
- parallel_branch_started/finished
- iteration_started/next/completed
- workflow_finished
- text_chunk/text_replace
Error Codes
- 400
invalid_param
- Invalid parameter input - 400
app_unavailable
- App configuration unavailable - 400
provider_not_initialize
- No available model credentials configured - 400
provider_quota_exceeded
- Insufficient model call quota - 400
model_currently_not_support
- Current model unavailable - 400
completion_request_error
- Text generation failed - 500 - Internal server error
Examples
Request example:
Stop Workflow
POST /workflows/:task_id/stop
Only supports streaming mode.
Path Parameters
- task_id (string) Task ID
Request Body
- user (string) Required - User identifier, must be consistent with the user passed when executing the workflow
Response
result
(string) Fixed return “success”
Example
Request example: