Agents That Survive: Durable Execution for Long-Running Work
A chatbot answer takes seconds. An agent task can take hours: it calls a model dozens of times, runs tools, waits for a human to approve a step, and waits again for a CI build. Over that time servers crash, deployments restart processes, model APIs time out and rate limits bite. If the agent's progress lives only in one process's memory, all of it is lost. Durable execution is the infrastructure that makes a long agent run behave as if nothing ever failed: it records each step, and after a crash it replays the record and carries on from where it stopped.
1. Case file
interrupt() for human approval2. The problem
A naive agent is a loop in one process: ask the model, run the tool it chose, append the result, repeat. That works in a demo. In production, the process can die at step 37 of 60. Restarting from step 1 wastes the model calls already paid for, and worse, it can repeat side effects: a second email sent, a second payment, a second pull request. The question durable execution answers is: how do we restart a half-finished agent so that work already done is neither lost nor repeated?
3. How durable execution works
The trick is that model outputs are not deterministic, so they must be recorded rather than recomputed. Once the model's answer for step 12 is in the history, replay sees exactly the same answer, and the agent takes exactly the same path.
4. Crash and replay
Kill the worker at step 5
A seven-step coding-agent task. Pick a strategy and press run; the worker crashes after step 4. Our illustration.
5. Why it matters more as tasks grow
Chance a run hits at least one failure
Our model: 1 โ (1 โ p)n, with n external calls and p the chance that any one call fails transiently (timeout, rate limit, crash).
Task length is rising fast (Evaluation Layer Part 5 tracks the time horizons). An agent that works for a working day makes hundreds or thousands of calls; at that scale a failure somewhere is close to certain, so recovery has to be built in, not bolted on.
6. The tools
| Tool | Approach | Agent angle |
|---|---|---|
| Temporal | Open source (MIT) workflow engine with event-history replay; Temporal Cloud is the paid service | Integration with the OpenAI Agents SDK built with OpenAI; OpenAI says it uses Temporal for durable orchestration; reported to be Temporal's biggest customer โ ๏ธ |
| LangGraph | Graph of nodes; a checkpointer saves state per thread after each step | Durability modes exit / async / sync; interrupt() pauses for human input; Postgres checkpointer for production |
| Restate, Inngest, DBOS | Lighter-weight durable functions: journal steps in a log or in Postgres | Pitched at AI teams who want durability without running a separate cluster |
| Cloud workflow services | AWS Step Functions, Azure Durable Functions, Google Cloud Workflows | Managed state machines; often used to orchestrate agent steps inside one cloud |
| Agent platforms | Hosted agent runtimes from the labs and clouds | Persist session state and resume; details are mostly not public |
7. Waiting for humans
Durable execution is also what makes human-in-the-loop practical. When an agent needs approval to merge code, spend money or send a message, it should not hold a process and a sandbox open for the hours a person may take to answer. Instead it saves its state and stops. When the person approves, the engine loads the state and resumes. In LangGraph the node calls interrupt() and is resumed with a Command; in Temporal the workflow waits for a signal, which can take days at almost no cost. One caveat from LangGraph's docs: on resume the interrupted node re-runs from its start, so code before the interrupt must be safe to repeat.
8. Rules for agent builders
9. The series
Inside the Agent Layer: eight parts
10. Reading the numbers
- Primary
- Temporal Series D, $300M at $5B (Temporal blog, Feb 2026). LangGraph checkpointers, durability modes and interrupts (LangChain docs). TemporalโOpenAI Agents SDK integration (Temporal announcement).
- Reported โ ๏ธ
- Temporal Series E, $550M at $12.55B, and OpenAI as its largest customer (Forkast). GA date of the OpenAI integration (Unite.ai).
- Our illustrations
- Crash simulator, failure-odds calculator.