Pattern · seen in 3 breakdowns across 3 companies
Durable Workflows
A durable workflow lets you write a multi-step process as plain top-to-bottom code, while the system saves each step as it finishes, so a crash resumes from the last completed step, not the start.
The mechanism
The pattern at its core: a multi-step workflow that crashes partway, and a runtime that replays the code from the top but returns the saved result for every step that already finished, so no step's effect runs twice.
Crash a workflow partway, then replay it - each finished step returns its saved result, so every effect fires once.
Definition
A durable workflow is a multi-step process - a payment, an onboarding, an approval - that remembers how far it has got, even through crashes, restarts, and long waits. Your code never has to handle the saving, retrying, or recovering itself. The person writing the workflow writes plain, top-to-bottom code, and the engine underneath promises that if the process is interrupted anywhere, it picks back up from the last good point when it restarts.
The key idea is to split the workflow into two kinds of code:
- the flow - the ifs, loops, waits, and order of steps; it must be deterministic (same inputs, same result every time) so it can be replayed exactly
- the effects - the parts that change the outside world, like calling an API or writing to a database; each one is wrapped in a named step whose result is saved (checkpointed) when it succeeds
After a crash, the workflow runs again from the top. But wherever it reaches a step that already finished, it uses the saved result instead of running that step again - the same checkpoint-and-resume idea, now applied to a whole multi-step process at once. So the author just sees plain, top-to-bottom code, while the engine underneath does the work of surviving crashes.
When it applies
Tradeoffs
The same move, 3 ways
Every row is a production system that bet on this pattern — the note says how, in that system's own terms.
Often used together
Patterns sharing breakdowns with this one — derived from co-occurrence, threshold ≥2 shared.
Problems this pattern answers
The walls where its breakdowns live — each opens the cross-company comparison.