icon

Design retries around the identity of one business operation

Security editorial team
Design retries around the identity of one business operation
  • Author:
  • Sunny Security Labs

    Security editorial team

An integration can time out after a receiver committed the work. When a caller repeats the request, it needs to express whether it means to finish the earlier operation or start another one. A purchase submission and a recurring invoice run provide good examples. The identity of the user's intent is the starting point for a useful retry contract.

Bind the key to one intent

Scope the operation key to the caller or workspace and operation type. Store enough information to recognize a repeat with the same intent and to reject a conflicting use of the key. Use a uniqueness guarantee where concurrent requests can reach different processes. Decide how long the service needs to remember an operation, taking into account retry windows and the consequences of duplication.

Treat external effects as their own step

Saving a local record and instructing an external system to send a message or charge a payment may involve separate commits. Keep a durable state for the outstanding work and pass a stable operation identifier to recipients that support it. Where a recipient cannot confirm the outcome, decide when to reconcile using a trusted lookup and when a person must review the situation.

Expose a clear status

Make it possible for a caller to distinguish accepted, in progress, completed and failed operations. Agree on what the caller should retry and when it should check status. Walk through an interruption before the work begins and another after the result is committed but before the reply returns. The operator should be able to follow both attempts under one identifier and explain the resulting business state.

Sources

Request a quote
Book a consultation