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.

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

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": {
      "input_file": "file-001"
    },
    "trigger_now": true
  }'

Parameter

Type

Required

Description

workflow_id

string

Yes

workflow ID.

values

object

No

Runtime input. Keys are defined by the workflow’s runtime form. Objects allow extended keys.

replace_saved_defaults

boolean or null

No

Whether to replace the default value selected this time.

trigger_now

boolean or null

No

Whether to trigger immediately. cron workflow must fill in true, and other workflows will be processed according to the deployed running mode.

execution_mode

string or null

No

Overwriting is currently not allowed. Can only be omitted or blank.

compute_resource_id

string or null

No

A normal run can override the compute instance. The volume distribution branch does not use this override value.

__notification_config

object or null

No

Workflow final notification configuration.

__notification_config.type

string

Yes

type.

__notification_config.url

string

Yes

Notification address.

__notification_config.method

string or null

No

HTTP method.

__notification_config.headers

object or null

No

Notification request header. Objects allow extended keys.

__notification_config.timeout

integer or null

No

Timeout seconds.

__notification_config.worker_id

JSON value

No

Worker ID. The value is empty string, null.

__notification_config.message

JSON value

No

notification message. The value is empty string, null.

__notification_config.notify_node_states

array of string or null

No

Node notification status.

__notification_config.notify_node_ids

array of string or null

No

Notify node ID.

__notification_config.notify_workflow_states

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

JSON
{
  "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

code

string

success code.

msg

string

Response information.

data

object

The data returned by this operation.

data.workflow_run

object

Workflow runtime configuration.

data.workflow_run.execution_id

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.

data.workflow_run.workflow_id

string

workflow ID.

data.workflow_run.status

string

Current job status: preparing, waiting, pending, triggered, running, completed, failed, cancelled, submitted, scheduled, paused, canceled, success, succeeded, queued, cancelling, canceling.

data.workflow_run.available_actions

array of string

Action hints for the current state. They do not indicate that the current user has passed permission checks.

data.workflow_run.execution_mode

string

Execution mode for this run: one_shot, volume_trigger, cron, dynamic_service, task_by_version.

data.workflow_run.moi_task_id

string

Server task ID.

data.workflow_run.moi_case_id

string

Server case identifier.

data.workflow_run.moi_workflow_def_id

string

Workflow definition identifier.

data.workflow_run.moi_workflow_version_id

string

Workflow version identifier.

data.workflow_run.error

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.

JSON
{
  "code": "ErrParamInvalid",
  "msg": "请求参数无效"
}

Field

Type

Description

code

string

error code.

msg

string

Readable error message.

Common HTTP errors

HTTP status

Error code

Common cause

Recommended action

400

ErrParamInvalid, ErrWorkspaceRequired, ErrWorkflowComputeResourceNotFound

Invalid request field, workspace, or operation precondition.

Fix the request parameters and submit again.

401

Unauthorized

Missing or invalid authentication credentials.

Check the credential type, expiration, and authentication header.

403

ErrForbidden

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

ErrNotFound

The target object or required reference was not found.

Verify the object identifier, workspace, and current status.

409

ErrConflict

Conflict in resource state, request payload, or concurrent modification.

Re-read the current state and version, then handle according to the latest result.

500

ErrServer

Internal processing failed; write operations may have been partially applied.

Retain request and trace details, and verify the current state before retrying.

503

ErrServiceUnavailable

A business, runtime, or authorization dependency is temporarily unavailable.

After the dependency recovers, check existing results first instead of blindly repeating writes.

Last updated on