Skip to main content
All posts
AI & Data19 min read

Durable Execution for AI Agents: Temporal vs Dapr vs Azure

Temporal, Dapr Workflow or Azure Durable Functions? We compare durable execution for AI agents: checkpoints, retries, human-approval waits and limits.

Published Updated: 15 November 2026

On 31 March 2026, Microsoft announced that the Consumption SKU of its Durable Task Scheduler had reached general availability, pitched at developers who want to "run durable workflows and agents on Azure". Eight days earlier, at KubeCon Europe in Amsterdam, the CNCF had declared Dapr Agents 1.0 generally available, with every agent invocation running as a durable workflow. In May, Temporal used its Replay conference to make its OpenAI Agents SDK integration generally available. Three ecosystems, one message in about six weeks: an agent that cannot survive a crash is a demo.

Production agents are long-running programs that call slow, expensive and flaky things: models, tools and people. A loop of LLM and tool calls will meet a deployment, a rate limit or a pod eviction sooner or later. An agent that waits two days for an approval will meet all three. This article is for the people who pick the engine underneath: CTOs, platform leads and architects. We compare Temporal, Dapr Workflow and Azure Durable Functions on the mechanics that matter for agents, show where each runs out of road, and give you a decision table for your next architecture review.

TL;DR / Key takeaways

  • Durable execution is now table stakes for agents. All three engines checkpoint every LLM and tool call, retry with backoff, park on durable timers and wait for humans without burning compute. The differences sit at the edges.
  • Pick by platform, not by feature list. Temporal is the strongest general-purpose engine. Dapr Workflow fits Kubernetes teams who want to self-host. Durable Functions with the Durable Task Scheduler fits Azure-first .NET and Python teams.
  • Human-approval waits are where designs fail. Use an external event raced against a durable timer, and make the timeout branch reject or escalate, never approve.
  • Limits bite long conversations. Payload ceilings range from 1 MB to 4 MB per step, and a durable agent session on Azure stores the whole conversation in 1 MB. Pass references, not documents.
  • Side effects need idempotency keys. Durable execution guarantees a step's result is recorded once. It does not stop a tool from sending the same e-mail twice if the activity fails after the send.
Agent step graph on a durable engine. Purple = control flow, blue dotted = calls to the outside world, warm = human waits and failure paths, green = checkpoints. Numbers 1–8 match the sections below.
Agent step graph on a durable engine. Purple = control flow, blue dotted = calls to the outside world, warm = human waits and failure paths, green = checkpoints. Numbers 1–8 match the sections below.

Download: Editable draw.io file · Open in diagrams.net · Chart data (CSV)

Why this matters now

Two numbers frame the problem. Gartner predicted in June 2025 that more than 40% of agentic AI projects will be cancelled by the end of 2027, citing escalating costs, unclear business value and inadequate risk controls. Two of those three are partly engineering problems. An agent that restarts from scratch after every failure pays for the same tokens twice. An agent with no reliable approval gate has no risk control worth the name.

The second number is adoption. Temporal's Series D announcement in February 2026 ($300 million at a $5 billion valuation) claimed 1.86 trillion lifetime action executions on Temporal Cloud from AI-native companies, and named OpenAI, Replit and Lovable as users building agents on it. On the Microsoft side, InfoQ reported in June 2026 that Copilot engineering teams had standardised on the Durable Task Scheduler, and that the system runs hundreds of millions of executions a week. These are vendor figures, so read them as direction, not proof. The direction is clear, though: the teams that ship agents at scale have stopped writing their own state machines on top of queues and databases.

The 2026 releases also closed most of the old gaps: Worker Versioning and task-queue fairness went GA in Temporal; Dapr shipped workflow versioning (1.17), access policies and signed history (1.18) and cross-app workflow management (1.19); Microsoft added a Durable Task extension for Agent Framework. If you evaluated these engines in 2024, your notes are out of date.

The agent step graph, step by step

The hero diagram shows one agent run as a step graph. It is engine-neutral on purpose. The numbers match the callouts.

① Deterministic orchestrator, non-deterministic activities

Every durable engine splits your code in two. The orchestrator (Temporal calls it a Workflow, Dapr a workflow, Durable Functions an orchestrator function) decides what happens next. It must be deterministic, because the engine rebuilds its state by replaying it against the recorded history. Activities do everything else: call the model, call a tool, read the clock, generate an ID.

For agents, the model call is an activity. The loop that decides whether to call the model again can live in the orchestrator, because it only reads recorded results. Start each run with an instance ID derived from the business key, such as the ticket number, so a duplicate trigger finds the existing run instead of starting a second one. Dapr 1.19 made this explicit: scheduling an instance ID that is already active returns AlreadyExists, which a client can treat as "already running".

② Checkpoint every LLM and tool call

When an activity completes, its result is appended to the history. That is the checkpoint. If the worker dies after step 2, the replacement replays the history, gets the recorded LLM answer back without calling the model, and continues at step 3. Microsoft's documentation puts the benefit plainly: completed LLM calls are not repeated, which preserves both token spend and wall-clock time.

The trade-off is size: everything passed into or out of an activity lands in the history. More on that in the data section.

③ Retries with backoff, and when not to retry

Rate limits (HTTP 429), timeouts and transient 5xx errors from model APIs are the normal case, not the exception. All three engines support retry policies with exponential backoff per activity. The defaults differ, and they matter. Temporal retries activities with no maximum attempt count unless you set one. Durable Functions and Dapr retry only when you pass a retry policy.

For agents, cap the attempts on LLM activities and mark validation failures as non-retryable. A model that returns malformed JSON five times will do it a sixth time. Retrying will not fix that, but feeding the error back into the next turn might.

④ A policy gate decides when a human is needed

Not every tool call needs approval. Put an explicit, deterministic gate in the orchestrator: risky action types, amounts above a threshold, external recipients, production writes. Keep the policy out of the prompt. A model can be persuaded to skip a step in its own plan. Your orchestrator code cannot. We cover gate design in depth in our guide to HITL approval gates for autonomous agents.

⑤ Human-approval waits: an event raced against a timer

This pattern separates durable engines from queue-plus-database designs. The orchestrator sends the approval request as an activity, such as a Teams card, then waits for whichever comes first: the decision event or a durable timer. While it waits, nothing runs. A three-day wait costs no compute.

Python
# Temporal (Python SDK): wait for a decision signal or time out after 48 hours
await workflow.execute_activity(send_approval_request, plan,
    start_to_close_timeout=timedelta(minutes=2))
try:
    await workflow.wait_condition(lambda: self.decision is not None,
                                  timeout=timedelta(hours=48))
except asyncio.TimeoutError:
    return await self.escalate_or_reject(plan)   # never auto-approve
Csharp
// Durable Functions (C#): the same race with an external event and a durable timer
using var cts = new CancellationTokenSource();
Task<bool> decision = context.WaitForExternalEvent<bool>("Approval");
Task timeout = context.CreateTimer(context.CurrentUtcDateTime.AddHours(48), cts.Token);
if (await Task.WhenAny(decision, timeout) == decision) { cts.Cancel(); /* act on decision.Result */ }
else { /* escalate or reject */ }

The engines differ in how the decision arrives. Temporal offers fire-and-forget Signals and synchronous Updates, where the approver's client gets a result back and a validator can reject a malformed decision before it enters the history. Dapr and Durable Functions use raised external events, which are fire-and-forget. Dapr 1.19 added Select to the Go SDK for "approve, reject or timeout, whichever comes first" without adding history entries.

Loading diagram...

⑥ Side effects need idempotency keys

Durable execution guarantees that a step's result is recorded once. It cannot guarantee that the outside world saw the call once. If an activity sends a payment, then crashes before reporting completion, the engine will run it again. Give every side-effecting activity an idempotency key built from the run ID and the step, and make the receiving system honour it. Where the target system has no idempotency support, add a lookup activity first: "did we already create this ticket?" Compensation after a rejection is ordinary code in all three engines, not a built-in saga feature.

⑦ Crash, replay, resume

When a worker dies, a healthy one replays the history and resumes at the first unfinished step. Replay is not free: Dapr's 1.19 release notes describe long-running instances that spent most of each turn re-sending and re-parsing their full history, fixed with history caching. Temporal Cloud warns at 10,240 events and stops at 51,200. Long agent loops should use continue-as-new, which starts a fresh run carrying a summary of the old one, well before those limits. Temporal and the Durable Task framework both support it under that name.

⑧ Versioning in-flight runs

An agent waiting three days for approval will outlive at least one deployment. If the new orchestrator code takes a different path through the recorded history, replay fails with a non-determinism error. All three engines now ship an answer. Temporal Worker Versioning (generally available since May 2026) pins each run to the worker version that started it. Dapr introduced workflow versioning in 1.17. Durable Functions and the Durable Task SDKs offer orchestration versioning, where each instance is stamped with a version and newer workers keep old code paths. Pick one approach before the first production deployment, not after the first stuck run.

What the numbers say

Feature matrix for durable execution engines and AI agents, November 2026
Feature matrix for durable execution engines and AI agents, November 2026

This heat grid is our assessment of vendor documentation and release notes on 15 November 2026, not a benchmark. Three readings stand out.

First, the top four rows are solid green for all three engines. Checkpointing, retries, durable timers and approval waits no longer differentiate, so a pitch that leads with them is selling 2023's problem.

Second, the differences sit in operations. Temporal leads on managed multi-region failover (a 20-minute recovery time objective in Temporal Cloud), tenant fairness and validated input through Updates. Dapr leads on running anywhere with your own state store, plus access policies and signed history. Durable Functions leads on Azure integration: Entra ID without access keys, private endpoints, a managed dashboard.

Third, the only rows where no engine is fully native are token streaming and large payloads: exactly what agents do that classic workflows did not.

Inline payload ceilings per step and per durable agent session
Inline payload ceilings per step and per durable agent session

Show this chart to your developers before they write the first activity. A step can carry 4 MB on Dapr's default sidecar settings, 2 MB on Temporal Cloud and 1 MB on the Durable Task Scheduler. The warm bar is the surprise: Microsoft documents that a durable agent session stores the entire conversation as entity state, capped at 1 MB. A long conversation with verbose tool results will reach that, and compaction is your job. Offloading to blob storage is preview, opt-in or do-it-yourself on all three platforms, so design for references from day one.

In a recent engagement…

This year we reviewed a claims-triage agent for a European financial services firm. It was built the way most first agents are: a queue, a worker and a database table holding "where we are". It worked in the demo. In production, three things went wrong, and none of them was the model.

Rolling deployments killed workers mid-run, and the restarted worker began the claim again, re-ran the LLM calls and twice sent the same acknowledgement e-mail. The approval step was a polling loop that kept a worker busy for days. And nobody could answer the auditor's question, "who approved this payout, and what did the agent propose at that moment?", without stitching together three log sources.

The team was a .NET shop on Azure, so we moved the orchestration to Durable Functions with the Durable Task Scheduler and kept the agent logic. LLM and tool calls became activities. The polling loop became an external event raced against a 48-hour timer, escalating to a second approver on timeout. The e-mail and payout activities got idempotency keys. The history now answers the auditor directly. The hard part was not the engine. It was agreeing which actions count as "risky".

The decision table

This is the screenshot-able part. Where two answers fit, the team's existing platform should break the tie.

If your situation is…Lean towardsWhy
Azure-first, .NET or Python, Microsoft Agent FrameworkDurable Functions + Durable Task SchedulerTurnkey durable agents, Entra ID and RBAC, private endpoints, scale-to-zero on Flex Consumption
Polyglot teams, several clouds, highest scale, managed service wantedTemporal CloudBroadest SDK set, multi-region replication, fairness, OpenAI Agents SDK and Google ADK integrations
Kubernetes platform already running Dapr, must self-hostDapr Workflow (+ Dapr Agents for Python)Runs on your cluster with your state store; access policies and signed history built in
Strict sovereignty, no third-party control plane at allTemporal self-hosted or DaprBoth are open source (MIT, Apache-2.0); the Durable Task Scheduler is Azure-only
Approvers need instant, validated confirmationTemporalUpdates return a result and support validators; external events elsewhere are fire-and-forget
Token streaming to a UI from inside the runAny, with a side channelTemporal Workflow Streams is in preview; Azure documents Redis Streams callbacks; otherwise use pub/sub
Very long conversations with large tool outputsAny, with references and compaction1–4 MB per step everywhere; store payloads in blob storage, summarise and continue-as-new

Two options sit outside the table. AWS launched Lambda durable functions at re:Invent 2025, with checkpoints and callbacks for human approvals; on AWS, evaluate it alongside Temporal. And agent frameworks ship their own checkpointers, which persist state but give you no durable timers or managed history. That is why the engines now integrate with the frameworks. Our workflows vs agents decision framework helps decide how much of the flow should be deterministic in the first place.

Governance for European enterprises

EU AI Act. The regulation prescribes no engine. For high-risk systems, though, Article 12 requires automatic recording of events and Article 14 effective human oversight, including the ability to intervene and stop. A durable history with an explicit approval gate produces that evidence as a by-product. Regulation (EU) 2026/1744, in force since 27 July 2026, deferred the Annex III high-risk obligations to 2 December 2027. Use the time to build the gate properly. Most Article 50 transparency duties were not deferred and have applied since 2 August 2026.

GDPR. Event histories store prompts, retrieved records and model answers, often with personal data. Storage limitation and the right to erasure apply to the history too. Set retention deliberately. Temporal Cloud allows 1 to 90 days per namespace. The Durable Task Scheduler retains up to 90 days on the Dedicated SKU and 30 on Consumption. Dapr leaves purging to you, for example with dapr workflow purge. Note one documented gap: purging Durable Task Scheduler instances does not yet delete externalised large-payload blobs.

Data residency and DORA. Temporal Cloud offers EU regions in Frankfurt and Ireland on AWS (London too, outside the EU), plus Frankfurt on GCP, where new namespaces currently need an approved exception. The Durable Task Scheduler runs in most Azure regions, including EU ones. Self-hosted Temporal or Dapr keeps everything in your own estate. For DORA-regulated financial entities, a managed orchestration service that runs critical agent workflows is an ICT third-party service. It belongs in your register of information, with an exit plan that covers in-flight runs.

A pragmatic adoption path

  1. Week 1: find the hidden state machines. List every agent that keeps "where am I" in a database row, a queue message or memory. Those that wait for humans or outlive a deployment go first.
  2. Weeks 2–3: pick the engine with the platform team. Use the decision table. Run one realistic agent (model call, tool call, approval) end to end on the shortlisted engine, and kill workers mid-run on purpose.
  3. Weeks 4–6: build the guardrails into the template. Instance IDs from business keys, retry caps on LLM activities, idempotency keys on side effects, an approval gate raced against a timer, versioning switched on, and payloads passed by reference. Our agent memory and state architecture guide covers what belongs in the history and what belongs in a store.
  4. Month 2: observability and retention. Wire the engine's dashboard and OpenTelemetry into your monitoring, set retention per environment, and alert on history size well before the hard limits.
  5. Month 3: make it a platform capability. Offer the template through your internal platform so product teams get durable agents by default, as described in our enterprise agent platform reference architecture. Rehearse a deployment with runs in flight before calling it done.

The verdict

Durable execution is no longer a niche choice for payment workflows. In 2026 it became the sensible default for any agent that touches money, customers or production systems, and Temporal, Dapr and Microsoft converged on the same core: checkpointed activities, durable timers, approval events and versioned code.

So our advice is unglamorous. On Azure with Microsoft Agent Framework, use Durable Functions or the Durable Task SDKs with the Durable Task Scheduler, and design around the 1 MB limits from the start. For a polyglot, multi-cloud estate, or the most mature operations story, use Temporal, preferably Temporal Cloud in an EU region. On Kubernetes with Dapr in place and self-hosting required, Dapr Workflow is now a credible choice. Whichever you choose, the approval gate, the idempotency keys and the retention policy are your job. No engine writes them for you.

If you want a second pair of eyes on an agent design before it goes to production, our AI architecture team runs exactly this step-graph review as a short, fixed-scope engagement. You leave with the decision table filled in for your estate and a template your teams can reuse.

FAQ

What is durable execution for AI agents?

Durable execution means the runtime records every completed step, such as an LLM call, a tool call or an approval, in an append-only history. After a crash or redeployment, a new worker replays that history, skips finished steps and continues. Agents therefore never re-run paid LLM calls after a failure, and can wait days for a human without holding compute.

Should we choose Temporal, Dapr Workflow or Azure Durable Functions for AI agents?

Choose by platform and team, because all three now cover checkpointing, retries, durable timers and approval waits. Temporal is the strongest general-purpose engine, with a managed cloud in EU regions. Dapr Workflow fits Kubernetes teams that self-host with their own state store. Durable Functions with the Durable Task Scheduler suits Azure-first .NET or Python teams using Microsoft Agent Framework.

How does a durable workflow wait days for a human approval?

The orchestrator sends an approval request as an activity, then waits for whichever comes first: an external event carrying the decision, or a durable timer such as 48 hours. Nothing runs while it waits. Temporal delivers the decision as a Signal or validated Update; Dapr and Durable Functions as a raised external event. The timeout branch should escalate or reject, never approve.

Do non-deterministic LLM calls break workflow replay?

Not if they live in activities. Orchestrator code is replayed, so it must be deterministic; LLM calls, tool calls, random numbers and clock reads belong in activities. Each activity result is stored in the history, so on replay the engine returns the recorded model answer instead of calling the model again. That is also why replay saves tokens.

What limits matter most when running agents on these engines?

Payload and history size. Temporal Cloud caps a payload at 2 MB and a history at 51,200 events or 50 MB. The Durable Task Scheduler caps inputs, outputs and events at 1 MB, and a durable Agent Framework session stores the whole conversation in 1 MB of entity state. Dapr's sidecar defaults to 4 MB. Pass references and summarise long loops.

Does the EU AI Act require durable execution for agents?

No, the AI Act does not prescribe a technology. But for high-risk systems, Article 12 requires automatic event logging and Article 14 requires effective human oversight, and a durable workflow history plus an explicit approval gate produce exactly that evidence. Annex III high-risk obligations now apply from 2 December 2027 after Regulation (EU) 2026/1744. GDPR applies today: event histories often contain prompts with personal data, so set retention and purge policies deliberately.

Sources

All sources checked on 15 November 2026. Product capabilities in this space change monthly; the feature matrix reflects documentation and release notes on that date.

Tier A: primary, vendor documentation and regulatory

Tier B: research and analysis

Tier C: vendor and news, directional

Topics

durable execution AI agentsTemporal vs Dapr WorkflowAzure Durable Functions AI agentsDurable Task SchedulerDapr Agentshuman-in-the-loop agent workflowlong-running AI agentsagent orchestration engine comparison

Frequently Asked Questions

Durable execution means the runtime records every completed step, such as an LLM call, a tool call or an approval, in an append-only history. After a crash or redeployment, a new worker replays that history, skips finished steps and continues. Agents therefore never re-run paid LLM calls after a failure, and can wait days for a human without holding compute.

Expert engagement

Need expert guidance?

Our team specializes in cloud architecture, security, AI platforms, and DevSecOps. Let's discuss how we can help your organization.

Get in touchNo commitment · No sales pressure

Related articles

All posts