
Some agent tasks take longer than a single request. A workflow may wait for a person to approve a draft, call an unreliable service or resume after a server restart. Durable execution is a way to record enough workflow progress for the system to continue after interruptions rather than starting the whole task again.
Durability is about recovery, not guaranteed success. The application still needs to decide what should be retried, what requires review and how to handle an operation whose result is unknown. Those choices matter most when an agent changes an external system.
Save Progress At Meaningful Boundaries
A durable workflow records state or history as the task moves through its steps. If a worker stops, another worker can recover the workflow and continue according to the execution system's rules. Depending on the platform, completed work may be represented by recorded results or reconstructed through replay.

Consider a hypothetical workflow that collects information, prepares a report and waits for approval. If the process restarts during the wait, the workflow should retain the report and approval state instead of preparing a second version silently. After approval, it should continue with the approved version and record the outcome.
The Temporal workflow execution documentation describes one approach to durable workflow history and recovery. Exact guarantees vary by platform, so check the behavior of the system you use.
Retries Need A Clear Policy
A temporary network error may justify another attempt; an invalid request or denied permission usually needs a different response. Set a bounded retry policy with appropriate delays, record the number of attempts and define when a person should be notified. Do not let a failing operation loop indefinitely.
The difficult case is an uncertain outcome. Imagine an external service accepted a request, but the response was lost. Retrying immediately might create a duplicate. Before repeating a side effect, check the destination for the existing result or use a supported idempotency key. The key must represent the same logical operation across attempts, and the receiving system must actually honor it.
Not every integration supports idempotency or reliable lookup. In those cases, pause and reconcile the uncertain state instead of claiming the operation failed or succeeded. Record what is known, what is unknown and what a reviewer needs to check.
Keep State Useful And Appropriate
Save the task inputs, relevant versions, completed step results and approval decisions needed to resume. Avoid retaining full sensitive documents or credentials when a reference will do. Set access and retention rules for workflow history, and decide what happens if a referenced file is changed or deleted while the task is waiting.
Long waits also mean the world can change. A price, permission or target record that was valid at the beginning may no longer be valid at execution time. Revalidate important assumptions before a consequential action, especially after a human approval or an extended pause.
Test Recovery Before Depending On It
Interrupt the workflow after a completed read, during a tool call and after an external action with a missing response. Verify that it resumes at the right point, avoids duplicate effects and reports uncertainty honestly. Test cancellation and expired approvals as well as the successful path.
Pair durable execution with agent observability, so a team can follow the history and identify where a run is waiting or failed. The result is a workflow that can recover deliberately and make its limits visible.

