Start workflow job¶
Start a workflow job. A successful request means that the startup process has returned, but does not mean that the job has been completed.
POST $CLOUDSIGMA_API_BASE/workflow/v2/workflow-apps/{workflow_id}/executions
Before you call¶
Configure the CloudSigma regional endpoint and authentication before calling. The endpoint, credentials, workspace, and resource IDs must belong to the same region. First query the workflow details and confirm the workflow to be started. Prepare personal access token and target workspace ID with workflow running permissions.
Request body¶
Replace the running inputs in $CLOUDSIGMA_API_KEY, $WORKSPACE_ID, $WORKFLOW_ID and examples with actual values.
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": {
"input_file": "file-001"
},
"trigger_now": true
}'
Parameter |
Type |
Required |
Description |
|---|---|---|---|
|
string |
Yes |
workflow ID. |
|
object |
No |
Runtime input. Keys are defined by the workflow’s runtime form. Objects allow extended keys. |
|
boolean or null |
No |
Whether to replace the default value selected this time. |
|
boolean or null |
No |
Whether to trigger immediately. |
|
string or null |
No |
Overwriting is currently not allowed. Can only be omitted or blank. |
|
string or null |
No |
A normal run can override the compute instance. The volume distribution branch does not use this override value. |
|
object or null |
No |
Workflow final notification configuration. |
|
string |
Yes |
type. |
|
string |
Yes |
Notification address. |
|
string or null |
No |
HTTP method. |
|
object or null |
No |
Notification request header. Objects allow extended keys. |
|
integer or null |
No |
Timeout seconds. |
|
JSON value |
No |
Worker ID. The value is empty string, |
|
JSON value |
No |
notification message. The value is empty string, |
|
array of string or null |
No |
Node notification status. |
|
array of string or null |
No |
Notify node ID. |
|
array |
Yes |
workflow notification status. |
The top-level __notification_config can be an object or null. Currently, only the workflow final status notification of type=http is supported. Fill in the URL, HTTP method, request headers, timeout and workflow final state that needs to be notified. This configuration is not passed in as a run variable.
Request headers may contain credentials, please use original configuration. Do not construct request headers with desensitized values in details.
Normal execution will remove leading and trailing whitespace from the compute resource coverage ID. When empty, the resource bound to the workflow is used. This override value is currently not passed to child executions when distributing by volume.
The current cron workflow must fill in trigger_now=true to trigger execution immediately. When false is omitted or filled in, HTTP 500 / ErrServer is returned, which cannot be used to register scheduled tasks.
The saved default value is used when values is omitted. Explicit objects merge nested objects recursively by default. Only explicit objects and replace_saved_defaults=true are set at the same time will replace the value used this time. This flag does not modify the default value saved by the workflow. values:null is illegal.
This interface is started according to the deployed running mode of the workflow. execution_mode can only be omitted or blank, non-null values will be rejected, and it cannot be used to override the run mode.
A one_shot workflow starts according to its deployed execution mode. This public endpoint does not accept run_once; sending it fails strict JSON field validation.
Successful response¶
{
"code": "OK",
"msg": "OK",
"data": {
"workflow_run": {
"execution_id": "run-001",
"workflow_id": "wf-001",
"status": "queued",
"execution_mode": "one_shot",
"available_actions": [],
"moi_task_id": "",
"moi_case_id": "",
"moi_workflow_def_id": "",
"moi_workflow_version_id": ""
}
}
}
Field |
Type |
Description |
|---|---|---|
|
string |
success code. |
|
string |
Response information. |
|
object |
The data returned by this operation. |
|
object |
Workflow runtime configuration. |
|
string |
For an ordinary execution, this is the business job ID. For volume dispatch, it is a dispatch job ID and cannot be passed directly to the ordinary job-details endpoint. |
|
string |
workflow ID. |
|
string |
Current job status: |
|
array of string |
Action hints for the current state. They do not indicate that the current user has passed permission checks. |
|
string |
Execution mode for this run: |
|
string |
Server task ID. |
|
string |
Server case identifier. |
|
string |
Workflow definition identifier. |
|
string |
Workflow version identifier. |
|
string |
error message. |
Error response¶
At startup, running records are saved and tasks are distributed in stages. The record may have been saved or the task distributed before the error was returned, and the response may not necessarily contain a new queryable ID. Please check the running records first and do not automatically change the logo and start again.
{
"code": "ErrParamInvalid",
"msg": "请求参数无效"
}
Field |
Type |
Description |
|---|---|---|
|
string |
error code. |
|
string |
Readable error message. |
Common HTTP errors¶
HTTP status |
Error code |
Common cause |
Recommended action |
|---|---|---|---|
400 |
|
Invalid request field, workspace, or operation precondition. |
Fix the request parameters and submit again. |
401 |
|
Missing or invalid authentication credentials. |
Check the credential type, expiration, and authentication header. |
403 |
|
The current identity or active role does not have permission for this operation. |
Use an authorized identity or contact an administrator to grant access. |
404 |
|
The target object or required reference was not found. |
Verify the object identifier, workspace, and current status. |
409 |
|
Conflict in resource state, request payload, or concurrent modification. |
Re-read the current state and version, then handle according to the latest result. |
500 |
|
Internal processing failed; write operations may have been partially applied. |
Retain request and trace details, and verify the current state before retrying. |
503 |
|
A business, runtime, or authorization dependency is temporarily unavailable. |
After the dependency recovers, check existing results first instead of blindly repeating writes. |