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.
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¶
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
| Parameter | Type | Required | Description |
|---|---|---|---|
workflow_id | string | Required | Workflow ID. |
source_dispatch_job_id | string | Required | Source scheduled job ID. |
execution_ids | string[] | List of execution IDs to retry. | |
all_failed | boolean | Whether to retry all failed executions under the source scheduled job. | |
request_id | string | Required | The 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.
{
"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
}
}
| Field | Type | Description |
|---|---|---|
code | string | OK when successful. |
msg | string | OK when successful. |
data.source_dispatch_job_id | string | Source scheduled job ID. |
data.dispatch_job_id | string | The ID of the scheduled job created or reused in this batch retry. |
data.status | string | The current status of batch retry requests. |
data.accepted_count | integer | The number of executions that will be retried this time. |
data.replayed | boolean | Whether it is a repeated request for the same request_id. |
Error response¶
{
"code": "ErrParamInvalid",
"msg": "请求参数无效",
"data": null
}
| Field | Type | Description |
|---|---|---|
code | string | Error code. |
msg | string | Readable error message. |
data | null | `null` in an error response. |
Follow-up operations¶
View workflow jobs to check the execution status of the retry job.