Retry a failed integration only when you can distinguish a repeated action from a new one, or reconcile whether the original action completed. A timeout does not prove that a record was never created. The destination system’s documented behavior determines which retries are safe.

An integration sends a request to create a record in another system. The connection times out. Has the request failed, or did the receiving system create the record before the response was lost?

That uncertainty is part of integration design. A retry can recover from a temporary problem, but it can also create a duplicate invoice, customer or order if the receiving system treats every request as new.

Separate the possible outcomes

Distinguish validation failures from temporary unavailability and unknown outcomes. Retrying an invalid field will not fix it. A service that is briefly unavailable may recover. A lost response requires a way to determine whether the original action already happened.

The appropriate behavior depends on the receiving system's documented contract. Do not assume that every error code is safe to retry or that an unsuccessful response means no side effect occurred.

Give a business action a stable identity

The Amazon Builders’ Library explanation of idempotent APIs describes how a caller-provided request identifier can distinguish a retry from a new request. The receiver can recognize an action it has already processed instead of creating another result.

Where the destination supports this behavior, retain the same identifier across retries of the same action. A genuinely new action needs a new identifier. Record the business record, request identifier and destination reference together so an operator can investigate later.

Important boundary

Adding an identifier to the sending system does not create duplicate protection by itself. The receiver must enforce the contract, including how it handles the same identifier with different input and how long it remembers completed requests.

Define a recovery route

When duplicate protection is unavailable, use the destination's lookup or reconciliation capabilities before attempting another create operation. A record may need human review when the evidence cannot establish whether the first action succeeded.

Design the exception queue with a named owner, the information needed to investigate and rules for escalation. Avoid infinite retries that hide a growing backlog or repeatedly submit a request that cannot succeed.

Test more than the successful request

Include a successful create, a lost response, repeated requests, invalid input and a period of destination unavailability. Test the behavior of two requests arriving close together if that can happen in production.

For each case, check the destination records as well as the sender's status. A green status in an integration dashboard is not enough evidence that the business state is correct.

Make the operating instructions part of delivery

Document what can be retried automatically, what needs investigation and which actions are safe for an operator to perform. Include the relevant system limits and access requirements.

This guide describes a design approach, not a claim that one retry policy works for every API. The final implementation should follow the destination's actual behavior and be tested against the consequences of duplicate or missing records.

Plan the integration inside a bounded workflow pilot, and define consistent measures for errors, delays and completed records before judging its performance.

Put the idea to work

Explore the related service

Discuss your requirements, constraints and current workflow with our team.

Explore custom software development
← Back to all insights