Cancel workflow job

Cancel a cancelable workflow job. The interface synchronization attempt cancels and returns the current details. Whether external work has stopped still needs to be checked.

HTTP
POST $CLOUDSIGMA_API_BASE/workflow/v2/workflow-apps/{workflow_id}/executions/{execution_id}/cancel

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 job details and confirm that the job can currently be canceled. Prepare personal access token and target workspace ID with workflow running permissions.

Request body

Shell
curl -X POST "$CLOUDSIGMA_API_BASE/workflow/v2/workflow-apps/$WORKFLOW_ID/executions/$EXECUTION_ID/cancel" \
  -H "X-API-Key: $CLOUDSIGMA_API_KEY" \
  -H "X-Workspace-ID: $WORKSPACE_ID"

Parameter

Type

Required

Description

workflow_id

string

Yes

workflow ID.

execution_id

string

Yes

Job ID.

The request does not read the JSON body.

Request body

This interface does not read the request body, does not accept cancellation reasons, and does not need to submit a JSON body.

Successful response

JSON
{
  "code": "OK",
  "msg": "OK",
  "data": {
    "execution": {
      "execution_id": "run-001",
      "workflow_id": "wf-001",
      "status": "running",
      "execution_mode": "one_shot"
    }
  }
}

Field

Type

Description

code

string

success code.

msg

string

Response information.

data

object

The data returned by this operation.

data.execution

object

Execution method.

data.execution.execution_id

string

Job ID.

data.execution.workflow_id

string

workflow ID.

data.execution.status

string

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

data.execution.available_actions

array of string

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

data.execution.execution_mode

string

Execution mode: one_shot, volume_trigger, cron, dynamic_service, task_by_version.

data.execution.cron_expression

string

Cron expressions.

data.execution.moi_task_id

string

Task ID.

data.execution.moi_case_id

string

Run case ID.

data.execution.moi_workflow_def_id

string

Workflow definition ID.

data.execution.moi_workflow_version_id

string

workflow version ID.

data.execution.dispatch_job_id

string

Volume dispatch job ID.

data.execution.pause_scope

string

Pause scope: execution or workflow.

data.execution.error

string

error message.

data.execution.started_at

string

Start time in RFC 3339 format.

data.execution.ended_at

string

End time in RFC 3339 format.

data.execution.created_at

string

Creation time. In RFC 3339 format.

data.execution.updated_at

string

Last updated time. In RFC 3339 format.

data.execution.input_payload

object

Running input objects allow extended keys.

data.execution.vars_payload

object

Run variable objects allow extended keys.

Error response

JSON
{
  "code": "ErrConflict",
  "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

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