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.

HTTP
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

Shell
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

ParameterTypeRequiredDescription
workflow_idstringRequiredThe ID of the workflow to run.
valuesobjectInput value keyed by runtime form `field_id`. The server will merge it with the workflow default values ​​and verify the required fields.
trigger_nowbooleanWhether to trigger execution immediately.
run_oncebooleanWhen the Cron workflow is set to `true`, this run will be processed as a one-time execution.
execution_modestringPassing 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_idstringThe 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.

JSON
{
  "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"
    }
  }
}
FieldTypeDescription
codestring`OK` when successful.
msgstring`OK` when successful.
data.workflow_run.execution_idstringThe execution ID of the new job.
data.workflow_run.workflow_idstringWorkflow ID.
data.workflow_run.statusstringCurrent execution status when created; query should continue to confirm the final status.
data.workflow_run.available_actionsstring[]Follow-up actions allowed by the current state.
data.workflow_run.execution_modestringThe mode used for this execution.
data.workflow_run.moi_task_idstringTask ID returned when assigned by the server.
data.workflow_run.moi_case_idstringCase ID returned when assigned by the server.
data.workflow_run.moi_workflow_def_idstringWorkflow definition ID associated with this execution.
data.workflow_run.moi_workflow_version_idstringWorkflow version ID associated with this execution.
data.workflow_run.errorstringCurrent error; returned if there is a value.

Error response

JSON
{
  "code": "ErrParamInvalid",
  "msg": "请求参数无效",
  "data": null
}
FieldTypeDescription
codestringError code.
msgstringReadable error message.
datanull`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.

Last updated on