Skip to content

When step 3 fails after steps 1 and 2 have already done something real, like taking a payment, how do you undo it cleanly?Also calledSaga Orchestration & Compensating Transactions

Module
03/05Module
To read
~7 minTo read

It starts with a failure

A travel booking tool charges the customer’s card, books the hotel, then fails to book the flight. What do you think happens to the charge and the hotel booking?

In the module you make your guess first, then read what happened and why.

  1. 01

    Pair every step with its undo step

  2. 02

    Decide when to retry and when to undo

  3. 03

    Make every undo step safe to run twice

  4. 04

    Record each step before it runs

SpecAn undo plan for multi-step actions

A spec for your own app, as a text file you download. The module also gives you the prompt to paste into the AI you build with (Lovable, Bolt, Replit, Cursor, Claude Code or Codex), a checklist to check what it built, and recommended skills.

  • Undo steps that are safe to run twice
  • Background workers that survive a crash
  • Half-finished is not final