Dynamic workflow
An orchestration script the agent writes at run time. A runtime executes it, starting many subagents in phases and combining their results in code.
A dynamic workflow is an orchestration program that an agent writes for the task in front of it. A runtime executes the script in the background. The script starts many subagents in phases, keeps their results in variables and combines them in code. The plan lives in the script, outside the model’s context window, so the main conversation receives only the final answer. It is a way to run a large multi-agent system without one model holding every intermediate result.
Anthropic announced dynamic workflows in Claude Code on May 28, 2026. Per the Claude Code docs, the script is JavaScript, a run executes up to 16 agents concurrently by default and at most 1,000 agents in total, and an interrupted run can be resumed in the same session, with completed agents returning their saved results. A run that worked can be saved as a command and rerun. Typical jobs are a codebase audit, a 500-file migration and research with sources cross-checked against each other; the bundled /deep-research command is one such workflow. Claude Managed Agents offer the same option next to subagents and an advisor. Many agents means many tokens: Claude Code shows a “Large workflow” warning when a run schedules more than 25 agents or its projected total passes 1.5 million tokens.
The difference from an agent graph is who writes the plan: a person designs a graph ahead of time, while the model writes a dynamic workflow for this one task. In orchestrator-workers the orchestrating model decides turn by turn and every result lands in its context; here code holds the loop. Try it on a small slice first and watch cost per task.
Sources
- Anthropic: Introducing dynamic workflows claude.com
- Claude Code Docs: Orchestrate subagents at scale with dynamic workflows code.claude.com
- Claude Docs: Multiagent orchestration platform.claude.com
Related terms
- Multi-agent system (multi-agent orchestration): Several AI agents with separate roles and contexts working on one task, usually coordinated by a lead agent or a fixed workflow.
- Agentic workflow (workflow vs agent): A process where your code fixes the steps and a model does some of them, as opposed to an agent that decides its own steps.
- Subagent: A separate agent run with its own fresh context, started by a main agent for one subtask.
- Orchestrator-workers pattern (supervisor): One model plans the task, hands parts of it to worker models or subagents, and combines their results.
- Agent graph (state graph): Modeling an agent as explicit nodes, edges and shared state, with checkpoints, so each step can be paused, resumed, inspected and tested.
- Fan-out and fan-in (parallelization): Splitting work into parallel model calls or subagents (fan-out) and merging their results in one step (fan-in).
- Agent team: A lead agent coordinating several long-running agent sessions that share a task list and message each other directly.
- Cost per task (agent unit economics): What one finished agent task really costs: tokens, retries, tool calls and the human time to review it, compared with doing it another way.
