Initiates the shipment tracking process
AI Models & Assistants / Knowledge library
Durable Agent Execution
Persists progress so a long-running agent can resume after pauses, failures, or restarts
Why learn Durable Agent Execution?
It supports agent tasks that outlive one request, process, machine, or human response time.
The problem it solves
It prevents transient infrastructure failures from forcing a long agent workflow to restart from the beginning.
Where it came from
Durable execution records enough state or event history to reconstruct progress. External actions need stable identifiers and idempotency because replaying orchestration must not duplicate payments, messages, or other side effects.
Build your understanding
Work through these exercises in order. Try the task before opening a reference.
- Define Durable Agent Execution and identify its place in an agent architecture.
- Choose a task where Durable Agent Execution improves an agent system.
- Diagnose one failure caused by misusing Durable Agent Execution.
- Interpret a trace or state transition involving Durable Agent Execution.
- Explain one operational tradeoff of Durable Agent Execution.
Documentation and sources
- Temporal: Durable Execution (docs.temporal.io)
Connect the ideas
Explore next
Real World Example
Automated Supply Chain Logistics Orchestrator
Global logistics providers managing multi-week freight shipments that require continuous coordination between disparate carrier APIs and customs clearance systems.
The business problem
Traditional agent scripts often fail during long-running processes due to transient network outages or server restarts, forcing the entire multi-day shipment tracking process to restart from the beginning, leading to data inconsistency and manual intervention.
How this topic solves it
By leveraging Temporal's Durable Execution, the logistics agent persists its state and progress in an Event History. If a worker process crashes or a network connection drops, the agent automatically resumes from the exact point of failure rather than restarting the entire workflow.
- Define the logistics workflow as a Temporal Workflow Function to encapsulate the multi-step shipment lifecycle.
- Deploy Worker Processes that host the agent code and connect to the Temporal Service.
- Initiate the workflow execution, which records every state transition into an immutable Event History.
- Configure the Temporal Service to monitor worker health and automatically re-schedule pending tasks upon detection of a failure.
- Verify that the agent resumes from the last successful checkpoint after a simulated system restart.
This diagram illustrates how the Temporal Service manages the agent state across potential failures.
Persistent record of state transitions
Executes the agent logic
Interruption point
Continues from last event
- Workflow Start → triggers → Worker Process
- Worker Process → records progress → Event History
- Worker Process → encounters → Failure/Restart
- Failure/Restart → queries state → Event History
- Event History → replays history → Resume Execution
Expected business outcome
The logistics agent maintains continuous operational integrity, ensuring that long-running shipment tracking workflows complete reliably without manual reconciliation or duplicate API calls.
Limitations and checks
The primary trade-off is the requirement for deterministic code execution. Developers must ensure that workflow logic remains deterministic, as the platform replays the Event History to reconstruct state; check this by ensuring no non-deterministic operations like random number generation or un-tracked system time are used inside the workflow function.