Back to Glossary
What Is Durable Execution for AI Agents?
Durable execution keeps an AI agent's run state outside the process, so a run survives restarts and long waits and resumes without repeating side effects.
By Hagai Cohen and Maksim Markov
November 28, 2026
6 min read
Definition
Durable execution is a way of running long-lived work so that its progress is stored outside the process doing it, which lets a run survive crashes, deploys and long waits and resume from where it stopped. For AI agents, the stored state covers the conversation, the data gathered so far, the exact step the agent was on, and the results of tool calls already made. A resumed run continues from that point and does not repeat actions that already happened in the outside world.
Why it matters
Most operations work is not finished in one sitting. An agent reconciling an invoice that doesn't match its purchase order may need to ask the buyer which figure is right, and the buyer may answer the next morning. An agent processing a vendor file with changed bank details should stop until someone in finance confirms the change.
If the run lives only in memory, any of these waits is fragile. A routine deploy, a crashed container or an autoscaler that removes a machine ends the run, and the answer arrives to find nothing waiting for it. Worse, a naive retry starts the job from the top and repeats the refund, the email or the record update it had already made.
How it works
A durable agent run is built from three pieces:
- State is written down, not held. Before the agent waits, its working state is saved to a database, along with a record of what it is waiting for.
- Side effects are recorded once. Each tool call's result is stored when it completes, keyed by its position in the run.
- Resumption replays from the record. When the answer, the approval or the due time arrives, a worker loads the saved state and replays the step. Calls that already completed return their stored results. Only new work actually runs.
A small example, for an agent handling a refund outside policy:
| Step | What happens | Stored |
|---|---|---|
| 1 | Look up order 4471 | Order details |
| 2 | Policy check fails: 9 days late, limit is 7 | Check result |
| 3 | Ask the refunds owner, then park | Question and pending wait |
| (restart) | Process is replaced during a deploy | Nothing lost |
| 4 | Answer arrives: refund 50% | Answer |
| 5 | Issue the refund, reply to the customer | Refund id, message id |
If the process dies between steps 4 and 5, the replay reuses steps 1 to 4 from the record and only performs step 5.
General-purpose durable execution engines exist for this, such as Temporal, which records a workflow's history and replays it to rebuild state. Agent frameworks offer their own versions. In LangGraph, interrupt() pauses a node and saves graph state through a checkpointer, and the run resumes when you call the graph again with the same thread. The node restarts from its beginning, so code before the interrupt runs again, and surviving a restart needs a persistent checkpointer such as PostgresSaver rather than InMemorySaver.
Common mistakes
- Polling in a live process. Keeping a loop alive until someone replies ties up a worker and loses the run on the next restart.
- Replaying side effects. Resuming by re-running the whole step without recorded results sends the second email or issues the second refund.
- Waits with no limit. A durable wait still needs a deadline and a plan for what happens when it passes. Otherwise work sits forever.
- Waits nobody can see. A parked run should appear in traces as a step, with who was asked and how long it has been waiting.
- Treating a timeout as a failure. A two-hour wait for a person is normal. Failing the run throws away everything done before the question.
How Fruxon does it
In Fruxon, a run that waits is parked in Postgres, not in a live process. Each pending dependency, such as a question to a person or an approval, is stored as its own row, and the run's task moves to a waiting state until it resolves. On resume, the step is replayed with memoized tool results keyed by step and tool-call index, so calls that already completed are not made again. Recovery sweepers pick up runs left stranded by a restart.
Waits are bounded. When an agent calls its ask tool, the question waits hours or days, up to two weeks, and Fruxon nudges the person if they go quiet. Exact defaults are in the docs. Automations keep a durable row per item, with Wait stages that park items until a due time and Ask a person stages that park them until someone answers. Every wait shows up in the run's trace as a normal step.
Frequently asked questions
What is durable execution in simple terms?
It means a program's progress is saved somewhere safer than memory, so a crash, a deploy or a long pause does not lose the work. When the program starts again, it picks up from the last saved point instead of starting over. For AI agents, that saved state includes the conversation, the data gathered so far and the results of every tool call already made.
Why do AI agents need durable execution?
Agents that do real work often have to wait: for a person to answer, for an approval, or for a date. A wait of hours or days will outlive the process that started it. Without durable state, the run and everything it learned are lost the next time the server restarts.
How does durable execution avoid sending the same email twice?
It records the result of each side-effecting call when it completes. When a run is replayed after a restart, the recorded result is returned instead of calling the outside system again. Calls that had not finished are the only ones that run, which is why idempotency keys on those calls still matter.
Is durable execution the same as a checkpointer?
A checkpointer is one way to build it. It saves the agent's state at chosen points so a run can be resumed later. Whether that state survives a restart depends on where it is stored: an in-memory checkpointer does not, a database-backed one does.
Related
Back to Glossary
