Retry workflow jobs in batches

Retry specified executions in batches for a scheduled job, or retry all failed executions under the scheduled job. Accepting the request by the interface does not mean that all jobs have been completed.

HTTP
POST $CLOUDSIGMA_API_BASE/workflow/v2/workflow-apps/{workflow_id}/executions/batch-retry

Before you call this API

Configure the regional API endpoint and authentication, and select the target workspace.

First query the workflow job list to confirm the scheduled job and execution scope to be retried.

You must choose one of execution_ids and all_failed: true: the former retries the specified execution, and the latter retries all failed executions in the source scheduled job.

Request

Shell
curl -X POST "$CLOUDSIGMA_API_BASE/workflow/v2/workflow-apps/$WORKFLOW_ID/executions/batch-retry" \
  -H "X-API-Key: $CLOUDSIGMA_API_KEY" \
  -H "X-Workspace-ID: $WORKSPACE_ID" \
  -H 'Content-Type: application/json' \
  -d '{
    "source_dispatch_job_id": "'"$SOURCE_DISPATCH_JOB_ID"'",
    "all_failed": true,
    "request_id": "<REQUEST_ID>"
  }'

Request body

ParameterTypeRequiredDescription
workflow_idstringRequiredWorkflow ID.
source_dispatch_job_idstringRequiredSource scheduled job ID.
execution_idsstring[]List of execution IDs to retry.
all_failedbooleanWhether to retry all failed executions under the source scheduled job.
request_idstringRequiredThe unique identifier of this batch request.

Successful response

Returns 200 on success. data returns the acceptance status of this batch retry; replayed is true, indicating that the service identifies it as a repeated submission of the same request.

The response fields are as follows.

JSON
{
  "code": "OK",
  "msg": "OK",
  "data": {
    "source_dispatch_job_id": "dispatch-source-001",
    "dispatch_job_id": "dispatch-retry-001",
    "status": "waiting",
    "accepted_count": 1,
    "replayed": false
  }
}
FieldTypeDescription
codestringOK when successful.
msgstringOK when successful.
data.source_dispatch_job_idstringSource scheduled job ID.
data.dispatch_job_idstringThe ID of the scheduled job created or reused in this batch retry.
data.statusstringThe current status of batch retry requests.
data.accepted_countintegerThe number of executions that will be retried this time.
data.replayedbooleanWhether it is a repeated request for the same request_id.

Error response

JSON
{
  "code": "ErrParamInvalid",
  "msg": "请求参数无效",
  "data": null
}
FieldTypeDescription
codestringError code.
msgstringReadable error message.
datanull`null` in an error response.

Follow-up operations

View workflow jobs to check the execution status of the retry job.

Last updated on