Resume workflow job

Requests the resumption of a specified workflow job. A successful request only means that the server accepts the recovery operation; please check the job status again to confirm subsequent execution.

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

Preparation before calling

First query job details and check whether available_actions contains recovery. Prepare a personal access token and target workspace ID that has access to the target workspace.

Path parameters

workflow_idstringRequired
Workflow ID.
execution_idstringRequired
Job ID.

Request example

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

Successful response

Returns 200 on success. data.execution returns the current execution information processed by the server.

codestring
`OK` when successful.
msgstring
`OK` when successful.
data.execution.execution_idstring
Execution ID.
data.execution.workflow_idstring
Workflow ID.
data.execution.statusstring
Current execution status.
data.execution.available_actionsstring[]
Currently allowed operations.
data.execution.execution_modestring
Execution mode.
data.execution.cron_expressionstring
Cron expression; only returned in timing mode.
data.execution.input_payloadobject
Expanded run input.
data.execution.vars_payloadobject
Expanded run variables.
data.execution.moi_task_idstring
Task ID; returned when assigned by the server.
data.execution.moi_case_idstring
Case ID; returned when assigned by the server.
data.execution.moi_workflow_def_idstring
Workflow definition ID; returned when assigned by the server.
data.execution.moi_workflow_version_idstring
Workflow version ID; returned when assigned by the server.
data.execution.pause_scopestring
Pause scope; returned if there is a value.
data.execution.errorstring
Error; returned if there is a value.
data.execution.started_atstring
Execution start time; returned if there is a value.
data.execution.ended_atstring
Execution end time; returned if there is a value.
data.execution.created_atstring
Execution creation time; returned if there is a value.
data.execution.updated_atstring
Execution update time; returned if there is a value.

Successful response example

{
  "code": "OK",
  "msg": "OK",
  "data": {
    "execution": {
      "execution_id": "exec-001",
      "workflow_id": "wf-001",
      "status": "running",
      "available_actions": ["pause", "cancel"],
      "execution_mode": "one_shot",
      "input_payload": {},
      "vars_payload": {}
    }
  }
}

Error response

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

Error response example

{
  "code": "ErrConflict",
  "msg": "资源状态冲突",
  "data": null
}

Follow-up operations

Use the same job ID query workflow job details to confirm recovery and continue tracking until completion.

Last updated on