Design an Automation Error-Handling and Retry Strategy

Back to prompts
Design an Automation Error-Handling and Retry Strategy
automationintermediateClaudeGPTGemini
automation/error-handling

Generate a robust error-handling, rollback, and retry strategy for any automated workflow to prevent silent failures and data corruption.

Prompt
You are an expert systems architect specializing in robust, fault-tolerant automation workflows. Your task is to design a comprehensive error-handling, retry, and recovery strategy for the following automation workflow:

### Workflow Details
- **Platform/Language:** {{automation_platform_or_language}}
- **Workflow Description:** {{workflow_description}}
- **Critical Steps & APIs Involved:** {{critical_steps_and_apis}}
- **Consequences of Unhandled Failures:** {{failure_consequences}}

Please analyze this workflow and provide a structured failure recovery plan containing the following four sections:

1. **Failure Mode & Effects Analysis (FMEA):** Create a markdown table mapping each critical step to its potential failure modes (e.g., API timeout, 429 Rate Limit, 400 Bad Request, auth expiration), the severity of the failure, and the immediate impact on downstream steps.
2. **Retry & Backoff Policies:** For each external API or service integration, define a specific retry strategy (e.g., exponential backoff, max retries, jitter) tailored to the platform: {{automation_platform_or_language}}.
3. **Compensation & Rollback Plan:** Detail how to handle partial execution. If a step fails halfway through the workflow, describe the exact steps needed to roll back previous actions (e.g., deleting a partially created database record, refunding a charge) or flag the state as "dirty" to prevent duplicate runs.
4. **Alerting & Dead-Letter Queue (DLQ) Protocol:** Propose an alerting mechanism (e.g., Slack, email) and a manual intervention/DLQ process for failures that cannot be auto-recovered. Specify what payload data must be preserved for debugging.

**Critical Constraint:** If the provided workflow details do not contain enough information about a specific API's behavior or your platform's capabilities to safely recommend a rollback or retry mechanism, do not guess or invent specifics. Instead, explicitly flag that step as "Ambiguous - Clarification Needed" and state what technical details (e.g., idempotency keys, webhook retry policies) are required to complete the strategy.

When to use this#

You should use this prompt when you have designed the happy path of an automation workflow (in Make, n8n, or custom code) but need to make it production-ready by planning for API downtime, rate limits, partial failures, and data rollbacks.

Tips#

  • Provide specific error codes or rate limit behaviors of the APIs you are using to get highly tailored retry and backoff recommendations.
  • Mention if your automation platform has native error-handling features (like Make’s ‘Break’ directive or n8n’s ‘Error Trigger’) so the model can leverage them directly in the response.
Table of Contents