Dynamic Workflow
A JavaScript orchestration script that Claude writes and a runtime executes to fan a complex task across tens to hundreds of parallel subagents, keeping intermediate state outside the conversation.
What It Is
A dynamic workflow is a JavaScript file that orchestrates Claude subagents across a single long-running task. When you ask Claude Code to handle something larger than one chat turn can hold, the model writes a JavaScript script that calls out to subagents, gathers their results in variables, and only surfaces the verified final answer back to your session. The script is the plan, and the script lives in code, not in the conversation. Anthropic released the feature on May 28, 2026, alongside Claude Opus 4.8, available to all paid Claude Code users running v2.1.154 or later.
The mechanism is the part most people miss on the first read. The model is not running the workflow. A runtime is running the workflow, and the model wrote the runtime’s instructions. That distance is what lets the work scale. Up to one thousand total agents can be coordinated inside one execution. Sixteen of them can run concurrently. The script can branch, loop, retry, and quarantine failures the way a normal program does, because it is a normal program. The conversation thread becomes the dashboard. The script becomes the worker.
How It Actually Works
You start a dynamic workflow with a slash command like /deep-research or by asking Claude to write you a workflow that does X. Claude reads your request, writes a JavaScript file, and hands it to the workflow runtime that ships with Claude Code v2.1.154. The runtime spawns subagents according to the script’s structure. Each subagent gets a narrowly scoped subtask, a token budget, and a return type. Their results land in script variables. The orchestrator does not see the subagent transcripts. It sees only what the script chose to save. When every branch resolves, the script composes a final answer and that final answer is what re-enters your chat.
This architecture moves the context-window from the bottleneck to the inbox. Before dynamic workflows, every intermediate consideration the model held had to fit alongside the original task plus the user instructions plus the tool outputs. After dynamic workflows, the working memory lives in code variables, and only the verified summary returns. That is how a thirty-step audit fits inside a single Claude session without context exhaustion.
Why It Matters Right Now
The agentic IDE category spent the last six months racing on one axis: how many tool calls can a single model chain before its context breaks. Dynamic workflows reframe the question. Stop asking how many tool calls a model can chain. Ask how many subagents the model can supervise. The first number is a memory limit. The second is an architecture choice. The second number scales further.
This is also a quiet pricing move. Subagents inside a workflow are billed against the same paid Claude Code plan that started the session. There is no per-agent surcharge. Which means the cost of running a fifty-agent overnight refactor is closer to one Claude Code session than to fifty of them. The pricing structure is begging the operator to run bigger jobs, less often.
The Cost Tradeoff
A workflow that fans out widely will burn a lot of input tokens fast, because each subagent gets its own slice of context. Anthropic ships a configurable effort knob that caps how much compute the runtime allocates per workflow. Set the knob low and you get a smaller fan-out at lower cost. Set it high and you get the full thousand-agent ceiling at the price you would expect. The math that used to live inside an agent-loop-cost calculation now lives inside an effort-tier choice, which is friendlier to non-technical operators trying to predict a monthly bill.
How TWO Uses It
TWO’s editorial line on dynamic workflows is that the script is the artifact. Most operators reading this term will be tempted to evaluate dynamic workflows on the output: did the refactor land cleanly, did the audit catch the right files, did the research memo nail the brief. That metric is the wrong one for the first month. The right metric is the script. If Claude writes you a workflow that you cannot read, you do not own the work. You own a black box that happened to produce a usable artifact.
Scott’s rule for the next four weeks is to open the JavaScript file Claude writes before approving the run. Read the structure. Look at how the model broke the task into stages, what it parallelized, what it serialized, where it gated. That reading is the new operator skill of the late agentic era. The agent is delegating to a script, and the script is delegating to subagents. The operator who can read the delegation chain is the one who keeps the steering wheel. The operator who only reads the final output is being managed by their own tool. Use dynamic workflows. Read the scripts. Refuse to skip that step until you have read at least ten of them.