Durable order workflow: steps, retry, compensation
Durable order workflow: steps, retry, compensation
every step has a stable id · results live in the durable log · replay never re-runs a logged step
main
Start
trigger
Reserve stock
step id R
Charge card
step id C
Ship order
step id S
Done
all logged
-->
-->
-->
-->
guard: valid
guard: stock ok
guard: charged
guard: shipped
retry: same step id, replay reuses logged results
terminal
Version gate
v1 history: v1 code
Compensate
undo charge, release
Compensated
terminal
v
fails after charge
-->
replay
order, branch or payload changes ship as a NEW version — in-flight runs finish on the old one
no idempotency key at the provider means at-most-once effects need reconciliation, not retries