Definition
An agentic workflow is a design pattern for building with large language models in which the model works through a task over multiple steps — planning, using tools, checking its own output, and refining — rather than producing an answer from a single prompt. The defining move is the loop: the model acts, observes the result, and decides what to do next, repeating until the task is done.
The payoff shows up in how the field now measures progress. Early coding benchmarks like HumanEval (2021) grade a model on a single shot: hand it a self-contained function prompt, take one answer, check whether it passes. That captures raw code-completion skill but says nothing about the loop — and once a model is wrapped in an agentic workflow, a weaker one that can plan, run its own code, read the error, and fix itself often clears tasks a stronger model misses in one attempt. That result is why evaluation moved on. The benchmarks the frontier competes on now — SWE-bench Verified, Terminal-Bench, OSWorld — no longer score a single answer; they score a whole run inside a real environment, where the system has to use tools, take many steps, and survive tests that either pass or don't. The durable lesson underneath has only hardened into 2026: how you use a model often matters as much as which model you use.
How It Works
An agentic workflow turns one prompt-and-response into a controlled loop. A task enters, and the system cycles through some combination of four moves until a stopping condition is met:
- Plan — break the goal into steps before acting.
- Act — call a tool: run code, query an API, search, edit a file.
- Observe — read the result of that action, including errors.
- Reflect — critique the work so far and decide whether to accept it or try again.
The crucial design variable is who controls the sequence. On one end, the developer hard-codes the path — "draft, then critique, then rewrite" — and the model only fills in each step; this is a workflow in the strict sense. On the other end, the model itself decides the order and number of steps at run time; this is an agent. Most production systems sit between: enough fixed structure to be predictable and debuggable, enough model autonomy to handle variation. Choosing where to sit on that spectrum is the core engineering decision.
A worked example makes the loop concrete. Ask a system to write a function with a reflection workflow, and one request becomes several LLM calls: it drafts the code (call 1), reviews its own draft and finds two edge cases it missed (call 2), rewrites (call 3), runs the tests, sees one still failing (an observation, not an LLM call), and patches it (call 4). Four model calls and one test run replaced a single-shot answer — and that is exactly why the output is better and why it costs more.
Types
Agentic workflows are built from a small set of recurring patterns, drawn from Anthropic's Building Effective Agents and Andrew Ng's design-pattern series. Real systems compose several:
- Prompt chaining — split a task into a fixed sequence of steps, each step's output feeding the next. Predictable and easy to debug; use it when the path is known in advance.
- Routing — a classifier step sends the input down one of several branches (e.g. a support query routed to "refund," "technical," or "billing" handling). Trades a little latency for specialized downstream prompts.
- Parallelization — run independent subtasks at once and aggregate, either by splitting the work (sectioning) or by running the same task several times and voting on the result.
- Reflection (evaluator-optimizer) — one pass generates, a second critiques against criteria, and the loop repeats until the critique is satisfied. This is the pattern behind the single-shot-versus-agentic gap in the Definition: a weaker model that critiques and retries can clear tasks a stronger one misses answering once.
- Orchestrator-workers — a lead model decomposes the task and delegates pieces to worker models, then synthesizes their outputs. When the workers are themselves autonomous, this becomes a multi-agent system.
The further down this list you go, the more autonomy you hand the model — and the more you gain in flexibility while losing in predictability.
Real-World Applications
Named, in-production uses as of 2026:
- Autonomous coding — Claude Code and Cursor run a plan-act-reflect loop over a repository: read files, edit, run tests, read the failures, fix. Code is the ideal case because each step has an objective check (the tests pass or they don't).
- Deep research — a workflow searches the web, reads sources, cross-checks claims, and synthesizes a cited report, iterating when it finds gaps.
- Data analysis — an agent writes SQL or Python, executes it, inspects the result, and corrects its own query before summarizing.
- Business automation — platforms like n8n let teams wire LLM steps into routing-and-tool-use pipelines that triage tickets or process documents end-to-end.
The common requirement is a checkable outcome at each step. Where the workflow cannot verify its own intermediate results, the reflection and self-correction that make these patterns work have nothing to act on.
Key Concepts
- Control flow vs. autonomy — the single most important dial. More fixed structure means more predictability and easier debugging; more model autonomy means more flexibility on tasks you cannot fully specify in advance.
- State and memory — steps pass context forward. Because the transcript grows with every step, long workflows accumulate tokens (and cost) super-linearly, and eventually outgrow the context window unless state is summarized or stored externally.
- Tool use — function calling is how a step requests an action, and the Model Context Protocol (MCP) standardizes connecting workflows to tools and data without bespoke glue per integration.
- Orchestration frameworks — LangGraph, CrewAI, and the OpenAI Agents SDK provide the plumbing (state, retries, branching) so you build the workflow logic rather than the loop machinery.
Challenges
These failure modes are specific to running an LLM in a multi-step loop, and they are why a workflow is not a free upgrade over a single prompt.
The most counter-intuitive one is that errors compound across steps. Take a step that is 95% reliable on its own: chain ten of them and the workflow finishes correctly only about 60% of the time (0.95¹⁰ — an illustration, not a measured rate), because every step is another chance to derail. More steps is not automatically better — it is often worse, and shortening the chain is a real reliability lever. Cost and latency multiply for the same structural reason: every step is at least one LLM call, each call resends the growing context, and a four-step reflection loop can cost several times a single answer and run for seconds to minutes. That is worth paying for a hard task and pure waste on an easy one.
The other two challenges are about discipline rather than arithmetic. The most common mistake in 2026 is over-engineering — reaching for an autonomous agent when a fixed prompt chain would do the job cheaper, faster, and debuggably; if you can write the steps down in advance, a workflow beats an agent. And because a model that chooses its own path can take two different routes through the same input, observability stops being optional: without logging every step's input, tool call, and output, a production bug becomes almost impossible to reproduce.
Future Trends
- Fewer hand-built loops — orchestration frameworks increasingly absorb the retry, state, and branching logic developers used to write by hand.
- Standardized tool and agent interfaces — MCP for tools, and emerging agent-to-agent protocols, let workflows compose components across vendors instead of bespoke wiring.
- Longer-horizon workflows — the practical frontier is how many steps a workflow can chain before it drifts, pushing these patterns from minutes-long tasks toward hours-long ones.
Code Example
A minimal reflection loop — generate, critique, repeat — in pseudo-Python:
def reflection_workflow(task, max_rounds=3):
draft = llm(f"Complete this task:\n{task}")
for _ in range(max_rounds):
critique = llm(f"Critique this draft. If it is correct "
f"and complete, reply DONE.\n\n{draft}")
if "DONE" in critique:
break
draft = llm(f"Task:\n{task}\n\nDraft:\n{draft}\n\n"
f"Revise using this feedback:\n{critique}")
return draft
Each llm(...) is a separate model call, so this loop makes up to five calls for one task — the concrete trade of cost and latency for quality that defines every agentic workflow.