Retry Failed Workflow
Endpoint: POST /api/workflow/{workflowId}/retry
Retries a failed workflow execution from the last failed task. When invoked, the failed task is scheduled again, and the workflow moves to RUNNING status.
Path parameters
Parameter | Description | Type | Required/ Optional |
---|---|---|---|
workflowId | The execution ID of the failed workflow to be retried. | string | Required. |
Query parameters
Parameter | Description | Type | Required/ Optional |
---|---|---|---|
resumeSubworkflowTasks | (For cases where the last failed task is a Sub Workflow task) If set to true, the parent workflow is restarted from the sub-workflow’s last failed task. If set to false, a new sub-workflow execution is created. Default is false. | boolean | Optional. |
retryIfRetriedByParent | (For cases where a sub-workflow is being retried) If set to false, the sub-workflow will be prohibited from retrying if its parent workflow has been retried before. Default is true. | boolean | Optional. |
Response
Returns 204 No Content, indicating that the workflow execution has been restarted successfully from the last failed task.
Examples
Retry failed workflow from last failed task
Request
curl -X 'POST' \
'https://<YOUR-CLUSTER>/api/workflow/2ce9207f-d4a6-11ef-87b1-b2b27c52ebde/retry' \
-H 'accept: */*' \
-H 'X-Authorization: <TOKEN>' \
-d ''
Response
Returns 204 No Content, indicating that the workflow execution has been restarted successfully from the last failed task.
In the Conductor UI, the workflow execution will re-enter the RUNNING status, and the last failed task will be re-attempted.
Retry failed workflow from last failed Sub Workflow task when resumeSubworkflowTasks=true
Request
curl -X 'POST' \
'https://<YOUR_CLUSTER>/api/workflow/35831168-50da-11f0-bb6c-9aabfb2793e8/retry?resumeSubworkflowTasks=true' \
-H 'accept: */*' \
-H 'X-Authorization: <TOKEN>' \
-d ''
Response
Returns 204 No Content, indicating that the workflow execution has been restarted successfully from the last failed task.
In the Conductor UI, both the parent workflow and sub-workflow execution will re-enter the RUNNING status.
Retry failed workflow from last failed Sub Workflow task when resumeSubworkflowTasks=false
Request
curl -X 'POST' \
'https://<YOUR_CLUSTER>/api/workflow/35831168-50da-11f0-bb6c-9aabfb2793e8/retry?resumeSubworkflowTasks=false' \
-H 'accept: */*' \
-H 'X-Authorization: <TOKEN>' \
-d ''
Response
Returns 204 No Content, indicating that the workflow execution has been restarted successfully from the last failed task.
In the Conductor UI, the parent workflow execution will re-enter the RUNNING status, and a new sub-workflow execution instance will be created.
Retry sub-workflow when retryIfRetriedByParent=false
This example demonstrates how a retry attempt on a sub-workflow is blocked when:
- A sub-workflow has failed.
- Its parent workflow has already been retried.
- A retry is attempted on the sub-workflow with
retryIfRetriedByParent=false
.
Start a workflow that includes a sub-workflow. Initially, both executions are in RUNNING status.
Now, let’s assume the sub workflow failed, resulting in both the sub-workflow and the parent workflow entering FAILED status.
Use the following API call to retry the parent workflow:
curl -X 'POST' \
'https://<YOUR-CLUSTER>/api/workflow<PARENT-WORKFLOW-ID>/retry' \
-H 'accept: */*' \
-H 'X-Authorization: <TOKEN>' \
-d ''
The parent workflow is successfully retried and transitions to RUNNING. The previous sub-workflow execution remains FAILED.
Now attempt to retry the initially failed sub-workflow using the following call with retryIfRetriedByParent=false
:
curl -X 'POST' \
'https://<YOUR-CLUSTER>/api/workflow/<SUB-WORKFLOW-ID>/retry?retryIfRetriedByParent=false' \
-H 'accept: */*' \
-H 'X-Authorization: <TOKEN>' \
-d ''
Response
{
"status": 400,
"message": "Parent task fd7sdfe33153-71df-11f0-af9d-8e9bff353733 of workflow fd7sd6e353e6-71df-11f0-9288-1a521d72d3b3 is already retried, retrying subworkflow fd7sdfe442c4-71df-11f0-af9d-8e9bff353733 is prohibited because retryIfHasParent=false in retry request",
"instance": "orkes-conductor-deployment-84d9984cb8-r7rrd",
"retryable": false
}
This error confirms that Conductor blocks the retry because the parent workflow has already been retried, and retryIfRetriedByParent=false
prohibits retrying the sub-workflow independently.