Define what “undo” means for the business
A database rollback and a business recovery are different things. Your database may reverse changes inside one transaction, but that does not automatically reverse a completed operation in another product. A workflow spanning several APIs needs an explicit plan for partial success.
Microsoft’s Compensating Transaction pattern describes corrective steps for work already completed. It warns that simply restoring the original data can overwrite concurrent changes, and that recovery depends on the business operation. That is a useful starting point for AI integrations too.
Write the recovery outcome in business terms: release this workflow’s reservation, restore a field only if it has not changed again, or ask the account owner to correct a customer message. Avoid a single “undo everything” promise that the connected systems cannot fulfil.
Illustrative example: rearranging a service visit
Consider a fictional UK maintenance company. An assistant proposes a new visit time, prepares a CRM update and drafts a customer email. After a staff member approves, the workflow reserves the new slot and updates the record. The email step then times out.
There are several possible states: the email request never arrived, it was accepted but is still processing, or the message was sent before the connection failed. The team must establish what happened before sending another message or cancelling the reservation.
This is an illustrative design example, not a Fewzen client result. The recovery goal is a consistent booking and an accurate customer communication. Returning every system to yesterday’s state may be wrong if the customer or a colleague has since made another change.
Classify actions before you automate them
List each proposed action, its evidence of completion and its recovery route. Include a named owner for cases that cannot be resolved automatically. Keep the scope narrow enough that the team can explain what happens after each failure.
| Action | Possible recovery | Important boundary |
|---|---|---|
| Prepare an unsent draft | Discard or replace the draft | Check that it has not since been sent or edited. |
| Change a CRM field | Restore the previous value after a version check | Do not overwrite a colleague’s later change. |
| Reserve a visit slot | Release the reservation created by this run | Use its exact identifier and check its current state. |
| Send a customer email | Investigate delivery and arrange a correction if needed | Do not promise that a recipient has forgotten or removed it. |
Keep a record outside the conversation
Assign one stable identifier to the business operation and record each step separately. Useful fields include the target record, requested change, approval reference, external result identifier and timestamps. Store only the information needed for recovery, with appropriate access and retention controls.
Distinguish planned, attempted, confirmed, uncertain, corrected and awaiting-review states. If a process restarts, it should resume from that record rather than ask the model to reconstruct events from a conversation summary.
AWS describes saga orchestration as a coordinator managing a transaction across services. Its guidance highlights retry safety, observability and added complexity. You do not need to adopt a particular cloud product, but the coordination state must survive a worker crash or a model call failing.
Treat an uncertain result as a separate problem
A timeout means the caller lacks a response; it does not establish that the action failed. Check the receiving system using the operation identifier or other supported evidence before deciding whether to repeat it. Where the API supports an idempotency key, retain the same key for a retry of the same operation.
Also distinguish acceptance from completion. Microsoft Graph’s sendMail documentation states that a 202 Accepted response does not mean processing has completed. A workflow should report that stage accurately rather than telling an operator that delivery is confirmed.
If the service offers no reliable way to reconcile an uncertain action, pause that case for a person. Make the unresolved step and its possible consequences visible. Automatic retries are not a substitute for knowing whether the first request took effect.
Test the awkward stopping points
In a sandbox or controlled pilot, interrupt the workflow after each external action. Test a lost response after a successful write, a colleague editing the record, a repeated recovery request and a revoked connection. Check the resulting records in every affected system.
Include a case where recovery itself fails. The acceptance check is whether someone can see what remains unresolved and safely continue, not whether the interface displays a reassuring success message.
Keep customer-facing commitments late in the sequence where practical. Prepare drafts and validate prerequisites first. This reduces the number of situations needing a correction, although it cannot remove every failure window.
Start with one workflow and a recovery table
Choose a process that already crosses two systems. Write down its actions, completion evidence, safe retry rules, corrective actions and escalation owner. Review the table with the people responsible for the business outcome before enabling more autonomous writes.
Recovery design adds implementation, storage and support work. For a low-risk task, retaining drafts and a simple exception queue may be enough. Where several systems or customer commitments are involved, budget for reconciliation and rehearse it. An agent is easier to trust when the team knows how to put things right.