Pause workflow job

Requests to pause the specified workflow job. Acceptance of the request does not mean that execution has stopped in all run units; please read the return status or query the details again to confirm.

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

Preparation before calling

First query job details and check whether available_actions contains pause. 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/pause" \
  -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; use this to confirm whether it has been paused.
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.pause_scopestring
The pause range provided by the server; returned when there is a value.
data.execution.input_payloadobject
Expanded run input.
data.execution.vars_payloadobject
Expanded run variable.
data.execution.moi_task_idstring
Task ID; returned when the server has assigned it.
data.execution.moi_case_idstring
Case ID; returned when the server has assigned it.
data.execution.moi_workflow_def_idstring
Workflow definition identifier; returned when the server has assigned it.
data.execution.moi_workflow_version_idstring
Workflow version identifier; returned when the server has assigned it.
data.execution.errorstring
Error message; returned if there is a value.
data.execution.started_atstring
Start time; returned if there is a value.
data.execution.ended_atstring
End time; returned if there is a value.
data.execution.created_atstring
Creation time; returned if there is a value.
data.execution.updated_atstring
Last updated 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": "paused",
      "available_actions": ["resume", "cancel"],
      "execution_mode": "one_shot",
      "pause_scope": "workflow",
      "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

Resume workflow job when you need to continue. Use the same job ID View workflow job details to confirm the status.

Last updated on