The parcel has shipped. Then the confirmation email fails.
transcript
The parcel has shipped. Then the confirmation email fails. Your saga can undo steps. So does it refund the customer?
An order saga. Each step is a local transaction, with a compensation. Reserve inventory. Its undo: release it. Charge the payment. Its undo: a refund. Ship the order. Its undo? There isn't one. You can't unship a parcel.
That step has a name. The pivot. The point of no return. And it splits your saga in two.
Before the pivot, failure means give up. Compensate backwards. Shipping fails? It never happened. Refund, then release, in reverse order. Then ship. The parcel is on its way. After the pivot, the saga must complete. Retry forward until it succeeds.
So the email. Compensating now would refund a customer whose parcel is on its way. Instead, retry the email until it goes. Safely, because it's idempotent.
Pick the pivot from the business. The step you can't take back. Before it, compensate. After it, retry forward.
Full breakdown in the lecture.