techdiagrams.net
← All templates

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.

Open in editor — free, no login Download JSON
ACTIVITIES — EVERY SIDE EFFECT LIVES HEREstart(orderId)append + replayschedule activitiesfires as history eventcancel orderexhausted retries → unwindrelease reservationOrder APIstarts workflowsFulfillment Workflowdeterministic · replayableEvent Historyappend-only, the truthDurable Timerwait 24h for pickupTask Queuesactivity dispatch · affinitySignalscancel / address changeReserve Inventoryactivity · retry ×3Charge Paymentactivity · idempotentBook Shippingactivity · retry ×5Notify Customeractivity · best effortCompensationsrefund · release · cancelthe workflow function is DETERMINISTIC:crash anywhere → replay the history →resume mid-flow as if nothing happenedhistory grows per event — long-livedworkflows roll over with continue-as-new,carrying state into a fresh run

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

Import it, attach your own numbers, and verify the design against failures — or read the engineering notes.