Determine the identity of the operation

Choose a stable key: for example, the order ID along with the action type. Save it before sending and protect it with a unique constraint in the database. Checking "whether the record exists" without such a constraint can lose to two concurrent requests. Repeating the same operation should return an already known result.

Continue with: CRM duplicates: repeated delivery or a new enquiry?.

Separate errors and unknown result

A validation error requires data correction, and temporary unavailability requires controlled retry. If the result is unknown, first check the external system against the passed ID if its API allows it. Do not assume that any provider supports the Idempotency-Key header: this should be confirmed in its documentation.

Continue with: OpenCart and KeyCRM: verify order transfers.

Test concurrent execution

On the test environment, send two identical events at the same time, repeat them after the worker has timed out and restarted. Expected result: one business operation and a clear attempt log. Define the key retention period, the number of retries, and the way to manually resolve unsolved cases.

Continue with: AI workflows: validate value before full automation.

Is automatic HTTP client retry enough?

No. It repeats the transport request, but without separate rules, it does not guarantee that the business action will be executed only once.

Documentation and sources