Definition
A saga coordinates a business operation through local transactions across services. Compensation applies business-specific corrective actions to completed steps after failure. It is not a database rollback of the entire workflow and may not restore the exact starting state.
Why It Matters
- An agent may reserve stock successfully and then fail to complete the next order step.
- A Commerce Intelligence OS should distinguish a failed request from a fully reconciled commercial outcome.
How It Works
- Map each workflow step, its confirmed effect, and its permitted corrective action. Mark irreversible actions explicitly.
- Persist step identifiers and outcomes so recovery can identify which effects actually occurred.
- Run authorized compensation in the order required by business dependencies. Make repeated corrective requests safe and record their results.
- If compensation fails or the outcome is uncertain, retain a pending recovery state and route it to an accountable owner.
Ecommerce Example
Context: Illustrative example: a workflow reserves two units, but a later order-creation step fails before any shipment exists.
Recommended move: Verify the reservation and order state, then release only the reservation associated with the failed workflow under its approved recovery rule.
Why it matters: An already dispatched parcel would require a different resolution. This is a proposed workflow design, not a claim about current iKawn execution.
iKawn Framework
Map
The iKawn framework ties agent steps to commercial effects.
Record
Keep completion evidence separate from request status.
Compensate
Use approved corrective actions for confirmed effects.
Resolve
Track recovery until the merchant-facing state is reconciled.
Concise Summary
Plan recovery for completed effects before running a multi-service workflow. Compensation has its own failure states and must remain observable.