Unico Connect
AI agents in production and durable execution, with the Temporal and Pydantic logos and a workflow resuming from a checkpoint
Back to Blog
AI AgentsSeptember 22, 202617 min read

What Breaks When AI Agents Run in Production, and How Durable Execution Fixes It

Vasim Gujrati

Vasim Gujrati

Solutions Architect, AI & Platforms, Unico Connect

In this article

Most AI agent demos run for a few minutes on a stable network with nobody else touching the system. Production is different. Tasks run for hours or days, external APIs time out, servers restart, a person takes two days to approve a step, and the same tool call sometimes runs twice. In April 2026 the Thoughtworks Technology Radar placed ignoring durability in agent workflows in its Caution ring, describing it as an anti pattern seen across many teams that produces systems which work in development but fail in production. This guide covers what actually breaks when agents run for real, what durable execution is, which tools provide it in 2026, and a checklist for deciding whether an agent is ready. Sources were checked on 22 September 2026.

Quick Answer

AI agents fail in production because they run for hours or days, make many external calls, and wait on people, so a crash, timeout, or restart can lose progress or repeat an action. Durable execution records every step and tool call so a run resumes after a failure, and suspends safely while it waits for approval. Thoughtworks advises starting with the durability built into agent frameworks such as LangGraph and Pydantic AI and moving to a platform such as Temporal as workflows become more critical or complex.

Key Takeaways

  • Short agent tasks can tolerate a failure and a restart. Workflows that run for days or weeks cannot, which is why Thoughtworks lists ignoring durability as a Caution item.
  • Retries are dangerous without idempotency. If a step that sends an email or issues a refund can run twice, a retry after a timeout can do it twice.
  • Durability is not storage. Saving a chat history lets you continue a conversation, but only durable execution keeps one run alive across crashes and restarts.
  • Pydantic AI supports seven durable execution engines, LangGraph provides checkpointers with retries and timeouts, and Temporal recommends that every activity be idempotent.
  • Treat cost and observability as part of reliability. Unbounded retries and loops are a failure mode, and so is an agent whose decisions you cannot reconstruct.

Why Do AI Agents Fail Differently From Normal Software?

The stakes are real. In June 2025 Gartner predicted that over 40 percent of agentic AI projects will be canceled by the end of 2027, due to escalating costs, unclear business value, or inadequate risk controls. Demand for long running agents keeps growing too. When Temporal announced a $550M Series E at a $12.55B valuation on 14 September 2026, it said customers are asking to run agents that work for days, weeks, or months.

Thoughtworks puts it plainly. The challenges facing distributed systems are even more pronounced when building with agents. Four properties make agents harder than a typical web request.

  1. They run long. A research, coding, or operations task can take hours, and some workflows span days while they wait for approvals or external events.
  2. They make many external calls. Every step calls a model and often several tools, each of which can fail from network interruptions or server crashes.
  3. They are not deterministic. The same input can produce a different plan, so you cannot simply rerun from the start and expect the same path.
  4. They wait on people. Human approval steps can take minutes or days, and a process that holds state in memory while it waits will eventually lose it.

What Breaks When Agents Run in Production

Failure modeSymptomFix
Lost progressA crash or deploy mid task, and the agent restarts from zero or not at allCheckpointing each step with durable execution
Duplicate side effectsA retry after a timeout sends the email or charges the card twiceIdempotent tool calls with idempotency keys
Stalled approvalsA workflow waiting on a person times out or loses its placeDurable waits that suspend and resume on input
Runaway costRetries, loops, or subagents keep calling models after the task should stopStep, token, and cost budgets per task
Context overflowLong runs fill the context window and reasoning degradesCompaction, subagents, and summarized memory
Silent tool driftAn API changes and the agent keeps sending the old shapeContract tests and typed tool definitions
Conflicting parallel workSeveral agents edit the same files or records at onceA shared work ledger and a merge step
Undebuggable decisionsNobody can see which step, tool, or input caused a failureTracing of every model call, tool call, and decision
Over privileged accessAn agent calls payment or customer systems with a shared static key, so nobody can say which agent did whatScoped credentials per agent and an audit log of every action

Most of these are ordinary distributed systems problems. What changes with agents is how often they happen, because a single task can involve dozens of calls, and how costly they are, because each retry spends model tokens. Our guide to AI agent security and prompt injection covers the security side in depth.

What Is Durable Execution?

Durable execution is a way of running a workflow so that its progress survives failures. Thoughtworks describes it as stateful persistence of progress and tool calls, enabling agents to resume tasks after failures, and notes that for workflows with a human in the loop it can suspend progress while awaiting input. The engine records what each step did, so after a crash it can replay or skip completed steps and continue from the last one, rather than starting over.

Pydantic AI draws a distinction worth keeping in mind. A durable engine keeps one run alive across crashes and restarts. It does not store your chat threads. Saving a conversation so a user can come back to it later is a different, lighter problem, and teams that confuse the two often build one while believing they have the other.

Which Tools Provide Durable Execution for AI Agents in 2026?

OptionWhat it providesBest for
LangGraphCheckpointers that persist graph state per thread, retry policies, per node timeouts, node error handlers, and graceful shutdownGraph based agents where framework native durability is enough
Pydantic AIDurable agents with streaming and MCP support, running on Temporal, DBOS, Prefect, Restate, or AWS Lambda, plus Kitaru and Apache Airflow integrationsPython agents that need to plug into an existing workflow engine
TemporalA standalone durable execution platform with integrations for the OpenAI Agents SDK, Pydantic AI, Google ADK, Mastra, and Strands Agents, plus a LangGraph plugin for Python in Public Preview since July 2026Critical or complex workflows that need a dedicated platform
Restate and GolemDurable computing platforms named by Thoughtworks with support for agentsTeams evaluating alternatives to Temporal
OpenAI Agents APIManaged durable sessions with recovery, resumption, and automatic context compaction, in public beta since 10 September 2026Teams happy for OpenAI to run the harness, within its United States only data residency and no Zero Data Retention
AWS Lambda durable functionsCheckpointed steps with built in retries, and waits that suspend without compute charges, for runs of up to one yearTeams building on AWS
Microsoft Agent Framework Durable ExtensionPersistent agent sessions and orchestrations, with waits for human input that use no compute or model tokens, in C# and Python, currently in prerelease packagesTeams on Azure or .NET
Vercel WorkflowsSteps that retry, survive crashes and deployments, and pause for minutes or months, built on the open source Workflow SDK and the Vercel Python SDKJavaScript, TypeScript, or Python agents on Vercel
Cloudflare Agents with WorkflowsAgent state in a built in SQL database, plus Workflows with step level persistence, automatic retries, and waits of days for approvalsAgents hosted on Cloudflare

On the Radar itself, LangGraph was placed in Trial in April 2026 and Pydantic AI in Trial in November 2025, while Temporal, Restate, and Golem sit in Assess, last placed in March 2022, November 2025, and October 2024.

Thoughtworks gives a simple rule for choosing. Start with the native durable execution support in your agent framework, and reach for a standalone platform as workflows become more critical or complex.

The choice is not always either or. In July 2026 Temporal released a LangGraph integration for Python in Public Preview, so an existing LangGraph agent can run on Temporal without a rewrite and gain automatic failure recovery and approval steps that can wait for days. Temporal argues that a LangGraph checkpoint preserves your data but not your execution, because something still has to detect a failed run and restart it.

Cost is part of the decision. Temporal Cloud has no base monthly fee. It bills $50 per million actions for the first 5 million each month, plus storage and a support charge of 10 percent of usage, and new accounts get $150 in credits that expire after 90 days. Its Business plan starts at $500 a month.

A few details matter in practice. When you attach a retry policy to a node, LangGraph defaults to three attempts, starting half a second apart and doubling each time up to 128 seconds with jitter, and it does not retry common programming errors such as ValueError or TypeError. Nodes without a retry policy are not retried. Its per node timeouts and error handlers need LangGraph 1.2 or later, and timeouts apply only to async nodes. And its in memory checkpointer does not survive a restart, so production systems need a persistent checkpointer such as Postgres.

LangGraph also lets you choose when checkpoints are written. Exit mode saves only when a run ends, which performs best but cannot recover from a process crash partway through a run. Async mode saves while the next step runs, with a small risk of a lost checkpoint if the process crashes, and sync mode saves before each next step starts, which is the most durable. Agents that must survive a crash partway through a run should use async or sync.

How Do You Design an AI Agent for Durable Execution?

  1. Make every side effecting tool idempotent. Temporal recommends that activities be idempotent, meaning running them twice has the same effect as running them once. Use idempotency keys for payments, messages, and record creation.
  2. Separate orchestration from model calls. Keep the control flow deterministic and treat each model call and tool call as a recorded step, which is the pattern the Temporal examples use.
  3. Checkpoint after every meaningful step. The unit of recovery should be small enough that repeating one step is cheap.
  4. Set timeouts and retry policies per tool. Retry transient network and server errors with backoff, and fail fast on errors a retry will not fix.
  5. Budget every task. Cap steps, tokens, and spend per task, and stop with a clear status when a cap is hit. Our guide to AI agent development cost covers how model costs factor into an agent budget.
  6. Model human approval as a durable wait. The workflow should suspend, survive restarts, and resume when the approval arrives. See our guide to human approval flows.
  7. Version prompts, tools, and workflows. A task that started under one version should finish under it, or migrate deliberately.
  8. Trace everything. Record every model call, tool call, input, and decision so a failure can be reconstructed. Thoughtworks notes that built in observability of tool execution and decision tracking makes debugging far easier. Our guide to AI observability for LLM apps covers the tooling.

Other Agent Practices Thoughtworks Flags for Caution

Durability is one of several agent practices in the April 2026 Caution ring, and the others fail in related ways.

  • MCP by default. Thoughtworks warns against reaching for the Model Context Protocol as the default integration layer, describing an abstraction tax that loses fidelity with complex APIs, and notes that a well designed CLI with structured JSON output is often enough. MCP still earns its place for structured tool contracts, OAuth boundaries, and governed multi tenant access. Our guide to MCP in production covers those cases in depth.
  • Coding agent swarms. Applying dozens or hundreds of coding agents to one problem remains costly and immature, and the showcase experiments relied on detailed specifications and, in one case, comprehensive test suites that typical product work lacks. The patterns emerging from them, such as a durable work ledger and a merge step, apply to any parallel agent system.

Is Your Agent Ready for Production?

QuestionWhy it matters
If the process crashes halfway, does the task resume from the last completed step?Without this, every deploy or crash loses work
Can every tool that changes something run twice safely?Retries are only safe when side effects are idempotent
Does a pending human approval survive a restart?Approvals can take days
Is there a hard cap on steps, tokens, and cost per task?Loops and retries are the most expensive failures
Can you reconstruct every decision and tool call for a given task?Debugging and audits depend on it
Do tool contracts have tests that fail when an API changes?Drift is silent until results go wrong
Is there a defined behavior when a model or tool is unavailable?Outages will happen during long runs

If the answer to any of these is no, the agent may work in a demo and still fail in production.

How Unico Connect Helps

We build production AI agents with durability designed in, choosing between framework native checkpointing, a platform such as Temporal, or a managed runtime based on how critical and how long running the workflow is. For example, the AI ticket triage agents we build automate about 75 percent of ticket classification and routing, log every routing decision with its confidence score, and send genuinely ambiguous tickets to a person instead of guessing. Our agentic AI development team handles idempotent tool design, approval flows, cost limits, and tracing, and our AI development services cover the models and retrieval behind them. If you are staffing the build, you can hire LangChain developers with LangGraph experience or hire AI engineers, with vetted candidates within a week. For related reading, see our guides to context engineering for production AI and the OpenAI Agents API, or talk to our team.

Frequently Asked Questions

Why do AI agents fail in production when they worked in testing?

Because production adds long running tasks, unreliable external calls, restarts, and human waits that a demo rarely hits. Without durable execution, a failure halfway through loses progress or repeats actions, which is why Thoughtworks lists ignoring durability in agent workflows in its Caution ring.

What is durable execution for AI agents?

Durable execution saves the progress of every step and tool call in an agent workflow, so the agent can resume after a crash or restart instead of starting again. It can also suspend a workflow while it waits for human input and continue when the input arrives.

Is durable execution the same as saving chat history?

No. Saving chat history lets a user continue a conversation later. Durable execution keeps a single run alive across crashes and restarts, recording which steps completed. Pydantic AI sums it up in its documentation as "Durability is not storage."

Which tools provide durable execution for agents?

Agent frameworks such as LangGraph and Pydantic AI include durable execution, and Pydantic AI can run on Temporal, DBOS, Prefect, Restate, or AWS Lambda. Standalone platforms include Temporal, Restate, and Golem, the OpenAI Agents API offers managed durable sessions, and cloud providers offer their own, including AWS Lambda durable functions, the Microsoft Agent Framework Durable Extension, Vercel Workflows, and Cloudflare Workflows.

Why do agent tool calls need to be idempotent?

Because durable systems retry steps after failures, and a step that timed out may already have completed. If the tool sends a message, charges a payment, or creates a record, it must be safe to run twice, which usually means using an idempotency key.

Should we use Temporal or our agent framework for durability?

Thoughtworks advises starting with the native durable execution support in your agent framework and moving to a standalone platform such as Temporal as workflows become more critical or complex. Temporal integrates with the OpenAI Agents SDK, Pydantic AI, the AI SDK by Vercel, and Google ADK, and it can also run existing LangGraph agents.

Can you run LangGraph agents on Temporal?

Yes. Since July 2026 Temporal offers a LangGraph integration for Python in Public Preview, so an existing LangGraph agent can run on Temporal without a rewrite and gain automatic failure recovery and approval steps that can wait for days.

How much does durable execution cost for AI agents?

LangGraph checkpointers save state to a database you run, such as Postgres. Temporal Cloud has no base monthly fee and bills $50 per million actions for the first 5 million each month, plus storage and a 10 percent support charge, with $150 in credits for new accounts that expire after 90 days and a Business plan from $500 a month. Prices were read on 22 September 2026.

What does the Caution ring mean on the Thoughtworks Technology Radar?

Caution is the ring where Thoughtworks places things the industry should consider alternatives to, or even avoid, because its teams have had negative experiences with them. Thoughtworks uses it from Volume 34, published in April 2026, and entries from earlier volumes, such as November 2025, still show the older Hold ring.

Sources

The Radar positions come from the Thoughtworks Technology Radar entries for ignoring durability in agent workflows, MCP by default, and coding agent swarms. Framework details come from the Pydantic AI durable execution overview, the LangGraph fault tolerance guide, and the LangGraph checkpointers guide.

Temporal guidance comes from its activity definition documentation, AI solutions page, LangGraph plugin announcement, pricing page, and Series E announcement. Cloud options come from the documentation for AWS Lambda durable functions, the Microsoft Agent Framework Durable Extension, Vercel Workflows, and Cloudflare Agents and Workflows.

OpenAI details come from the Agents API overview and the API changelog, and the cancellation forecast from the Gartner press release. All were read on 22 September 2026.

Keep reading

Latest Blogs & Articles

View all