FIG_001 [ OPERATIONS ]
FIG_001 // Interactive Cutaway durability

Durability (Operations)

Idempotent keyed jobs with durable retries, step memos, generation fencing, and retrievable results.

FIG_001 [ DURABILITY // OPS ] MEMO // FENCE
1 Register (Idempotent) 2 Run + memoize() 3 Fence + getResult()
1 / 5
STANDBY: Run a durable operation, crash at Step 2 to watch physical tape rewind & fast-forward past MEMO 1, or test payload & stale-attempt fencing.
CALLS KEYWAY op#42 • h:A7F READY DEDUPE: OPEN durability_calls h:A7F ATT 0 STANDBY 0 MEMO UNSTAMPED UNSTAMPED FINAL STEP MEMO 1 memoize("a") IDLE MEMO 2 memoize("b") IDLE STEP 3 return json IDLE durability_memos • AUTO-DELETED ON SETTLE LATE ATT G1A1 RESULT VAULT EMPTY G0•A0 AWAITING CLAIM getResult(id) STATUS: NOT_FOUND { status: "not_found" }   PURGEABLE VIA PURGE_BEFORE SUPPLY REEL ATTEMPT TAPE SOURCE DATA IN OP({ID, PAYLOAD}) CALLS KEYWAY DEDUPE (CLICK REPLAY) MEMO HEADS DURABILITY_MEMOS TAKE-UP REEL FWD • REW • FAST-FWD GEN/ATT LOCK FENCES STALE ATTEMPT RESULT VAULT GET_RESULT(ID) JSON PURGE_BEFORE() WIPES RESULT + DEDUPE
GUARANTEE: AT-LEAST-ONCE STEPS + MEMOIZE() CHECKPOINTS + FENCED COMMIT (CLICK KEYWAY FOR IDEMPOTENT REPLAY)
SPEC // 01 [ ARCHITECTURE ]
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

  1. 01Keyed idempotency gate: Registering an operation inserts a row in durability_calls keyed by (channel, id). Re-submitting the same ID with the identical payload is an idempotent no-op; a conflicting payload is rejected immediately.
  2. 02Memo checkpoint fast-forward: Intermediate results stamped into durability_memos survive crashes—on retry, execution fast-forwards past already-completed steps.
  3. 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.
  4. 04Explicit result lifecycle: Inspect not_found, pending, completed, or failed via getResult(id) and reclaim old records + memos with purgeBefore().
Storage
durability_calls + _memos
Alarm
Built-in / Shared Scheduler
Import
durability