Notes

Durable Execution

An agent that runs for ten seconds can afford to live entirely in memory. One that runs for six hours cannot: the process will be restarted, the machine will be recycled, a tool will time out, and a deploy will land mid-task. Durable execution is the property that lets the run survive all of that and carry on from where it was.

How durability is achieved
The technique is to stop treating the loop as a program in memory and start treating it as a sequence of recorded facts:

  • Every step’s input and result is persisted before the next step begins — the run’s state lives in a store, not in a variable.
  • Replay reconstructs position after a restart: completed steps are served from the log rather than re-executed.
  • Side effects are made idempotent, usually with a key, so a replayed payment or email happens once.
  • Waits become durable: an agent pausing days for human approval is a suspended record, not a blocked thread.

Why it matters
Without it, every failure costs the entire run — and in an agent that cost is real money in tokens already spent, plus a half-finished set of external actions nobody can reason about. Durability is also what makes human-in-the-loop practical at all, because an approval that arrives tomorrow has to find the run still waiting. Temporal, Restate and LangGraph’s checkpointers all implement this pattern; LangGraph’s persistence layer is the version most agent developers meet first.

Durable execution is the guarantee that a long-running agent survives crashes, restarts and deploys by persisting each step’s input and result, then replaying the log to resume exactly where it stopped rather than from the beginning. Side effects are made idempotent so replay does not repeat a payment. It is what makes multi-hour runs and day-long waits for human approval possible, and what stops a failure from discarding every token already paid for.

Imagine filling in a long form online. If it crashes on step nine and you must start again from step one, the form is not durable. If it reopens exactly where you were, it is.

Durable execution is that idea applied to software working on its own for hours. After every step it writes down what it did and what happened, so a crash, a restart or an overnight wait does not throw the work away.

It also has to avoid doing anything twice — you would not want it to pay the same invoice again after restarting. This is what lets these systems be trusted with jobs that take hours, or that pause while a human says yes.