01 // What it’s for
Why reach for Durability (Operations)
Use Durability when a Durable Object must accept a keyed job, execute it durably across crashes or evictions with bounded retries, avoid re-running expensive completed steps via durability_memos, and let callers poll or await the final outcome via getResult(id).
02 // How it works
Inside your Durable Object
- 01Keyed idempotency gate: Registering an operation inserts a row in
durability_callskeyed by(channel, id). Re-submitting the same ID with the identical payload is an idempotent no-op; a conflicting payload is rejected immediately. - 02Memo checkpoint fast-forward: Intermediate results stamped into
durability_memossurvive crashes—on retry, execution fast-forwards past already-completed steps. - 03Generation & attempt lock fence: Each attempt increments its durable generation/attempt counter before running, preventing a timed-out zombie attempt from overwriting a newer attempt's result.
- 04Explicit result lifecycle: Inspect
not_found,pending,completed, orfailedviagetResult(id)and reclaim old records + memos withpurgeBefore().
Storage
durability_calls + _memos
Alarm
Built-in / Shared Scheduler
Import
durability