Durable workflow — order fulfillment
A Temporal-style durable workflow orchestrating fulfillment: deterministic workflow code, activities with retry policies, durable timers, cancel signals and saga compensation.
What this design does
Long-running business flows fail in the middle — the process crashes between charging the card and booking the courier. Durable execution makes that boring: the workflow function is deterministic and replayable from its event history, every side effect lives in a retryable activity, and failure runs the saga backwards. Import it and trace what happens when 'Charge Payment' dies on attempt two.
The patterns it composes
- Durable execution / workflow-as-code — crash → replay history → resume exactly where it stopped
- Activity with retry policy — side effects are isolated, retried and idempotent
- Durable timer — 'wait 24h' survives restarts — it's an event, not a sleep()
- Signal — external events (cancel!) reach a running workflow
- Saga orchestration / compensation-as-workflow — failures unwind: refund, release, apologize
- Continue-as-new — unbounded histories roll over without losing state
Import it, attach your own numbers, and verify the design against failures — or read the engineering notes.