Cancel workflow rerun

Request to cancel a workflow and rerun the branch. A successful request does not mean that the branch has been stopped. Please read the return status to confirm the actual status.

HTTP
POST $CLOUDSIGMA_API_BASE/workflow/v2/workflow-apps/{workflow_id}/executions/{execution_id}/reruns/{rerun_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 rerun details and confirm that the branch currently allows cancellation. Prepare personal access token and target workspace ID that can access the target workspace.

Confirm that the current identity has permission to run the workflow.

Request body

Replace $WORKFLOW_ID, $EXECUTION_ID, $RERUN_ID, $CLOUDSIGMA_API_KEY, $WORKSPACE_ID in the example with actual values.

Shell
curl -X POST "$CLOUDSIGMA_API_BASE/workflow/v2/workflow-apps/$WORKFLOW_ID/executions/$EXECUTION_ID/reruns/$RERUN_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, located in the request path.

execution_id

string

Yes

Source job ID, located in the request path.

rerun_id

string

Yes

Rerun ID.

Request body

Field

Type

Required

Description

reason

string or null

No

Custom reasons are currently being received but not saved.

reason is an optional field received by the current interface, but is not used to save custom reasons. This cannot be used to determine that the reason for cancellation or rerun has been recorded.

Successful response

JSON
{
  "code": "OK",
  "msg": "OK",
  "data": {
    "rerun": {
      "rerun_id": "rerun-001",
      "branch_id": "branch-001",
      "case_id": "",
      "source_execution_id": "exec-001",
      "mode": "rerun_current_and_downstream",
      "status": "cancelled"
    }
  }
}

Field

Type

Description

data.rerun

object

Rerun branch information.

data.rerun.rerun_id

string

Rerun plan ID.

data.rerun.branch_id

string

Rerun branch ID.

data.rerun.case_id

string

Run ID.

data.rerun.source_branch_id

string

Source branch ID.

data.rerun.new_workflow_execution_id

string

New workflow execution ID.

data.rerun.source_execution_id

string

Source execution ID.

data.rerun.source_case_id

string

Source run ID.

data.rerun.node_key

string

Node key.

data.rerun.source_node_execution_id

string

Source node execution ID.

data.rerun.mode

string

processing mode. Value: rerun_current_and_downstream, rerun_downstream_with_revisions.

data.rerun.status

string

status. Values: initializing, ready, running, paused, succeeded, failed, cancelled.

data.rerun.error

string

error message.

data.rerun.created_at

string

Creation time.

data.rerun.updated_at

string

Update time.

data.start_error

string

Startup error.

data.refresh_error

string

Refresh error.

Query workflow rerun details to confirm the final status.

Error response

When the target does not exist, has a status conflict, or the service fails, HTTP 404, 409, and 500 may be returned respectively. The business error response does not contain data.

JSON
{
  "code": "ErrNotFound",
  "msg": "资源不存在"
}

Field

Type

Description

code

string

error code.

msg

string

Readable error message.

Last updated on