Start workflow job¶
Initiates an execution for the specified workflow. After the request is successful, save the returned execution ID, and then query the status and results of the job; a successful request does not mean that the workflow has been completed.
POST $CLOUDSIGMA_API_BASE/workflow/v2/workflow-apps/{workflow_id}/executions
Before you call this API¶
Configure the regional API endpoint and authentication, and select the target workspace.
First View workflow details to confirm the runtime fields and execution configuration of the workflow.
The request body cannot contain runtime_context.
Request¶
curl -X POST "$CLOUDSIGMA_API_BASE/workflow/v2/workflow-apps/$WORKFLOW_ID/executions" \
-H "X-API-Key: $CLOUDSIGMA_API_KEY" \
-H "X-Workspace-ID: $WORKSPACE_ID" \
-H 'Content-Type: application/json' \
-d '{
"values": {
"<FIELD_ID>": "<VALUE>"
},
"trigger_now": true
}'
Request body
| Parameter | Type | Required | Description |
|---|---|---|---|
workflow_id | string | Required | The ID of the workflow to run. |
values | object | Input value keyed by runtime form `field_id`. The server will merge it with the workflow default values and verify the required fields. | |
trigger_now | boolean | Whether to trigger execution immediately. | |
run_once | boolean | When the Cron workflow is set to `true`, this run will be processed as a one-time execution. | |
execution_mode | string | Passing in is not supported; passing in a non-null value will return a parameter error. The execution mode is determined by the published workflow. | |
compute_resource_id | string | The computing resource ID used for this run. |
Successful response¶
Returns 200 on success. Acceptance of the request does not mean that the execution is completed; save the data.workflow_run.execution_id and use it to query job details and results.
{
"code": "OK",
"msg": "OK",
"data": {
"workflow_run": {
"execution_id": "exec-001",
"workflow_id": "wf-001",
"status": "ready",
"available_actions": ["cancel"],
"execution_mode": "one_shot",
"moi_task_id": "task-001",
"moi_case_id": "case-001",
"moi_workflow_def_id": "def-001",
"moi_workflow_version_id": "ver-001"
}
}
}
| Field | Type | Description |
|---|---|---|
code | string | `OK` when successful. |
msg | string | `OK` when successful. |
data.workflow_run.execution_id | string | The execution ID of the new job. |
data.workflow_run.workflow_id | string | Workflow ID. |
data.workflow_run.status | string | Current execution status when created; query should continue to confirm the final status. |
data.workflow_run.available_actions | string[] | Follow-up actions allowed by the current state. |
data.workflow_run.execution_mode | string | The mode used for this execution. |
data.workflow_run.moi_task_id | string | Task ID returned when assigned by the server. |
data.workflow_run.moi_case_id | string | Case ID returned when assigned by the server. |
data.workflow_run.moi_workflow_def_id | string | Workflow definition ID associated with this execution. |
data.workflow_run.moi_workflow_version_id | string | Workflow version ID associated with this execution. |
data.workflow_run.error | string | Current error; returned if there is a value. |
Error response¶
{
"code": "ErrParamInvalid",
"msg": "请求参数无效",
"data": null
}
| Field | Type | Description |
|---|---|---|
code | string | Error code. |
msg | string | Readable error message. |
data | null | `null` in an error response. |
Follow-up operations¶
Record data.workflow_run.workflow_id and data.workflow_run.execution_id. Acceptance of a request does not mean completion of execution. Use these two identifiers to query workflow job details to track the status; when output is needed, query workflow job results.