From Anadoris. This guide comes from the team behind Digital & Technology: websites, ERP, CRM and integrations, built by people who run businesses. About the group.
Recognise the uncertain outcome
A timeout does not always mean nothing happened. Before retrying a consequential action, the integration needs a way to identify whether the original request was accepted or completed. AWS’s Builders’ Library describes idempotent API design as a way to make repeated requests safe under an agreed contract.
For a business example, consider creating a shipment record. The receiving service may create it while the caller misses the response. A second request should not automatically create a second shipment for the same intended operation. The exact protection depends on the API and must be checked in its current documentation.
Use an operation identity and clear states
Give each intended operation a stable reference where the receiving system supports it. Keep that reference across retries of the same operation, and distinguish a genuinely new action from another attempt. Record the request scope so the system does not reuse an identifier for a different payload without the appropriate handling.
Track states such as prepared, submitted, confirmed and requiring investigation. A business user should be able to see an uncertain result rather than being told to repeatedly press a button. Avoid unlimited retry loops; define when the workflow stops and asks an owner to reconcile the outcome.
Test duplicate and delayed responses
Include tests where the response arrives late, the connection fails after submission and the same request is delivered twice. Verify the business record, not just the caller’s success message. If the receiving API lacks the needed protection, design a suitable reconciliation or review step instead of assuming a retry is harmless.
Start with the integrations that create or change important records. Write a short runbook showing how to identify the original operation and confirm its final state. Keep the business owner involved in deciding how uncertain cases should be handled. Safe recovery should preserve the intended outcome without quietly multiplying the action.
Sources
- {'title': 'AWS Builders’ Library: Making retries safe with idempotent APIs', 'url': 'https://aws.amazon.com/builders-library/making-retries-safe-with-idempotent-APIs/'}
