Retry means attempting an operation again. Idempotent describes an operation whose repeated application has the same intended effect as one application. Rollback cancels uncommitted transactional changes, while compensation performs further actions to address work that has already taken effect. These words answer different questions: should we try again, could repetition duplicate the result, can unfinished changes be discarded, and how can completed work be repaired? Confusing them can turn a temporary connection problem into duplicate orders, misleading records or an inaccurate promise that everything has been undone.
The practical approach is to identify one intended operation, record its reference, distinguish an unknown outcome from a confirmed failure, and check the service’s documented retry rules before repeating consequential work. Define the boundary of any transaction and the actual effect of any proposed reversal. For an AI assistant, a request such as “continue”, “try again” or “undo that” needs the same discipline: establish what already happened and what the user now intends. Reliable action depends on accurate state descriptions as much as fluent instructions.
- Retry describes another attempt; it does not establish whether the first attempt succeeded.
- Idempotent concerns repeated intended effects, not identical messages, universal safety or reversibility.
- An operation reference helps distinguish a retry from a genuinely new request.
- Rollback has a transaction boundary; it cannot recall every external consequence.
- Compensation is a new, domain-specific action whose own outcome needs checking.
- AI workflows need durable records of intentions, actions and unresolved outcomes.
- Clear vocabulary separates requested, in progress, committed, cancelled and compensated states.
eduKateSG · What Is Vocabulary
Choose a reading route
Start with the question closest to your task, or follow the chapters in order.
- Separate the promises — Chapter 1. Know what repetition and reversal actually mean.
- Resolve uncertainty — Chapter 2. Distinguish a missing response from a failed action.
- Identify the operation — Chapter 3. Recognise retries, new intentions and old instructions.
- Understand recovery — Chapter 4. Compare transaction rollback with compensation.
- Audit a workflow — Chapter 7. Apply seven checks and a seven-day exercise.
Chapter index
Understand the terms · Chapters 1–3
Retry is an action, not evidence
Imagine uploading a signed form. The progress indicator disappears and the page displays an error. Pressing the button again is a retry. It tells us what the person is doing next, but nothing certain about the first submission. The server might have received nothing, stored the form successfully, or passed it to another service before the connection failed.
A useful interface therefore explains the known state: “We could not confirm submission” is different from “No form was submitted.” The first sentence acknowledges missing evidence. The second makes a claim about the world and needs support. This distinction matters whenever a repeated instruction can create another consequential action.
Idempotent concerns a defined effect
RFC 9110’s definition of idempotent HTTP methods concerns the intended server effect of repeated identical requests. It does not require every response or log entry to be identical. An initial deletion and a later report that the resource is absent can be compatible with idempotent semantics.
A simple illustration is setting a notice’s visibility to private. Applying the same setting again leaves that setting private. By contrast, “increase the number of available tickets by one” changes the number each time. Both instructions may be valid, but they make different promises about repetition. An implementation still has to honour its documented behaviour.
Safe and reversible are separate properties
In HTTP’s terminology, a safe method has essentially read-only requested semantics. PUT and DELETE are idempotent methods, but they are not classified as safe. Incidental effects such as logging can still occur. Technical “safe” is therefore narrower than an everyday assurance that nothing harmful is possible.
Reversibility asks whether an earlier state can be restored. Setting a public document to private might be idempotent, yet anyone who already downloaded it still has a copy. Repeating a destructive command without causing additional destruction does not make the original destruction acceptable. Permission, repeatability and repair must each be assessed on their own terms.
“Undo” needs an object and a boundary
Someone who says “undo the invitation” might mean withdraw access, cancel an event, delete a draft or notify recipients that an earlier message was wrong. Those are different actions. A person who has read the invitation cannot be made to unread it. A precise response identifies which system state will change and which consequences require separate attention.
For teams, this is a vocabulary-design problem before it becomes a programming problem. Buttons and reports should describe the operation that is actually available. A broad promise of restoration is misleading when the implementation can only make a compensating change to one record.
The missing acknowledgement
Consider a fictional booking service. A user requests one place at a workshop. The service creates reservation R204, but the acknowledgement never reaches the browser. The user sees uncertainty; the service holds a reservation. Creating a second reservation would turn a communication problem into a business problem.
The helpful question is “What happened to this request?” rather than immediately “Can we create another booking?” A status lookup tied to the original operation can resolve that uncertainty. Searching only for a person’s name may be insufficient if they legitimately booked several different workshops.
Three different kinds of evidence
An attempted request proves an attempt. A receipt proves whatever the receipt’s contract says was received. A confirmed result proves the specified outcome at the time it was observed. Treating these as interchangeable hides the gap between intention and completion.
A record might say that a publishing command was sent at 10:00, that the platform acknowledged an update at 10:01, and that the public page was observed at 10:02. These are useful stages, not redundant timestamps. If the last observation is missing, the report should preserve that uncertainty rather than promote an earlier stage into proof of public availability.
Why repeated delivery can be normal
Amazon SQS documents at-least-once delivery for standard queues, including the possibility of receiving a message again. Its guidance asks applications to handle this through idempotent processing. A transport can therefore be working according to its contract even when a consumer sees a duplicate.
In an illustrative inventory workflow, two deliveries of the same “reserve item” message should not necessarily reserve two items. The receiving application needs a way to recognise the operation. Counting network messages and counting completed business intentions are different measurements, even when they usually happen to agree.
A waiting policy belongs beside a retry policy
A useful recovery plan names the status to inspect, the responsible component and the condition that justifies another attempt. It also identifies unresolved cases that need investigation. “Retry until it works” omits those boundaries and gives no clear meaning to failure.
For ordinary readers, the immediate lesson is modest: preserve the receipt or reference when an important operation becomes uncertain. For system designers, make that reference visible and searchable. A user should not have to infer the outcome from a disappearing spinner or an unexplained error number.
One intention can produce several requests
An idempotency key is a reference that an API can use to recognise retries belonging to the same operation. The AWS Builders’ Library describes caller-provided request identifiers and the need to coordinate recording the identifier with the corresponding changes. Recording only one side creates a gap that can undermine duplicate protection.
The reference expresses identity, not merely similarity. Two identical-looking purchases might be deliberate: a customer may want two copies of the same book. Conversely, repeated transmission of one purchase should remain one intention. A system that guesses solely from matching descriptions can confuse these two situations.
Same key, changed request
Suppose a customer initially requests a red chair and later chooses a blue chair. Reusing the first operation reference without an explicit amendment rule can conceal a new intention. The receiving service needs a documented response to conflicting parameters, rather than silently deciding which instruction wins.
Stripe’s API v1 documentation describes parameter comparisons for reused keys, result storage after endpoint execution begins, and a minimum period before keys may be removed. Reusing a removed key can create a new request. These are product-specific rules; another API may define different retention and replay behaviour.
A reference has a scope and a lifetime
A workshop organiser might assign booking reference B17 within one event, while another event also has a B17. A database needs the event context as well as the short label. The same reasoning applies to operation identifiers: identify the service, account or other namespace within which uniqueness is promised.
Time matters too. If a duplicate-protection record expires, an old request may no longer be recognisable. A well-written contract explains the supported retry window and what to do afterwards. “Protected against duplicates” is incomplete without the boundary within which the statement holds.
Concurrent attempts expose hidden assumptions
Two workers might receive the same operation almost simultaneously. Both could check a record, find nothing and proceed unless the implementation coordinates recognition and execution. A reassuring label in a dashboard does not itself provide that coordination.
The vocabulary lesson is to ask what exactly is protected: message receipt, database insertion, account debit or the full workflow. Evidence for one boundary does not establish another. A successful duplicate check on an internal task record cannot by itself prove that an unrelated external service received only one consequential request.
Repetition and ordering are different questions
Suppose a person first requests a delivery address of 14 River Street, then corrects it to 41 River Street. Setting either address repeatedly might have a stable effect when considered alone. Yet a delayed copy of the earlier instruction could overwrite the newer correction if the workflow does not recognise its age or version.
The example shows why duplicate protection is not a complete change-management policy. A system also needs rules for outdated instructions and conflicting revisions. “Do this once” does not mean “do this in the right order”, and “use this reference” does not mean “ignore every subsequent change”. The intended sequence must remain visible alongside the identity of each operation.
A transaction groups changes
PostgreSQL’s transaction tutorial explains transactions as groups of database changes that commit together or are cancelled. Before a transaction commits, ROLLBACK can discard its changes. That is a specific database mechanism, not a general ability to reverse history.
Imagine a membership system updating a person’s status and adding a matching entitlement record. If those writes belong to one transaction, the application can avoid leaving just one of them committed. This grouping protects a relationship between records. It says nothing, by itself, about a welcome message sent through a separate service.
The boundary is part of the promise
Draw a box around the changes that the transaction actually controls. Then list actions outside it: emails, physical deliveries, external payments, public downloads or another provider’s records. Each may need its own coordination and recovery rules.
This exercise turns “the transaction failed” into a more useful account. Which writes were cancelled? Which actions never started? Which external results are uncertain? A clear incident report can contain several answers because a business workflow may cross several technical boundaries.
Even within a database, read the mechanism’s precise rules. PostgreSQL notes that sequence changes are not rolled back when a transaction aborts. A gap in generated identifiers therefore need not prove that a business record is missing. Transactional guarantees apply to the specified operations, not every observable counter or external side effect.
Restoring an old value can erase new work
Suppose an editor changes a document title, another editor corrects its date, and an automated recovery restores the entire earlier document. The title returns, but the valid date correction disappears. The recovery has overwritten someone else’s work.
PostgreSQL’s isolation documentation distinguishes transaction isolation levels and the concurrency behaviour they provide. The broader design question is which changes can safely proceed together. A system must define how it detects conflicts; calling an update a rollback does not resolve them automatically.
Rollback after commitment means something different
People sometimes call a later deployment reversal a rollback. That everyday engineering usage can be sensible, but it should not be confused with cancelling an uncommitted database transaction. Reinstalling an older application version, restoring a backup and writing a corrective record have different effects.
A release can also change data that the earlier software cannot interpret. Returning the executable alone may therefore leave the system inconsistent. A useful recovery description names the actual steps and their limitations instead of relying on the familiar word to carry guarantees it does not contain.
A new action can address an earlier one
Microsoft’s compensating transaction pattern describes application-specific actions for addressing completed steps in a distributed workflow. Compensation may account for concurrent changes, may fail, and need not restore the exact earlier state. Its progress must therefore be tracked too.
Consider an exhibition organiser who allocates a display stand and then discovers that the venue cannot provide the requested power supply. A possible remedy is offering another stand. Another is cancelling the allocation. A third is arranging suitable equipment. The appropriate action depends on the exhibitor’s agreement and the actual event rules.
Arranging the missing equipment may allow the original plan to proceed through forward recovery. Cancelling a completed allocation is a compensating action. Both can be remedies, but they change the workflow in different ways.
A refund is not historical erasure
In a hypothetical purchase, returning a payment changes the financial position through another transaction. It does not mean the purchase never occurred. Records may still need to explain the original request, the reason for correction and the subsequent remedy.
The distinction matters for communication. “Refund requested”, “refund accepted” and “refund received” can name separate states. Replacing them all with “undone” removes information the customer may need. The remedy should be described at the level supported by the available evidence.
Compensation can itself be duplicated
If a repair process becomes uncertain, repeating the remedy blindly can create another problem. A duplicate refund instruction or repeated replacement shipment may overcorrect the first error. The recovery action needs its own operation identity and completion record.
For example, a fictional supplier can connect replacement shipment S81 to original order O52 and correction case C9. Those links help staff distinguish a retry of S81 from a decision to send an additional replacement. The point is not the naming scheme; it is preserving which action belongs to which intention.
Some consequences require an honest residual state
A withdrawn public notice may already have influenced a decision. A corrected dataset may already have been copied. In these cases, repair can involve a visible correction, a notification or a review of affected decisions. Deleting the original entry alone may not address the consequence.
A useful closing record identifies what was repaired, what remains unresolved and who owns the next step. That is a more faithful description than asserting that the whole situation returned to its starting point. People can make better decisions when the remaining effects are visible.
Continue should reconnect with the existing task
When a user asks an assistant to continue, the assistant should first establish the last confirmed state. Was a document drafted, saved, approved or published? Was a tool call acknowledged? Is there a stable item identifier? Starting another item because the previous response was lost can create unnecessary duplicates.
This is an application of the earlier distinctions, not a special law of AI. The assistant needs records that connect the user’s intention with attempted operations and observed results. Fluent recollection cannot substitute for checking the current state of the relevant system.
Language changes can change the operation
“Try sending it again” and “send another copy” may imply different intentions. “Undo the update” and “replace it with my revised text” also differ. Context can resolve some ambiguity, but a consequential difference should be made explicit before action.
Good workflow design makes common distinctions easy to express: resume the existing job, check its status, repeat the same operation or start a new one. These labels reduce the chance that a person and a machine use the same sentence for different state changes.
Reliable repetition cannot make the wrong goal correct
An assistant could faithfully set the wrong document to private and repeat that operation without additional effect. That would demonstrate a property of repetition while still failing the user’s actual request. The target, authority and intended outcome therefore need checking before the recovery machinery becomes relevant.
A useful action record connects the instruction with the exact object and the evidence used to select it. If the user later corrects the target, preserve that as a changed intention rather than treating the correction as another transmission of the old operation. Correct selection, duplicate protection and honest reporting solve related but separate problems.
Cancellation can race with completion
Imagine cancelling a print order just as the workshop starts production. The cancellation request and the production action may cross in time. A cancellation button should not imply that every stage remains stoppable until the instant the user clicks it.
The system needs a clear observed outcome: cancelled before production, cancellation pending, or already produced with another remedy available. These are distinct business facts. A natural-language assistant should report the actual result returned by the service and avoid silently converting a request into a completed cancellation.
Seven questions for an operation audit
- What is the intended result? State the business outcome, not merely the API call or button name. Specify the person, object, scope and relevant version.
- What identifies this operation? Find the durable reference that distinguishes one intention from another, including the namespace in which it is unique.
- What is currently known? Separate attempted, acknowledged, committed and independently observed states. Record uncertainty without guessing.
- What happens on repetition? Read the documented retry contract, including conflicting parameters, concurrent requests and expiry of duplicate protection.
- Where is the transaction boundary? Identify which changes commit together and which external effects require their own handling.
- What would repair actually do? Name the rollback, corrective update or compensation, and describe any consequences it cannot remove.
- How will completion be verified? Decide which evidence closes the operation and which unresolved conditions require further review.
Practise on a harmless workflow
On day one, choose a low-impact process such as updating a private test document. Write down the intended outcome. On day two, list the words used by its interface and identify any that conflate an attempt with completion. On day three, trace its references and status records.
On day four, use a test environment to examine a repeated request or duplicated task. On day five, document the actual scope of its undo or restoration feature. On day six, write a recovery note for one uncertain outcome, including the evidence needed before trying again.
On day seven, ask another person to follow the note. Observe where they have to guess, then improve those instructions. The aim is a clear account of intention, state and recovery, not an elaborate vocabulary exercise. Never create real charges, send unwanted messages or alter production records merely to test these ideas.
Does idempotent mean an operation runs only once?
No. Requests may arrive repeatedly and processing may involve several attempts. The property concerns the specified effect of repetition. Claims about execution count or delivery guarantees require their own clearly defined boundary and evidence.
Can an idempotent request return different responses?
Yes. HTTP idempotency does not require identical responses. A service may also define a stronger replay contract. Read that contract before assuming that a changed status message necessarily means the underlying operation was duplicated.
Does a timeout mean I should immediately retry?
No. It can leave the outcome unknown. Check the operation’s reference, available status information and documented retry rules. Repeating a consequential action without knowing its semantics can create an additional effect.
Is rollback the same as restoring a backup?
No. Cancelling an uncommitted transaction and restoring an earlier stored copy are different procedures. A backup restore may affect many later changes. Each procedure needs an explicit scope and a way to protect unrelated valid work.
Does compensation always make everything as it was?
No. It is a new action intended to address earlier effects under the relevant rules. Time, communication, physical activity and other people’s decisions may remain changed. Describe the remedy and any remaining consequences precisely.
Can an AI assistant infer all these guarantees from a tool’s name?
No. Names such as retry, cancel or restore are insufficient. The assistant needs the tool’s actual contract, the current operation state and appropriate authority. It should verify consequential results before describing them as complete.
Sources and further reading
- RFC 9110: HTTP method properties, including safe and idempotent semantics
- AWS Builders’ Library: Making retries safe with idempotent APIs
- Stripe API reference: Idempotent requests and API-version-specific behaviour
- Amazon SQS: At-least-once delivery for standard queues
- PostgreSQL: Transactions
- PostgreSQL: Transaction isolation
- Microsoft Azure Architecture Center: Compensating Transaction pattern