Skip to content
Darvi Lab. Logo
Engineering

Agentic Workflow Failure Modesand Design Patterns

Agentic workflow failure modes, measured: step repetition, missed termination and context rot, plus the patterns and gates that actually contain them.

Nov 19, 202611 min read
DarviLabs Team
Agentic Workflow Failure Modes and Design Patterns
01

The short answer

Agentic workflows do not fail in mysterious ways. They fail by repeating a step they already completed, by stopping before the work is done, by acting in a way that contradicts the reasoning they just produced, and by nobody checking the result. Those are engineering failures with engineering fixes, and the distribution has been measured rather than guessed.

So the order of work is not prompt refinement. Pick the weakest pattern that does the job, because an autonomous loop costs more and compounds more error than a fixed sequence of calls. Treat the context window as a budget rather than a container. Make the loop durable and the write-side tools idempotent, so a retry does not charge a customer twice. Put verification in its own step, with its own failure mode, instead of asking the actor to grade itself.

And measure the right thing. Average success on one attempt tells you almost nothing about whether a workflow can run unattended a hundred times a day. The number you want is how often it succeeds every time, which is much smaller than most teams expect.

02

The failure modes are catalogued, and step repetition leads

The most useful empirical work here is the paper Why Do Multi-Agent LLM Systems Fail, published on arXiv as 2503.13657, which produced MAST, the Multi-Agent System Failure Taxonomy. Its authors annotated more than two hundred conversation traces from seven popular open-source multi-agent frameworks using six expert annotators. Three of them reached a Cohen's kappa of 0.88, and the LLM-as-judge pipeline built on top reached 94 percent accuracy against human labels, with a kappa of 0.79 on unseen systems. It is not a vibe-based taxonomy.

The fourteen failure modes fall into three categories. Specification issues account for 41.77 percent of observed failures, inter-agent misalignment for 36.94 percent, and task verification for 21.30 percent. Read that twice: most agent failures happen before any reasoning-quality question arises. The system was told the wrong thing, or told it in a way that let the agent drift.

The individual modes are where the design work is. Step repetition is the single largest at 17.14 percent, followed by reasoning-action mismatch at 13.98 percent, failure to ask for clarification at 11.65 percent, disobeying the task specification at 10.98 percent, and being unaware of termination conditions at 9.82 percent. On the verification side, premature termination sits at 7.82 percent, absent or incomplete verification at 6.82 percent, and incorrect verification at 6.66 percent.

Map those onto familiar engineering problems and most of them stop looking novel. Step repetition is a missing idempotency key and a missing record of what already happened. Being unaware of termination conditions is a missing stopping predicate. Reasoning-action mismatch, where the model explains one plan and then calls a tool that does something else, is an argument for validating tool arguments against the stated intent rather than trusting the narration. Incorrect verification is a checker that was never tested against known-bad input.

The paper also tested the cheap fixes, and reported honestly on them. Prompt and role specification changes gained 9.4 percent in success rate on ChatDev, and adding a high-level verification step gained 15.6 percent in absolute terms on ProgramDev. Both are real gains, and the authors still concluded simple fixes are insufficient, because several failure modes survived them. Better prompts move the number; changes to organisation, communication and verification decide the ceiling.

03

Reliability is a different number from accuracy

The benchmark worth knowing is tau-bench, published as arXiv 2406.12045, because it introduced a metric that matches how agents are actually deployed. Alongside pass@k, which counts a task as solved if at least one of k trials succeeds, it reports pass^k: the probability that an agent succeeds on a task in all k independent trials. The first metric suits a developer who will retry by hand. The second suits a workflow that runs unattended.

The gap between them is the whole story. On the original paper's numbers, GPT-4o with function calling scored 61.2 percent average success on the retail domain and 35.2 percent on airline, for a 48.2 percent weighted average. On retail, pass^8 fell below 25 percent. An agent that gets it right three times in five on a single attempt is a very different proposition when it has to get it right eight times running.

Those figures are from 2024 and frontier models have moved since, so do not quote them as current capability. The shape is what transfers, and it is structural rather than model-specific: sampling introduces variance at every decision point, and requiring repeated success multiplies the chance of hitting a bad branch. Later versions of the benchmark post higher numbers, but the spread between one attempt and k attempts has not gone away.

The same arithmetic applies inside a single run. If a twenty-step workflow genuinely had an independent 95 percent chance of getting each step right, the chance of a clean run would be 0.95 to the twentieth power, roughly 36 percent. Real workflows violate that independence assumption in both directions, so treat it as an illustration rather than a prediction: step count is itself a reliability decision. Fewer steps, each verified, beats more steps that are individually impressive.

Practically, this means two measurements in your harness rather than one. Per-step success tells you which tool or prompt to fix. End-to-end pass^k, at the k your operations actually require, tells you whether the workflow can ship without a human watching it. Teams that track only the first are regularly surprised in production.

04

Pick the weakest pattern that does the job

Anthropic's engineering write-up Building Effective Agents draws the line that most architecture arguments are missing. In a workflow, LLMs and tools are orchestrated through predefined code paths. In an agent, the model dynamically directs its own process and tool usage. Everything is built on the augmented LLM, a single model call with retrieval and tools attached, and the post is explicit that for many applications optimising single calls with retrieval and in-context examples is usually enough.

The named patterns are worth using as vocabulary in design review, because they are precise. Prompt chaining splits a task into a sequence of calls with programmatic gates between them. Routing classifies the input and dispatches to a specialised handler. Parallelisation comes in two flavours, sectioning for independent subtasks and voting for the same task run several times. Orchestrator-workers has a lead model decompose the task at runtime and synthesise worker output. Evaluator-optimiser loops a generator against a critic.

Our opinion, from building these: most systems shipped as agents should be workflows with exactly one dynamic step. Document extraction, ticket triage, data enrichment and report generation are routing plus chaining with validation gates. They are testable, their cost is predictable, and their failure modes are the ones your existing observability already catches. The post names the trade-off plainly, that the autonomous nature of agents means higher costs and the potential for compounding errors. That is the reason to start at the bottom of the complexity ladder and climb only when a gate fails.

When you do need the loop, the interface the model acts through deserves as much attention as the prompt. Anthropic calls it the agent-computer interface, and the advice is to write tool documentation the way you would write a great docstring for a junior developer: example usage, edge cases, input format requirements, and clear boundaries against neighbouring tools. Then poka-yoke the tools, changing the arguments so that mistakes are harder to make. A tool taking a free-text date invites a parsing failure; one taking an ISO 8601 string and rejecting anything else does not.

The corollary is to resist a sprawling tool surface. Anthropic's context engineering guidance offers a test we use in review: if a human engineer cannot definitively say which tool should be used in a given situation, the agent cannot either. Overlapping tools with fuzzy boundaries are a direct cause of reasoning-action mismatch, already near 14 percent of observed failures without your help.

05

Context is a budget, not a container

The failure teams hit second, after tool design, is context. Anthropic's Effective Context Engineering for AI Agents names the effect context rot: as the window fills, the model's ability to accurately recall information from it declines, across every model tested, at varying rates. The mechanical reason is that attention in a transformer produces n squared pairwise relationships for n tokens, and models have proportionally less training experience with very long sequences. The conclusion is the operative part, that context must be treated as a finite resource with diminishing marginal returns.

That reframes a long agent run as a budgeting problem. Three techniques do the work. Compaction summarises the conversation as it nears the limit and restarts the window from that summary; in Claude Code this means passing the message history to the model to compress the critical details, then continuing with the summary plus the five most recently accessed files. Structured note-taking persists state outside the window entirely, so progress survives a reset. Sub-agents explore in clean windows, spending tens of thousands of tokens each, and return a distilled summary of roughly one to two thousand tokens to a lead agent that holds the plan.

Just-in-time retrieval is the fourth, and in our experience the highest leverage on a codebase or document corpus. Rather than pre-loading everything, keep lightweight identifiers in context, file paths, stored queries, links, and load the content at runtime through tools. An agent with shell access can use head and tail against a large file instead of reading it into the window. The honest trade-off is latency, and it depends on tools and metadata good enough to navigate with, so a hybrid that pre-loads the obviously relevant and explores the rest is usually the right answer.

Compaction is also where a specific class of bug lives, and it connects straight back to the taxonomy. Loss of conversation history accounts for 3.33 percent of observed failures and conversation reset for 2.33 percent. A summariser that drops the acceptance criteria, the user's original constraint, or the fact that step four already ran turns a context management feature into a specification failure. So decide explicitly what is load-bearing and must survive every compaction, keep it outside the summary where possible, and test the summariser against runs whose correct outcome you already know. Tune for recall first and precision second, and start with clearing stale tool results, which is the safest light-touch version.

06

Durable execution, idempotent tools and two separate stop conditions

A long-running agent is a distributed system with a stochastic scheduler, so what makes it survivable is what already makes workflows survivable. Temporal's AI engineering guidance states the constraints clearly, and they are worth knowing even if you never adopt Temporal. Workflow code is replayed from history, so it must be deterministic, and any non-deterministic call inside a workflow, an LLM call included, will produce a different result on replay. The fix is to put the LLM calls and the prompt templates in activities, so the result is recorded once in history and replayed from there, with the side effect that changing a prompt then affects only new executions.

Retries need the same discipline. Disable the provider SDK's own retry logic, setting max retries to zero, and let the orchestrator own the policy so backoff is visible in one place rather than nested three deep. Pass the provider's Retry-After value through as the next retry delay instead of guessing, and mark content-policy rejections non-retryable, because retrying them burns budget to reach the same answer. Never sleep inside an activity to wait out a rate limit, since a platform that releases the worker slot during the delay is doing something your sleep statement cannot.

Then the fix for the largest failure mode in the taxonomy. Activities run at least once, which means a retried tool call can repeat its side effects, and step repetition at 17.14 percent is partly this problem wearing a different hat. Read-only tools such as search are naturally idempotent. Write-side tools, the ones that send an email, move money, create a ticket or modify a record, need an idempotency key stable across retries, and workflow identifier plus step counter works. If your tools cannot be made idempotent, the retry policy is not a reliability feature, it is a duplicate-charge generator.

Human review belongs in the same machinery rather than beside it. Pause the workflow and wait for a signal carrying the decision, with an explicit timeout and a defined default action, so an unanswered approval does not hang forever; Temporal's example uses a twenty-four hour wait condition that returns false on expiry. Use the synchronous update path when a reviewer is actively waiting for a reply. The execution history then doubles as the audit record of who approved what, which is the artefact a compliance reviewer asks for and the one bolt-on approval UIs never produce.

Two stop conditions, not one, because the taxonomy contains opposite errors. Unaware of termination conditions sits at 9.82 percent and premature termination at 7.82 percent, and a single max-iterations cap only addresses the first. So set hard ceilings on iterations, tokens and wall-clock time, and separately write an explicit completion predicate the workflow must satisfy before it is allowed to report success. Verification is its own step with its own tests, since the paper's own 15.6 percent gain came from adding exactly that, and incorrect verification at 6.66 percent is the reminder that an untested checker is just a second place to be wrong.

History growth and payload size are the limits that bite on long loops: carry state into a fresh execution to prune history while preserving the agent's logical state, trim message history before each model call, and remember that payload caps are lower than people assume, two megabytes per argument in Temporal's case, which argues for passing handles rather than documents between steps. The counterweight is that durable execution is infrastructure you then have to operate. For a three-step chain, a job table in PostgreSQL with a status column, an attempt counter and a unique constraint on the idempotency key is a legitimate and much cheaper start. Adopt a workflow engine when runs last tens of minutes, span human approvals, or must survive a deploy mid-flight.

07

Working with Darvi Labs

This is the kind of work we do. Darvi Labs is a software engineering team in Dhumbarahi, Kathmandu, building agentic AI systems and scalable web applications for companies in the US, UK, Europe, Australia and the Gulf. When we are brought into an agent project that works in a demo and not in production, the problem is almost never the model choice. It is an unverified step, a non-idempotent tool, a context window being used as storage, or a loop with no definition of done.

There is more on the engineering side of this on our blogs page, including retrieval quality, evals and guardrails, and observability for AI systems, and the portfolio page shows the kinds of problems we take on. If you have an agentic workflow that is accurate in testing and unreliable in production, and you want a second pair of eyes on where it leaks, the Contact page is the fastest way to reach us.

Next step

Thinking through a similar decision?

Send us the constraint, the workflow, or the decision that keeps resurfacing. We can help clarify what should change first.

Start a conversation→