Blog · · 11 min read
AI agent disaster recovery: recover stateful agents after a regional outage

AI agent disaster recovery fails when a team treats the agent like a stateless API. A regional outage can remove the runtime, checkpoint store, memory, release artifacts, credentials, callbacks, and tool receipts at once. Starting a copied checkpoint in another region may create a second executor or repeat a charge, message, ticket, or provisioning call whose first outcome is unknown.
Recover the workload through a controlled transaction. Declare the incident, block new starts, fence the failed region, restore one authoritative history and its dependencies, reconcile uncertain effects, resume only eligible runs, then prove the old region cannot execute. The result is a stateful agent that can continue without guessing which actions already happened.
Treat disaster recovery as a product transaction
A workflow engine, memory service, or database can provide regional replication without recovering the whole agent. Temporal Cloud explicitly warns that workers, infrastructure, and dependencies need their own reliability plan, even when a namespace can fail over. The same boundary applies to any agent runtime.
Model recovery as six ordered phases:
- Declare the incident and freeze admission.
- Fence every execution path in the old region.
- Restore one authoritative recovery set.
- Reconcile external effects with unknown outcomes.
- Resume, cancel, or escalate each active run.
- Verify the new region and test negative paths against the old one.
Advance only after each phase writes a durable receipt. The coordinator can retry the current phase, but a healthy-looking dashboard cannot authorize the next one. A restored checkpoint describes prior state. It does not authorize a new action.
Use one disaster record to coordinate the transaction. This schema is an implementation example, not a vendor requirement:
{
"incident_id": "regional-outage-2026-08-26",
"agent_release": "billing-assistant-v17",
"failed_region": "region-a",
"recovery_region": "region-b",
"declared_state": "fencing",
"admission_epoch": 43,
"authoritative_history": "workflow-store-replica-b",
"memory_watermark": "2026-08-26T10:14:20Z",
"policy_version": "policy-31",
"effect_receipt_watermark": "2026-08-26T10:14:18Z",
"run_dispositions": {
"resume": 18,
"reconcile": 4,
"cancel": 2
},
"required_checks": [
"old-region-write-denied",
"stale-scheduler-denied",
"duplicate-effect-probe-denied"
]
}
The admission_epoch is a monotonic generation number. Schedulers, workers, tool gateways, queue consumers, webhooks, and delegated agents must present the current epoch before starting or mutating work. Promotion increments it. A stale worker with a valid network route still fails the generation check.
Why regional failure is different
Ordinary process recovery usually assumes the durable services are still reachable. Regional recovery cannot. Several data classes may have different replication behavior and recovery points:
- Workflow checkpoints may be current enough to resume a thread but omit a tool completion that had not reached the history store.
- Long-term memory may replicate asynchronously while short-term events use a separate path.
- Product data may be globally available while an agent-specific effect ledger remains regional.
- A release manifest may exist in both regions while its policy bundle, model route, or tool schema does not.
- A webhook provider may retry against both old and new endpoints during DNS or routing changes.
- A payment or ticket API may have committed a write even though the agent never received its response.
LangGraph distinguishes thread checkpoints from cross-thread stores. Recovering one does not prove that the other has the same recovery point. Its production guidance also recommends persistent checkpointers rather than in-memory storage for fault tolerance.
The AWS Labs cross-region AgentCore memory sample makes the split concrete. It dual-writes short-term events, streams extracted long-term records through a separate path, skips repeated extraction in the target, and uses a source record ID as an idempotent request identifier. The sample also states that long-term-memory RPO includes extraction time plus stream and consumer lag. Memory can therefore be internally consistent and still be behind workflow history or product data.
An open AWS Labs AgentCore issue reports that runtime failover still needs health detection and a routing layer. Treat it as a practitioner report rather than a product guarantee. The reported gap sits outside the replicated memory example.
Set RTO and RPO for each dependency
AWS Well-Architected separates disaster recovery from ordinary availability. Availability focuses on components, while disaster recovery focuses on copies of the entire workload and time to recovery. It recommends business-defined recovery time and recovery point objectives, tested recovery, drift management, and automation.
Do not assign one RTO and RPO to "the agent." Inventory the dependencies and give each one an objective and a recovery method.
| Dependency | Recovery-point question | Recovery-time question | Required evidence |
|---|---|---|---|
| Workflow history | What is the latest replicated event and active branch? | When can one region safely mutate it? | History watermark and writer fence |
| Short-term state | Which conversation turns and approvals are present? | When can the run reconstruct its current state? | Checkpoint manifest and object versions |
| Long-term memory | Which records and deletions reached the replica? | When is retrieval safe for resumed runs? | Replication watermark and parity check |
| Effect ledger | Which external calls have receipts or known postconditions? | When can uncertain calls be reconciled? | Idempotency keys, receipts, and lookup results |
| Release bundle | Are prompt, model, tool, policy, and runtime versions available? | When can the exact release start? | Signed release manifest and dependency hashes |
| Admission paths | Which routes can start or resume work? | When can stale routes be denied? | Epoch acknowledgements from every path |
The strictest business effect usually controls the design. A support summarization agent may tolerate several minutes of missing memory. An order or payment agent cannot treat a missing receipt as permission to execute again.
Implement AI agent disaster recovery in six phases
1. Declare the incident and freeze admissions
Create one incident record and move the agent fleet into recovery_pending. Block new scheduled, event-triggered, user-initiated, delegated, and retry-driven starts. Let read-only inspection continue for responders.
Do not cancel every active run immediately. Some work may still complete in a healthy dependency or may have crossed an external commit boundary. Capture active run IDs, last durable checkpoints, pending tool calls, idempotency keys, approval states, budgets, and owning tenants before choosing a disposition.
The AgentCore resilience guide places service resilience in the context of AWS Regions and Availability Zones and notes that AgentCore has features supporting data resiliency and backup. That infrastructure context does not replace the application-level freeze. Your product still owns every route that can admit work.
2. Fence the old region
Promotion without fencing creates split brain. DNS changes are insufficient because old workers, queues, schedules, callbacks, or private clients may retain cached routes.
Increment the admission epoch in a control store available to both regions. Require the new epoch at these mutation boundaries:
- worker task claim
- workflow resume
- scheduler dispatch
- webhook consumption
- tool invocation
- credential issuance
- delegated-agent start
- approval submission
Stop or revoke old-region worker leases. Disable old schedulers and event subscriptions. Change queue ownership. Deny credential issuance for stale epochs. Reject callbacks signed for the previous regional endpoint when they can mutate state. Keep the agent blocked if any path cannot acknowledge the fence.
Temporal's self-hosted replication model illustrates the underlying rule. Namespace versions determine which cluster can mutate workflow history, and the highest version becomes authoritative during conflict resolution. Apply the same rule to other runtimes: one current generation owns writes, and stale generations fail closed.
3. Restore one authoritative recovery set
Choose one workflow history or checkpoint branch. Do not merge two mutable branches in application code. Bind that history to the exact agent release, policy version, tool schemas, model route, tenant configuration, and credential-broker policy that governed the run.
Restore in dependency order:
- Control state and the new admission epoch.
- Workflow history and active-run index.
- Product records required to validate postconditions.
- Effect receipts and idempotency records.
- Short-term and long-term memory.
- Release and policy bundles.
- Worker fleets, tool gateways, schedulers, and callbacks.
Record a watermark for each store. If memory is behind the authoritative workflow history, resumed runs should retrieve only up to the known memory watermark or rebuild missing context from trusted product records. Do not let the model infer the missing interval.
Asynchronous replication can roll progress back. Temporal's self-hosted documentation says an activity may be dispatched again after failover because of replication lag. That is a direct reason to keep tool side effects outside automatic replay unless their contract is retry-safe.
4. Reconcile unknown side effects
Classify every in-flight write before resuming its run:
committed: a signed receipt or authoritative product record proves success.not_committed: the target system proves the change did not occur.idempotent_retry_allowed: the target accepts the same stable key and returns the original result.compensation_required: the effect occurred, but the workflow can no longer continue safely.human_reconciliation_required: neither the agent nor target can prove the outcome.
Never turn unknown into not_committed. Query the external system by idempotency key, order ID, message ID, ticket key, or product postcondition. If no authoritative lookup exists, stop that run and show an operator the proposed effect, available evidence, customer impact, and safe options.
Replicated data can restore what the agent believed before the outage. It cannot prove what a remote system already did. That proof has to come from the target system, a receipt, or an operator.
5. Resume selectively
Assign each active run one explicit disposition:
- Resume when the authoritative history is intact, required dependencies meet their recovery points, every completed effect has a receipt, and the next action can use the new epoch.
- Restart from a business-level boundary only when prior effects are idempotent or fully compensated.
- Cancel when the request is stale, the relevant product object changed, the user withdrew authority, or the exact release cannot be restored.
- Escalate when an effect remains unknown, a pending approval refers to an old object version, or recovery would cross tenant or policy boundaries.
Issue fresh short-lived credentials after promotion. Do not copy cached tokens from the failed region. Rebind webhooks, notification routes, model endpoints, retrieval services, and tool gateways to the recovery region. Preserve the original run ID and incident link so support teams can trace the transition.
6. Verify the new region and negative paths
A healthy endpoint proves only that the new runtime responds. Verify both positive and negative invariants.
Positive checks should start one low-risk run under the current epoch and load a restored run with its intended release and history. Confirm that memory reads stop at the recorded watermark, every tool call writes a receipt, and operator dashboards show the incident and run disposition.
Negative checks should prove that:
- an old-region worker cannot claim or complete a task
- a stale scheduler cannot start a run
- a callback using the previous epoch cannot mutate state
- a second promotion with the old recovery version fails
- an uncertain external effect cannot enter the automatic retry path
- a passive-region worker cannot process work before promotion
- restored runs cannot load an unverified release or policy version
Keep admission blocked until every required negative check passes. A failed negative test means split-brain risk still exists.
Run disaster-recovery drills against real failure boundaries
AWS Well-Architected recommends testing the DR implementation, controlling configuration drift, and automating recovery. Test the agent-specific boundaries, not only database restoration.
Run at least these drills:
- Lose the runtime region after a tool commits but before its receipt reaches workflow history.
- Fail over while long-term memory replication is behind short-term events.
- Restore workflow history while the required policy or tool schema version is missing.
- Allow an old worker to reconnect after the new region becomes active.
- Deliver the same webhook to both regional consumers.
- Leave a human approval pending against a product object that changes during the outage.
- Simulate a recovery-region dependency failure halfway through promotion.
Measure time from declaration to admission freeze, old-region fence, authoritative-history selection, side-effect reconciliation, first safe resumed run, and final negative verification. Those intervals reveal whether the stated RTO is operational or merely a storage metric.
Temporal Cloud reports defined RPO and RTO targets for its high-availability namespace, but its documentation still calls out customer workers and external storage as separate concerns. Use provider objectives as inputs to your plan, not as the RTO for the complete product agent.
Common mistakes
Checkpoint replication alone leaves memory, effect receipts, releases, policies, and admission routes outside the plan. Two live worker pools create split brain when neither is fenced. A DNS change still leaves cached routes and direct queue consumers. An incomplete workflow step does not prove that its external effect failed, so automatic replay may repeat it. Recovery must also restore the original release rather than the newest prompt. One healthy request cannot detect stale workers and callbacks that can still write.
Keep execution active-passive until tool contracts support concurrent writers. Both regions may serve reads, but simultaneous execution needs a conflict model for workflow history, product state, approvals, budgets, and every external side effect. Explicit promotion is the safer starting point.
Start with one side-effecting workflow
Pick one agent workflow that writes to an external system. Create its dependency table, record separate RTO and RPO values, add a monotonic admission epoch to every mutation path, and make unknown a first-class effect outcome. Then run a drill that fails the primary region after the external write but before the local receipt persists.
An AI agent disaster recovery plan is ready when the agent can do more than restart. Release it only when one authoritative history resumes in the target region, every uncertain effect has a disposition, and deterministic tests prove the old region cannot act.
References
- AWS Well-Architected: Plan for disaster recovery supports workload-level RTO and RPO, recovery testing, configuration-drift control, and automation.
- Amazon Bedrock AgentCore: Resilience provides the official regional and Availability Zone resilience context plus AgentCore's data-resiliency and backup position.
- AWS Labs AgentCore cross-region memory replication supports the separate short-term and long-term memory paths, idempotent replication, failover procedure, and RPO limitation.
- LangGraph persistence supports the distinction between thread checkpoints, persistent checkpointers, and cross-thread stores.
- Temporal Cloud high availability supports multi-region workflow replication, failover behavior, recovery objectives, and the need to recover workers and external dependencies separately.
- Temporal self-hosted multi-cluster replication supports asynchronous history replication, failover versions, conflict resolution, active-writer control, and activity redispatch risk.
- AWS Labs AgentCore runtime failover request is a practitioner report about the need for runtime health detection and failover routing beyond memory replication.