saga
A saga coordinates a multi-step operation through local commits and explicit recovery actions.
Use this when A business operation spans systems that cannot share one transaction.
without the term
“Placing an order charges the card, reserves stock in another service, and books shipping. If shipping fails, the card is already charged. How do we handle failures across these steps?”
with the term · How do you ask a model for saga?
Model this cross-service workflow as a saga. Test a failure at each step, repeated delivery, and failed compensation without losing recovery state.
What is saga?
Each step commits on its own, such as charging a card, reserving stock, and booking shipping. If a later step fails, earlier ones get compensating actions such as a refund, and progress is saved so recovery can resume.
Why does saga matter when vibe coding?
A happy-path orchestration can leave partial results after a later step fails.
How do you do saga?
Persist progress and define retries, compensation, and manual recovery for each step.
What goes wrong with saga?
Assuming every external effect has an exact inverse.