Imagine asking an assistant to change an order from twenty components to thirty. The agent finds availability, reserves the additional units and asks the carrier for a larger collection. The connection then drops before the transport confirmation arrives. Your screen displays an error.
Is the order unchanged? Did the carrier receive the request? Are the extra ten units still reserved? If you press retry, are you continuing the work or arranging a second collection?
This is a hypothetical example, but it asks a concrete question of any product that delegates actions to AI: a task can fail after it has already changed the business. Before granting an agent more autonomy, I would want a verifiable account of that intermediate state.
The error on the screen does not describe the business state
In a conversation, another answer can correct an earlier answer. In an operational system, the explanation follows changes that may already have consequences elsewhere. A record has been updated, a supplier has accepted an instruction or an employee has started preparing a shipment.
The model can help interpret the request. The application must decide which transitions are permitted, preserve confirmed effects and prevent a convincing explanation from substituting for actual state. That is why recovery belongs in the design of AI integrations for business workflows, before the demonstration of an uninterrupted successful run.
Saving the conversation is insufficient. We need to distinguish the user’s intention, the authorised operation, the calls that were made and the results acknowledged by participating systems. Saying that an amendment failed tells an operator very little if half of it has already happened.
We use the word undo for three different things
If every change belongs to one database and has not yet been committed, a transaction can allow those changes to be abandoned together. The PostgreSQL transaction documentation explains that local scope. A request already accepted by a carrier does not join the same transaction merely because the same application initiated it.
After an external effect has been confirmed, undo usually means performing another action. Release the reservation. Cancel the collection. Send the customer a correction. That new action has its own conditions and may leave costs or consequences that were absent before the original operation.
Some effects cannot be withdrawn at all: a message has been read or a shipment has departed. The system then needs to limit further action and arrange a resolution. Deleting the original record would merely hide what happened.
The distinction is central to Microsoft’s Compensating Transaction pattern: compensation does not necessarily restore the exact past. A correction policy has to respect the business and other changes that have occurred in the meantime.
An order amendment needs more than success or failure
Return to the order example. In an enterprise B2B SaaS product, I would start by making the important stages readable without creating a separate state for every technical detail.
| Observed situation | Operational meaning | Possible next decision |
|---|---|---|
| Amendment proposed | No external commitment has been made | Revise or abandon the proposal |
| Additional stock reserved | Availability has been temporarily affected | Confirm the amendment or release that reservation |
| Transport outcome unknown | The carrier may have accepted the request | Check the operation reference before repeating it |
| Transport confirmed | The supplier acknowledges a commitment | Continue or request a permitted compensation |
| Correction pending | An effect remains unresolved | Resume recovery or hand the case to a person |
These are proposed states for this example, not a universal schema. The important distinction is between not performing an action and not knowing whether it was performed. If both appear as an error, staff have to reconstruct the process manually.
I would not allow the model to move freely between these states either. A business service should validate each transition and the evidence that supports it. AI can propose releasing a reservation; the application must establish which reservation it is, who owns it and whether release is still permitted.
An unknown outcome needs its own recovery path
A timeout tells you that a response did not arrive within the expected period. It does not establish that the other system rejected the request. In this example, immediately repeating collection creation could make the uncertainty worse.
The operation should have a stable reference that allows the supplier to be queried or a repeated request to be recognised. The caution around repeating operations without such a guarantee is reflected in HTTP’s idempotency rules.
The subject of idempotency keys and duplicate charges helps separate two decisions: repeating a logical operation without duplicating its intended effect, and correcting an effect that has already occurred. Neither removes the need to verify the external service’s actual response.
I would record an attempt before sending it, preserve the supplier’s operation reference and retain every acknowledgement. If a supplier offers neither a status query nor deduplication, that limitation should constrain the autonomy granted to the integration. Adding another sentence to a prompt does not create the missing capability.
Compensation has a failure path too
Suppose the collection has been confirmed, but the customer decides to keep the original quantity. The system requests transport cancellation and releases the additional ten units. Release succeeds; cancellation receives no response.
This is no longer the original failure. It is an incomplete recovery. The product should expose that distinction and preserve the point from which work can resume, without releasing stock again after it has been assigned to another order.
The order of correction depends on consequences. Releasing material before establishing whether a carrier will collect it might be wrong. In another process, holding a reservation throughout a lengthy investigation could unnecessarily block sales. That decision needs an explicit rule and an operational owner, rather than an agent improvising during the incident.
For distributed flows, the saga orchestration guidance from AWS provides a reference for coordinating steps and compensations. It does not eliminate concurrency between processes. Our example still needs to prevent an old recovery operation from altering an order that a person has since changed.
An approval button does not make every consequence acceptable
Confirmation before execution can be useful, but approval should explain what will change and how far the operation remains reversible. Asking whether the customer approves an amendment does not explain that urgent transport may become non-cancellable after a particular commitment.
I would distinguish permission to attempt the amendment from authority to accept a more expensive alternative or repair an existing commitment. If recovery requires a new decision, the interface should request that decision using the updated state.
The corrective action also needs boundaries. Permission to cancel one particular collection must not permit cancelling the customer’s other collections. Recovery passes through the same access and record-ownership controls as the original operation. Trying to repair an error does not grant additional authority.
The simplest solution may still be a small application
None of this requires starting with multiple services, a workflow engine and a long chain of events. If a business application contains the relevant records, a local transaction and a table of pending operations may solve much of the problem.
I would add distributed coordination when independent commitments genuinely require it. Splitting a small product into services solely to manage their compensations can create the problem the architecture was meant to solve.
The requirement I would retain at any scale is easier to express: a person must be able to establish what has been confirmed, what still needs checking and which next action is permitted. If that reconstruction requires reading thousands of lines of conversation, the product lacks operational structure.
The useful test interrupts work halfway through
Before increasing autonomy, I would test interruptions at selected points. What appears if the application crashes after sending the carrier request? What if it crashes after receiving confirmation but before saving it? Can a delayed response from an old attempt change the outcome of a newer attempt?
I would also test a failure during correction and a human intervention while correction remains pending. The aim is not to demonstrate an animated sequence of messages. It is to check that the system preserves the right commitments, avoids repeating effects improperly and hands over an understandable case when it needs help.
These are proposed acceptance criteria for the example. They are not reported test results or a promise that failures have been eliminated.
What I would require before 2030
We do not need to predict that every business will employ autonomous agents by 2030. Considering the possibility of delegating more steps across systems is enough to recognise that the cost of a misunderstood action can increase with its reach.
My priority would be to expand autonomy only when recovery has been demonstrated for the actual process. An agent that can prepare a proposal may be useful without authority to confirm it. An agent that performs fewer steps but leaves work in an explainable state may serve the operation better than one that goes further and makes staff guess what it did.
Before the next integration, choose one important external action and pause the design at the instant when it has happened but the application does not yet know the result. If you cannot explain how the case is resumed, compensated or handed to someone, the feature design is unfinished.
[+] On this page 16 topics ▼
- The error on the screen does not describe the business state
- We use the word undo for three different things
- An order amendment needs more than success or failure
- An unknown outcome needs its own recovery path
- Compensation has a failure path too
- An approval button does not make every consequence acceptable
- The simplest solution may still be a small application
- The useful test interrupts work halfway through
- What I would require before 2030
- Author
- Frequently Asked Questions
- Is an idempotent action also reversible?
- Do these principles require a microservices architecture?
- What should happen when compensation also fails?
- Related Articles
- Continue reading
Frequently Asked Questions
Is an idempotent action also reversible?
No. Idempotency limits the effect of repeating the same logical operation; reversibility concerns withdrawing or compensating for an effect already produced. An order can be created exactly once and still be impossible to cancel automatically.
Do these principles require a microservices architecture?
No. A small product may need only a local transaction, explicit states and a recovery queue. Coordination between services is justified when the process actually crosses systems with independent commitments.
What should happen when compensation also fails?
The process should preserve confirmed effects, its interruption point and external references. It can then retry a safe correction or hand the case to an identified owner, without telling the customer that reversal has completed.
Related
Start your project
Need a website that earns trust, ranks in search, and gives your business a stronger digital presence? Start the conversation here.
- https://www.postgresql.org/docs/18/tutorial-transactions.html
- https://learn.microsoft.com/en-us/azure/architecture/patterns/compensating-transaction
- https://docs.aws.amazon.com/prescriptive-guidance/latest/cloud-design-patterns/saga-orchestration.html
- https://www.rfc-editor.org/rfc/rfc9110.html#section-9.2.2