Retry a failed workflow run
Start a new run that retries a failed or timed-out run. The new run keeps the results of the actions before the start action and runs the rest again. The failed run does not change.
First call previewWorkflowRunRetry, and send its planVersion. When fromSlug is not the failed action, also list in acknowledgedSlugs the slug of each action that has the CONFIRM safety level.
The retry never copies runAs from the failed run. Send runAs again when the retry must act as a user. If the retry pauses at a user input or scaffolder action, a user must fill in the form in Cortex.
API key must have the Run workflows permission and the workflow must be runnable via API.
A refused retry returns errorCode with one of these values:
| Code | Status | Meaning |
|---|---|---|
ACCESS_DENIED | 403 | The caller cannot view the run. |
HISTORY_NOT_FOUND | 404 | The history of the run is gone or too old. |
RUN_NOT_RETRYABLE | 409 | The run did not fail or time out, has no failed action, or an approver rejected it. |
ALREADY_RETRIED | 409 | Another run already retried this run. Retry the run in retriedByRunId. |
WAITED_ON_CHILD | 409 | A parent run waited for this run. Retry the run in parentRunId. |
RUN_CHECK_FAILED | 400, 403, 404 or 429 | A check that a new run must pass failed, for example the workflow is not runnable via API. The status is the one that a new run gets. |
CONFIRMATION_REQUIRED | 409 | The retry does not start from the failed action, and acknowledgedSlugs does not list each action in slugs. |
PLAN_CHANGED | 409 | The workflow or the run changed after the preview. Preview the retry again. |
ACTION_NOT_FOUND | 422 | The start action, or an action whose result the retry keeps, is not in the latest version of the workflow. |
ACTION_CHANGED | 422 | An action whose result the retry keeps has a different type in the latest version. |
ACTION_NOT_RETRYABLE | 422 | The start action did not run in the failed run. |
ACTION_ADDED_BEFORE_START | 422 | New actions lead into the start action. Retry from an action before them. |
VARIABLE_TYPE_CHANGED | 422 | A global variable in slugs changed its type. |
Authorizations
All requests to the Cortex API need to provide an Authorization: Bearer <token> header, where <token> is an API key created in the Settings page of your workspace.
Path Parameters
The tag or unique, auto-generated identifier for the workflow. Entity identifier - can be a tag or CID
The ID of the failed run
Query Parameters
When true, the response includes the run context. Defaults to false for MCP clients and true otherwise.
Body
The slug of each action that has the CONFIRM safety level in the preview. This confirms that the action can run again. Not needed when the retry starts from the failed action.
The slug of each action that has the CONFIRM safety level in the preview. This confirms that the action can run again. Not needed when the retry starts from the failed action.
The planVersion from the preview
The action to start the retry from. Defaults to the failed action. Use the same value as in the preview.
User IDs or email addresses to notify of the retry's updates, not both. When left out, the retry notifies the recipients of the failed run. An empty list notifies nobody.
User IDs or email addresses to notify of the retry's updates, not both. When left out, the retry notifies the recipients of the failed run. An empty list notifies nobody.
Email of the user that the retry acts as. The retry never copies it from the failed run.
Response
The new run started
Actions and their states
Id of the run
Status of the workflow run. PAUSED means it waits for a user input or an approval.
NOT_INITIATED, IN_PROGRESS, PAUSED, COMPLETED, FAILED, CANCELLED, TIMED_OUT Variable values
Summary of the workflow
Time the workflow run completed
Context of the run. Omitted when the request sets includeContext=false, which is the default for MCP clients.
Who initiated the workflow run
- Option 1
- Option 2
Id of the run that retried this run. Null when no run retried it.
Id of the failed run that this run retries. Null when this run is not a retry.
Time the workflow run started