Retry workflow job

Retry a workflow job. A successful request does not mean that the retry has been completed; please check the details of the new job to confirm the status.

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

Preparation before calling

First query job details to confirm that the current status of the job supports retry. Prepare a personal access token and target workspace ID that has access to the target workspace.

Request body

workflow_idstringRequired
Workflow ID.
execution_idstringRequired
The job ID to retry.
valuesobject
Runtime input value to use when retrying.
trigger_nowboolean
Whether to trigger retry immediately.

Request example

curl -X POST "https://moi.matrixorigin.cn/newmoi/workflow/v2/workflow-apps/$WORKFLOW_ID/executions/$EXECUTION_ID/retry" \
  -H "X-API-Key: $AI_STUDIO_API_KEY" \
  -H "X-Workspace-ID: $WORKSPACE_ID" \
  -H 'Content-Type: application/json' \
  -d '{
    "trigger_now": true
  }'

Successful response

Returns 200 on success. data.workflow_run returns the execution information corresponding to the retry request; saves the new execution ID for querying the status of the retry job.

The response fields are as follows.

In field paths, [] denotes each item in an array. For example, items[].name is the name field of each item in the items array. After a type, [] denotes an array; for example, string[] is an array of strings.

codestring
OK when successful.
msgstring
OK when successful.
data.workflow_run.execution_idstring
New job ID.
data.workflow_run.workflow_idstring
Workflow ID.
data.workflow_run.statusstring
The current status of the new job.
data.workflow_run.execution_modestring
Workflow execution mode.
data.workflow_run.available_actionsstring[]
Currently available operations; only returned if there is a value.
data.workflow_run.errorstring
Job error message; only returned if there is an error.

Successful response example

{
  "code": "OK",
  "msg": "OK",
  "data": {
    "workflow_run": {
      "execution_id": "exec-002",
      "workflow_id": "wf-001",
      "status": "submitted",
      "execution_mode": "one_shot"
    }
  }
}

Error response

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

Error response example

{
  "code": "ErrParamInvalid",
  "msg": "请求参数无效",
  "data": null
}

Follow-up operations

Use new execution ID query workflow job details.

Last updated on