Orchestrate subagents at scale with dynamic workflows - Claude Code Docs
Documentation Index Fetch the complete documentation index at: /docs/llms.txt Use this file to discover all available pages before exploring further. Skip to main content Assistant Responses are generated using AI and may contain mistakes. Dynamic workflows are available on all paid plans, with Anthropic API access, and on Amazon Bedrock, Google Cloud’s Agent Platform, and Microsoft Foundry. On Pro, turn them on from the Dynamic workflows row in /config .
A dynamic workflow is a JavaScript script that orchestrates many subagents at once. Claude writes the script for the task you describe, and a runtime executes it in the background while your session stays responsive. Reach for a workflow when a task needs more agents than one conversation can coordinate, or when you want the orchestration codified as a script you can read and rerun. Examples include a codebase-wide bug sweep, a 500-file migration, a research question that needs sources cross-checked against each other, and a hard plan worth drafting from several independent angles before you commit to one.
When to use a workflow Subagents , skills , agent teams , and workflows can all run a multi-step task. The difference is who holds the plan: Subagents Skills Agent teams Workflows What it is A worker Claude spawns Instructions Claude follows A lead agent supervising peer sessions A script the runtime executes Who decides what runs next Claude, turn by turn Claude, following the prompt The lead agent, turn by turn The script Where intermediate results live Claude’s context window Claude’s context window A shared task list Script variables What’s repeatable The worker definition The instructions The team definition The orchestration itself Scale A few delegated tasks per turn Same as subagents A handful of long-running peers Dozens to hundreds of agents per run Interruption Restarts the turn Restarts the turn Teammates keep running Resumable in the same session A workflow moves the plan into code.
With subagents, skills, and agent teams, Claude is the orchestrator: it decides turn by turn what to spawn or assign next, and every result goes into a context window. A workflow script holds the loop, the branching, and the intermediate results itself, so Claude’s context holds only the final answer. Moving the plan into code also lets a workflow apply a repeatable quality pattern, not just run more agents: it can have independent agents adversarially review each other’s findings before they’re reported, or draft a plan from several angles and weigh them against each other, so you get a more trustworthy result than a single pass.
Run a bundled workflow The quickest way to see a workflow in action is to run /deep-research , the built-in workflow Claude Code includes for investigating a question across many sources. You’ll see agents work through a set of phases in the background while your session stays free, and get one report at the end instead of a turn-by-turn transcript. 1 Run the workflow Run /deep-research with a question you want investigated.
It fans out web searches across several angles, fetches and cross-checks the sources it finds, and synthesizes a cited report. /deep-research What changed in the Node.js permission model between v20 and v22? 2 Allow workflows Claude Code asks whether to allow the workflow. Select Yes to continue. The exact prompt depends on your permission mode. See Approve the plan before it runs for the per-mode options. 3 Watch progress The run starts in the background.
Run /workflows to open its progress view: /workflows If /workflows shows a list of runs instead, select the run you just started and press Enter. The view shows each phase with its agent count. Drill into any phase to see its agents and what each one found. See Watch the run for the full set of controls. You can also watch from the task panel below the input box: a one-line progress summary appears there while the run is going.
Press the down arrow to focus it, then Enter to expand. 4 Read the report When the run finishes, the report appears in your session. It cites the sources each claim came from, with claims that didn’t survive cross-checking already filtered out. When the verifier agents can’t check a claim, such as after a rate limit or API error, the report lists that claim as unverified instead of counting it as refuted. To run a workflow for your own task, have Claude write one , and once a run does what you wanted you can save it as a command of your own.
Bundled workflows Claude Code includes /deep-research as a built-in workflow: Command What it does /deep-research <question> Fans out web searches on a question across several angles, fetches and cross-checks the sources it finds, votes on each claim, and returns a cited report with claims that didn’t survive cross-checking filtered out. Requires the WebSearch tool to be available Workflows you save yourself become commands the same way and appear in / autocomplete alongside the bundled ones.
Watch the run Workflows run in the background, so the session stays responsive while agents work. Run /workflows at any time to list running and completed workflows, then select one to open its progress view. When the session has only one run, /workflows skips the list and opens that run. To stop a running workflow from the list without opening it, select it and press x . The progress view shows each phase with its agent counts.
The footer lists the key for each action: Key Action ↑ / ↓ Select a phase or agent Enter or → Drill into the selected phase, then into an agent’s detail. In the detail, Enter expands or collapses it Esc or ← Back out one level j / k Scroll within the agent detail when it overflows f Filter the agent list in the selected phase by status. Press again to cycle p Pause or resume the run x Stop the selected agent, or stop the whole workflow when focus is on the run r Restart the selected running agent s Save the run’s script as a command The agent detail lists the agent’s prompt, its recent tool calls, and its result.
Each call shows its state, such as still running or failed. When the agent keeps a task list of its own, the detail shows it too, with each task’s status. Press Enter to expand the detail. The prompt and result then show in full, and each listed call shows its input and the start of its result. Have Claude write a workflow You can have Claude write a workflow for your task in two ways: Ask for a workflow in your prompt, either in your own words or by including the keyword ultracode , and Claude writes one for the task.
Let Claude decide with ultracode : set /effort ultracode and Claude plans a workflow for every substantive task in the session. You can also run a workflow command that already exists: a bundled workflow like /deep-research , or one you’ve saved . Ask for a workflow in your prompt To run a single task as a workflow without changing the session’s effort level, include the keyword ultracode in your prompt. Asking in your own words, for example “use a workflow” or “run a workflow”, also works: Claude treats a direct request as the same opt-in. ultracode: audit every API endpoint under src/routes/ for missing auth checks Claude Code highlights the keyword in your input and Claude writes a workflow script for the task instead of working through it turn by turn.
The keyword only chooses how Claude structures the work: the agents’ tool calls receive the same permission checks and sandboxing as any other tool call in the session. If the run does what you wanted, you can save it as a command afterward. If you already have an orchestrator built another way, such as a folder of subagent prompts or a skill that fans work out, you can point Claude at it and ask for a workflow that does the same thing.
Dismiss or turn off the keyword If you didn’t mean to start a workflow, press Option+W on macOS or Alt+W on Windows and Linux to dismiss the highlight for this prompt, o
The rest of this page is on the live site.