Durable beside the Workflow SDK
A platform's directives make a function durable. The dedupe, the idempotency and the rollback stay with you.
A platform's durable functions: the Workflow SDK
What it gives by its own documentation, what that leaves you to write, and the same work under Durable. Each product compared has a page like this one.
What the Workflow SDK gives, as its documentation describes
- 1
Two directives, an event log
- it gives
- A "use workflow" function compiles into an orchestrating route and each "use step" into its own; every input and output lands in an event log the platform replays after a crash or a deploy.
- you write
- Plain async code the platform can replay deterministically, with external calls inside steps, since a step is what gets the retries and survives a crash.
- 2
A retry repeats the step
- it gives
- A step that throws is retried a set number of times with no delay by default, and a retry can repeat a payment, an email or an API write. A lost connection to the platform's own backend does not prove its write was rejected, so the step may run again.
- you write
- The idempotency of every side effect inside a step, and of any rollback step, since it may run more than once.
- 3
A start takes no key
- it gives
- Two concurrent requests can both start a run; run-level deduplication is a hook created under a deterministic token at the top of the body and a conflict check, the loser returning.
- you write
- That token, that check, and the external idempotency key built from the step id.
- 4
Cancellation stops, it does not reverse
- it gives
- A cancel stops the run at its next suspension point and disposes its hooks; no compensation or rollback of a cancelled run is described.
- you write
- The compensation when a later step fails or a run is cancelled.
- 5
A run pinned to its deployment
- it gives
- A run keeps running on the deployment that started it through sleeps, waits on a hook, step retries and queued messages. A redeploy changes new runs only, and a fix never reaches a run already in flight.
- you write
- Deploying the fix, then finding the affected runs and cancelling the ones still running. Rerunning each on the latest deployment with the same inputs, from the dashboard or through a recovery route you add. Or splitting long work into bounded pieces that each start the next on the latest deployment and carry their state forward, with names, arguments and return shapes kept compatible.
- 6
Payloads kept for a while
- it gives
- A finished run's payloads stay readable from a day to a month by plan, then every copy is gone some months later. The payloads are each step's input, return value and error, the run's own, the hook and event payloads and the streams; the run's unencrypted metadata outlives them.
- you write
- The image of your data before a write, and your own copy of a result before it becomes unreadable.
The same work under Durable
- 7
A library on your own database
- it does
- The engine is a library inside your app's functions on the Postgres the app already has; a minute cron is the one moving part outside the request path, and no platform queue sits in the run's path.
- 8
The key is derived, not minted
- it does
- key: ["orderId", "requestId"]: a field list off the input, clock-free, refused at the door otherwise; the key and the run commit in one transaction, so the same intent twice is one run before anything is written.
- 9
An undo on every step, or the reason
- it does
- Each step declares its undo with its effect or says why it cannot; when a later step fails the undos run in reverse, each a ledger row with what it found and what it restored.
- 10
Images never aged out, then limbo
- it does
- Every write leaves a before and after image on an append-only, hash-chained ledger that is never pruned; durable-sdk ledger verify --file <export> walks an export offline. A failed run waits in limbo after bounded redrives of a transient cause, with its rows and the remedy; a redrive reads the world before it writes.
- 11
The agent asks the graph
- it does
- durable-sdk explain <workflow> prints what the door admits, every step with its undo and its writes, the facts and who listens; durable-sdk graph walk <subject> prints the closure from any node; durable-sdk graph impact --changed prints what a change reaches before it is made. Offline, over a committed index: an AI coding agent asks before it edits, never guesses.
- 12
Nothing to write but the steps
- it does
- No hook token, no conflict check, no rollback step, no copy of a result before it expires, no recovery route after a deploy: a changed body patches a branch and a run in flight finishes the one it started, or bumps its version and every run in flight waits in limbo for a person, and a long run continues as new; durable-sdk doctor --host runs every rule over the tree before a deploy.
- you write
- The steps and their undos.
When the Workflow SDK wins: plain async code on the platform's own functions, queue and trace viewer, with streams and a Python beta, where a step's inputs and outputs are record enough and the compensation can stay in your hands. The walk in prose, with its sources.
The whole table, with every source, in Compared.
One charge, and a row that says so.
Two commands to an app with a ledger, and one that asks the graph what happens before you edit.