Your application should classify the failure, determine whether repeating the operation is safe, and choose between retrying, using an approved fallback, deferring work, or stopping. Temporary connectivity problems may justify another attempt; invalid input usually needs correction. Crucially, a missing response does not establish whether a state-changing operation completed. AWS distinguishes these concerns because retries can create additional load or repeat side effects. (builder.aws.com)
Build your
Failure category | Recommended response | Guardrail |
|---|---|---|
Connection failure or timeout | Consider a bounded retry | Establish whether repeating the operation is safe |
Throttling | Reduce request pressure and respect provider guidance | Keep waiting within the operation deadline |
Temporary service failure | Retry selectively, then defer or fall back | Stop repeatedly calling an unhealthy dependency |
Invalid request or access configuration | Correct the request or configuration | Avoid replaying an unchanged failure indefinitely |
Unusable response content | Reject the result and investigate | Do not treat transport success as business success |
Use this table as a starting policy, then refine it against each provider’s documented error semantics. Retry policies should distinguish transient failures from conditions that another identical request cannot resolve. (learn.microsoft.com)
Set connection and request timeouts, then define an overall deadline for the operation. That deadline must leave room for retry delays and any fallback the caller actually needs. AWS recommends choosing timeouts using downstream latency behavior rather than arbitrary values. (builder.aws.com)
For retryable failures, use capped exponential backoff with jitter: increase the delay between attempts, limit its growth, and introduce randomness so clients do not all retry together. Also inspect SDK, gateway, and worker settings. Independent retries at multiple layers can multiply downstream requests precisely when the provider has the least spare capacity. (d1.awsstatic.com)
Write down four limits for each integration:
Treat these as shared operational controls, not unrelated defaults. Microsoft’s retry-storm guidance recommends bounded retries, backoff, and circuit breaking to prevent recovery attempts from worsening an outage. (learn.microsoft.com)
For state-changing requests, require a documented deduplication or idempotency mechanism before enabling automatic replay. Keep the same operation identity across retries rather than creating a new business action each time. Where safety cannot be established, defer the operation for reconciliation instead of guessing. (builder.aws.com)
The right fallback is the least risky alternative that still satisfies the operation’s essential requirements. That might mean a secondary provider, an explicitly stale cached result, deferred processing, reduced functionality, or a clear failure. A circuit breaker can stop calls to an unhealthy dependency and let the application select an alternative instead of waiting through repeated failures. (learn.microsoft.com)
Evaluate fallback choices in business terms:
These are design choices, not an automatic preference for maximum availability. Cached data can become inconsistent, while queues introduce delayed processing and require controls for durability, duplicates, and backlog growth. (learn.microsoft.com)
Keep circuit-breaker behavior separate from fallback selection. In the closed state, calls proceed; in the open state, calls are blocked; in the half-open state, limited probes test recovery. Restrict those probes so a recovering provider does not immediately receive the full workload. (learn.microsoft.com)
For writes, add an explicit “outcome unknown” state to your design. A timeout after submission should trigger reconciliation, not immediate execution through another provider. Require evidence of noncompletion or a cross-provider deduplication strategy before permitting that switch. This protects business correctness rather than merely improving the apparent success rate. (builder.aws.com)
For automated invoice processing, document-level error handling should isolate problematic invoices rather than automatically restarting an entire batch. Consider a workflow that preserves each original document, records its processing stage, and sends only unresolved items for review. Let validated invoices continue independently where the business process allows it.
Set separate acceptance rules for critical fields and optional information. For example, require review when the supplier identity is unresolved or line-item calculations do not reconcile with the extracted total. Calibrate confidence thresholds using your own documents; Microsoft explicitly notes that suitable thresholds depend on the use case. (learn.microsoft.com)
Give every document a durable identifier and track extraction separately from downstream posting. In your recovery policy, require confirmation of the posting state before replaying an interrupted document. Apply idempotent-consumer principles so duplicate delivery does not create a duplicate business record. (learn.microsoft.com)
Consider another design scenario: a team evaluating cryogenic labels, error rates, and automated sample handling needs separate categories for unreadable labels, ambiguous identifiers, failed lookups, and unavailable APIs. Define these categories before choosing recovery actions. Do not classify every exception as provider downtime.
In this hypothetical workflow, make an unresolved identifier a stop condition for the affected item, not permission to substitute a guessed match. Specify what evidence an operator needs to resume processing, and preserve the attempted lookup and source image where appropriate. Track observed error rates by failure category rather than inventing a universal benchmark.
For your implementation, define a diagnostic record containing the correlation ID, provider, operation, elapsed time, failure category, attempt count, and chosen recovery action. Add the final business state: completed, pending, rejected, or outcome unknown. Keep credentials and unnecessary sensitive payloads out of that record.
Choose alerts around actionable conditions: exhausted recovery budgets, growing queue age, persistent open circuits, or unresolved outcomes. Queue monitoring should include both backlog growth and messages that cannot be processed; Microsoft recommends routing persistent failures to a monitored dead-letter queue rather than cycling them indefinitely. (learn.microsoft.com)
Turn
Use a release checklist with observable outcomes:
For each test, assign an owner and specify the evidence required to pass. Check user-facing states as carefully as internal logs. A workflow should never report “completed” merely because it successfully placed work in a queue.
Start with one important integration: document its failure categories, bound its retries, and approve a fallback for each operation. Then add visibility and tests before expanding the pattern. Success means every interrupted operation reaches a known, auditable state—not that every exception disappears.