retry_execution
Retry failed workflow steps to resume execution from the point of failure, automatically detecting the most recent failed timeline if not specified.
Instructions
Retry a failed step in a workflow execution. If no timelineId is provided, the most recent failed timeline is automatically detected and retried. This re-runs the failed step and continues the workflow from that point.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| workflowId | Yes | The workflow ID | |
| executionId | Yes | The execution ID containing the failed step | |
| timelineId | No | Specific timeline ID to retry. If omitted, the most recent failed timeline is auto-detected. | |
| forceWithoutCache | No | Bypass cache when retrying the step |
Implementation Reference
- src/tools/executions.ts:136-158 (handler)The MCP tool 'retry_execution' registration and its handler implementation in 'src/tools/executions.ts'. It uses the 'clientFactory' to call the client's 'retryExecution' method.
server.tool( 'retry_execution', `Retry a failed step in a workflow execution. If no timelineId is provided, the most recent failed timeline is automatically detected and retried. This re-runs the failed step and continues the workflow from that point.`, { workflowId: z.string().describe('The workflow ID'), executionId: z.string().describe('The execution ID containing the failed step'), timelineId: z.string().optional().describe('Specific timeline ID to retry. If omitted, the most recent failed timeline is auto-detected.'), forceWithoutCache: z.boolean().optional().describe('Bypass cache when retrying the step'), }, async ({ workflowId, executionId, timelineId, forceWithoutCache }, extra) => { const client = clientFactory(extra); const result = await client.retryExecution(workflowId, executionId, { timelineId, forceWithoutCache, }); return { content: [{ type: 'text' as const, text: JSON.stringify(result, null, 2), }], }; } ); - src/client.ts:230-242 (helper)The 'retryExecution' method in 'AgentledClient' class, which performs the actual HTTP POST request to the API to trigger the retry.
async retryExecution( workflowId: string, executionId: string, options?: { timelineId?: string; forceWithoutCache?: boolean } ) { return this.request(`/workflows/${workflowId}/executions/${executionId}/retry`, { method: 'POST', body: JSON.stringify({ timelineId: options?.timelineId, forceWithoutCache: options?.forceWithoutCache, }), }); }