Every few months the industry invents a new label for “multiple model calls that somehow cooperate,” and right now one of the loudest is dynamic workflow — especially inside Claude Code. In this post I unpack Claude Code dynamic workflows as a basic concept first — before the feature checklist. The problem is that the same two words mean different things depending on who is talking.
In Anthropic’s older engineering writing, a workflow is the less autonomous thing: fixed code paths that call models. An agent is the system that decides its own next step. In Claude Code’s newer product surface, a dynamic workflow is almost the opposite intuition for many people: Claude writes a JavaScript orchestration script, a runtime executes that script, and the script fans work out across many subagents. The plan lives in code, not in a single chat transcript.
This post is the basic concept I wish someone had drawn for me on a whiteboard. It covers what a dynamic workflow is in Claude Code, how it differs from subagents / skills / agent teams, how that maps to Anthropic’s broader “workflows vs agents” vocabulary, and what the equivalent ideas look like outside Claude — LangGraph-style graphs, classic orchestrator–worker patterns, and hand-written multi-agent harnesses. No product pitch. Just the model of the system.
Start With the Only Distinction That Matters
Before product names, hold one axis in your head:
Who holds the plan for what happens next?
- If code (or a fixed graph) decides the next step, you are in workflow territory.
- If the model decides the next step turn by turn, you are in agent territory.
- If the model writes code that then decides, you are in the interesting middle that Claude Code calls a dynamic workflow.
That third case is why the marketing is confusing. The generation of the plan is dynamic and model-driven. The execution of the plan is deterministic-ish script execution over many workers. You get model creativity up front and code-shaped control during the run.
Anthropic’s 2024 essay Building Effective Agents still frames the industry baseline clearly: workflows orchestrate LLMs and tools through predefined code paths; agents let the LLM direct its own process and tool use. Prompt chaining, routing, parallelization (sectioning and voting), orchestrator–workers, and evaluator–optimizer are all named workflow patterns in that lineage. Claude Code’s dynamic workflows are a productized way to generate and run a large parallel variant of those patterns — especially orchestrator–workers plus voting / adversarial review — without you hand-writing the harness every time.
What Claude Code Dynamic Workflows Actually Are
According to Claude Code’s own docs, a dynamic workflow is:
- a JavaScript script
- that orchestrates many subagents
- which Claude writes for the task you describe
- and which a runtime executes in the background while your main session stays usable
Requirements (as documented at the time of writing): Claude Code v2.1.154+, paid plans (with Pro needing an explicit enable in /config), and availability through Anthropic API access as well as Bedrock / Google’s agent platform / Microsoft Foundry depending on how you run Claude Code.
You reach for Claude Code dynamic workflows when a job needs more agents than one conversation can comfortably coordinate, or when you want the orchestration itself to be something you can read, save, and rerun. The docs’ own examples are the right scale of ambition:
- codebase-wide bug or auth sweeps
- large migrations (hundreds of files)
- research that must cross-check sources against each other
- high-stakes plans drafted from several independent angles before you commit
The important architectural claim: the script holds the loop, the branching, and the intermediate results. The main Claude context is supposed to hold the final answer, not every partial tool trace from fifty workers. That is the opposite of “one giant chat where the lead model remembers everything.”
The Claude Code Menu: Four Primitives, One Axis
Claude Code already had multi-step machinery before dynamic workflows. The docs compare them by asking who holds the plan:
| Primitive | What it is | Who decides what runs next | Where intermediate results live | Scale (order of magnitude) |
|---|---|---|---|---|
| Subagents | Workers the main Claude spawns | Main Claude, turn by turn | Main context window | A few delegated tasks per turn |
| Skills | Packaged instructions / procedures Claude follows | Claude, guided by the skill | Main context window | Same order as subagents |
| Agent teams | Lead + peer sessions with shared task list / messaging | Lead (and peers), turn by turn | Shared task list + messages | A handful of long-running peers |
| Dynamic workflows | A script the runtime executes | The script | Script variables | Dozens to hundreds of agents per run |
I read that table as three different coordination problems:
- Subagents — “do this side quest and bring me a summary.” Great for context hygiene on a small number of tasks. Bad as your only tool for a 400-file migration, because the lead still serializes the world through one brain.
- Agent teams — “a few specialists who can negotiate.” Useful when the work is collaborative and the plan must change mid-flight because peers disagree. Expensive and chatty if what you actually needed was embarrassingly parallel map-reduce.
- Dynamic workflows — “encode the campaign, fan out, reduce, maybe verify, then report.” Useful when the structure is more stable than the individual file or claim being processed.
Skills sit sideways to all three. A skill is reusable procedural knowledge — how we do migrations here, how we write ADRs, which checks must pass — not a concurrency primitive. A workflow or a team can use skills; a skill does not replace a fan-out runtime.
How You Trigger One (Conceptually)
You do not need to memorize every CLI flag to understand the shape. Claude Code documents three entry points:
- Bundled workflow commands — for example
/deep-research, which fans out searches, cross-checks sources, votes on claims, and returns a cited report with weak claims filtered. - Ask for a workflow in the prompt — natural language (“use a workflow”) or the
ultracodekeyword (older builds used a literalworkflowtrigger). Claude writes a script for that task. - Session policy:
/effort ultracode— higher reasoning effort plus “plan a workflow for substantive tasks” as the default behaviour for the session. Powerful, and deliberately more expensive. It is session-scoped, not a permanent personality transplant.
Before a run, you typically get a plan / phase list to approve (depending on permission mode). During a run, the main session stays interactive; you inspect progress through a workflow UI rather than drowning in fifty interleaved tool transcripts. After a good run, you can save the script as a reusable command — which is the quiet killer feature. Dynamic generation becomes a candidate for a semi-static asset.
That last point is where practitioners split. Some people want Claude to invent a new orchestration every time. Others (myself included, on anything that touches production code) want the second run to be a git-reviewed harness with known phases, known concurrency, and known verification. Claude Code’s “save the workflow” path is the bridge between those camps.
What the Script Is Doing Under the Hood
You can understand the script without seeing every API surface. Conceptually it is ordinary control flow plus agent calls:
- Phases — understand → change → verify, or search → fetch → vote → synthesize
- Fan-out — spawn many subagents with isolated context, each holding one slice (one file, one claim, one module)
- Synchronization — wait for a wave to finish before the next phase
- Reduction — merge findings, dedupe, score, or pick a winner
- Adversarial checks — independent agents try to refute claims or break a plan before you see it
- Terminal report — one artifact back to the parent session
Workers inside a classic dynamic workflow are often isolated on purpose: they do not peer-chat the way an agent team does. That is a feature when you want independent judgments (voting, security review). It is a limitation when the task requires live negotiation (“your migration step conflicts with mine; let’s redesign the interface”).
This is also why dynamic workflows pair so well with an objective oracle — a test suite, a typechecker, a linter policy, a golden file. If the only judge of success is another model saying “looks good,” you have scaled vibes. If the script can loop on dotnet test or npm test until green, you have scaled engineering.
Failure Modes Dynamic Workflows Are Trying to Fix
Community write-ups and Anthropic’s own framing keep returning to the same single-agent pathologies:
| Failure mode | What it looks like in one chat | How a workflow changes the game |
|---|---|---|
| Agentic laziness | Stops after 35 of 50 files and declares victory | The loop lives in code; completion is structural, not vibes |
| Self-preferential bias | The same model grades its own work too kindly | Separate verifier agents; adversarial review phases |
| Goal drift | Long compacted context forgets the original objective | Objective and phase structure sit in the script, not only in memory |
| Context congestion | Every tool result lands in one window | Workers keep private context; parent sees reductions |
None of this is free. Parallel agents multiply tokens. A workflow that “almost works” can be a very expensive almost. Treat fan-out as a capacity planning problem, not a personality setting.
Equivalents Outside Claude Code
If you never touch Claude Code, you still need the same ideas. Here is how I map them.
1. Anthropic’s classical workflow patterns
From Building Effective Agents:
- Prompt chaining — fixed pipeline of LLM steps with optional gates
- Routing — classify, then specialized prompts
- Parallelization — sectioning (split work) and voting (multiple attempts)
- Orchestrator–workers — a lead decomposes, workers execute, lead synthesizes
- Evaluator–optimizer — generate, critique, refine in a loop
A Claude dynamic workflow is often “orchestrator–workers + parallelization + optional evaluator,” except the orchestrator first emits a script instead of staying in the chat loop for every assignment.
2. LangGraph and friends
In LangGraph-style systems, the graph topology is usually defined up front (nodes and edges). Runtime dynamism comes from conditional edges, loops, and APIs that fan out work — not from the model inventing a brand-new graph every time (unless you build that yourself). So:
- A static graph with conditional routing ≈ classical workflow with some agent-like choices inside nodes
- A ReAct node loop ≈ agent behaviour inside a workflow chassis
- A map-reduce subgraph over files ≈ what dynamic workflows do well in Claude Code
If your org already standardizes on LangGraph, CrewAI, Temporal + LLM activities, or plain .NET / Node orchestration, you do not need Claude’s product feature to implement the concept. You need clear phases, isolated workers, a reduce step, and an objective stop condition.
3. Hand-written multi-agent harnesses (including “deterministic workflows”)
A growing camp argues the opposite of fully dynamic generation: commit the orchestration script yourself, review it like any other code, and let models only fill worker roles. That is not anti-Claude; it is the same end-state as “save the workflow,” just with a human (or a PR) as the author of record.
I use this rule of thumb:
- Explore with generation — let the tool propose a workflow when the shape of the work is still fuzzy.
- Industrialize with a committed harness — once you know the phases, encode them, test them, and stop paying the “rediscover the plan” tax.
4. Agent SDKs vs workspace orchestration
There is a second vocabulary split worth naming:
- Embedded agents (Agent SDK style) — agents you ship inside a product for end users
- Workspace agents (Claude Code style) — agents that do your engineering / research work in a coding environment
Dynamic workflows in Claude Code are primarily a workspace-orchestration feature. The Agent SDK path is how you build similar loops into software you distribute. Same patterns, different runtime and trust boundary. If you also run tool servers through something like MCP, the gateway / policy questions I wrote about in the enterprise MCP gateway post sit under both.
A Simple Decision Guide
When I choose a primitive, I ask four questions:
- How parallel is the work really? Embarrassingly parallel file/claim work → workflow or map-reduce graph. Tightly coupled design negotiation → agent team or a senior human.
- Does the plan need to change mid-run based on peer debate? Yes → team / agent loop. No → scripted workflow.
- Do I have an objective checker? Tests, compilers, schemas, policy engines. If no, keep the blast radius small; verification theatre scales poorly.
- Will I run this again next month? If yes, invest in a saved or hand-written harness. If no, a one-shot generated workflow is fine.
And the anti-patterns:
- Using ultracode-style always-on workflows for “rename this variable.”
- Spawning fifty agents to rubber-stamp each other with no external oracle.
- Calling everything an agent when you actually built a prompt chain.
- Assuming “more agents” means “more truth.” Sometimes it only means more correlated mistakes at higher cost.
How This Fits a Broader AI Architecture
Dynamic workflows are an execution strategy, not a complete platform:
- Models provide judgment and generation.
- Tools / MCP servers provide capabilities (see also transport and gateway choices in production).
- Skills / runbooks provide institutional procedure.
- Orchestration (workflow scripts, graphs, teams) provides control flow and scale.
- Evaluation and telemetry tell you whether any of it was worth the bill.
If you only invest in orchestration fashion and skip tools, policy, and evals, you get a very fast way to be wrong in parallel. If you invest in solid tools and a boring orchestrator, you often beat a flashy multi-agent demo.
Frequently Asked Questions
What is a dynamic workflow in Claude Code?
A JavaScript orchestration script—usually written by Claude for your task—that a runtime executes to coordinate many subagents in phases, keeping intermediate state in the script rather than in one giant chat context.
How is that different from an “AI agent”?
In classical Anthropic language, an agent decides each next action in a loop. A dynamic workflow uses agents (subagents) as workers, but the next phase and fan-out are driven by the script. Generation of the script can be agentic; execution is workflow-shaped.
Dynamic workflow vs agent team — which should I use?
Use a dynamic workflow for large, decomposable, mostly independent units of work with a stable phase structure. Use an agent team when a small number of peers must negotiate and revise a shared plan while they work.
Dynamic workflow vs subagent?
A subagent is one delegated worker under a turn-by-turn lead. A dynamic workflow is a programmed campaign that may spawn dozens or hundreds of such workers with explicit phases and reductions.
Is LangGraph a dynamic workflow?
Not automatically. Most LangGraph apps are predefined graphs with runtime path choices. That implements the same family of ideas (especially orchestrator–workers and loops), but the plan is usually authored by developers, not regenerated as a fresh JS file each run—unless you build that generation layer yourself.
Why do people say dynamic workflows burn tokens?
Because parallelism multiplies model calls. A research or migration workflow can be excellent value per engineering hour and still be a bad value per dollar if you point it at trivial tasks or leave ultracode on for everything.
Should the orchestration script be saved?
If you will repeat the job, yes. Treat a saved workflow like any automation: review it, constrain its tools, and prefer objective stop conditions. One-off exploration can stay ephemeral.
Do I need dynamic workflows to build multi-agent systems in production?
No. You need clear decomposition, isolation, reduction, authz around tools, and evaluation. Claude Code workflows are one high-leverage way to get that for workspace tasks. Product agents more often use SDKs, queues, and your own orchestrator.
Closing
Strip away the product names and you are left with an old distributed-systems problem: where does control flow live, and how do workers share results without drowning the coordinator?
Claude Code’s answer with dynamic workflows is crisp. Let the model propose a campaign. Put the campaign in a script. Run many isolated workers. Reduce. Optionally attack your own answers. Bring one report home. Compared with a single heroic chat session, that is a more honest machine for migrations, audits, and cross-checked research. Compared with a carefully committed harness, it is a faster way to discover what the harness should have been.
Learn the concept once, and every vendor checklist starts to rhyme — Claude workflows, LangGraph maps, orchestrator–worker services, even the multi-agent setups we wire through MCP tool servers. The fashionable noun will change again. The question “who holds the plan?” will not.
