Cancel workflow rerun

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

POST https://moi.matrixorigin.cn/newmoi/workflow/v2/workflow-apps/{workflow_id}/executions/{execution_id}/reruns/{rerun_id}/cancel

Preparation before calling

First query rerun details to confirm that the current status of the branch allows cancellation. Prepare a personal access token and target workspace ID that has access to the target workspace.

Path parameters

workflow_idstring
Workflow ID.
execution_idstring
Source job ID.
rerun_idstring
Rerun ID.

Request example

curl -X POST "https://moi.matrixorigin.cn/newmoi/workflow/v2/workflow-apps/$WORKFLOW_ID/executions/$EXECUTION_ID/reruns/$RERUN_ID/cancel" \
  -H "X-API-Key: $AI_STUDIO_API_KEY" \
  -H "X-Workspace-ID: $WORKSPACE_ID"

Successful response

codestring
`OK` when successful.
msgstring
`OK` when successful.
data.rerun.rerun_idstring
Rerun ID.
data.rerun.branch_idstring
Branch ID.
data.rerun.source_execution_idstring
Source job ID; returned only if there is a value.
data.rerun.modestring
Rerun mode.
data.rerun.statusstring
The branch status when the cancellation operation returns.
data.rerun.errorstring
Branch error information; only returned when there is an error.

Successful response example

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

Error response

codestring
Error code.
msgstring
Readable error message.
datanull
`null` in an error response.

Error response example

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

Follow-up operations

View workflow rerun details confirms the final status.

Last updated on