{"slug": "orchestrate-subagents-at-scale-with-dynamic-workflows", "title": "Orchestrate subagents at scale with dynamic workflows", "summary": "Claude Code has launched dynamic workflows, a new feature that allows users to orchestrate subagents at scale through scripted automation. The tool, available in research preview on paid plans and major cloud platforms, enables tasks like codebase-wide bug sweeps and 500-file migrations by having Claude write and execute orchestration scripts while keeping the user's session responsive.", "body_md": "## Documentation Index\n\nFetch the complete documentation index at:\n\n[https://code.claude.com/docs/llms.txt]Use this file to discover all available pages before exploring further.\n\nDynamic workflows are in research preview. They require Claude Code v2.1.154 or later and are available on all paid plans, with Anthropic API access, and on Amazon Bedrock, Google Cloud Vertex AI, and Microsoft Foundry. On Pro, turn them on from the Dynamic workflows row in\n\n`/config`\n\n.[subagents](/docs/en/sub-agents)at scale. 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. This page covers how to:\n\n- Decide\n[when to use a workflow](#when-to-use-a-workflow)instead of subagents or skills [Run a bundled workflow](#run-a-bundled-workflow)with`/deep-research`\n\n[Have Claude write a workflow](#have-claude-write-a-workflow)for your task and save it- Understand\n[how a workflow runs](#how-a-workflow-runs)and[manage runs](#manage-runs)\n\n## When to use a workflow\n\n[Subagents](/docs/en/sub-agents),\n\n[skills](/docs/en/skills), and workflows can all run a multi-step task. The difference is who holds the plan:\n\n| Subagents | Skills | Workflows | |\n|---|---|---|---|\n| What it is | A worker Claude spawns | Instructions Claude follows | A script the runtime executes |\n| Who decides what runs next | Claude, turn by turn | Claude, following the prompt | The script |\n| Where intermediate results live | Claude’s context window | Claude’s context window | Script variables |\n| What’s repeatable | The worker definition | The instructions | The orchestration itself |\n| Scale | A few delegated tasks per turn | Same as subagents | Dozens to hundreds of agents per run |\n| Interruption | Restarts the turn | Restarts the turn | Resumable in the same session |\n\n## Run a bundled workflow\n\nThe quickest way to see a workflow in action is to run`/deep-research`\n\n, the [built-in workflow](#bundled-workflows)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.\n\nRun the workflow\n\nRun\n\n`/deep-research`\n\nwith 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.Allow workflows\n\nClaude Code asks whether to allow the workflow. Select\n\n**Yes** to continue. The exact prompt depends on your permission mode. See[Approve the plan before it runs](#approve-the-plan-before-it-runs)for the per-mode options.Watch progress\n\nThe run starts in the background. Run The view shows each phase with its agent count, token total, and elapsed time. Drill into any phase to see its agents and what each one found. See\n\n`/workflows`\n\n, use the arrow keys to select the run, and press Enter to open its progress view:[Watch the run](#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.[have Claude write one](#have-claude-write-a-workflow), and once a run does what you wanted you can\n\n[save it](#save-the-workflow-for-reuse)as a command of your own.\n\n### Bundled workflows\n\nClaude Code includes`/deep-research`\n\nas a built-in workflow:\n| Command | What it does |\n|---|---|\n`/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\n|\n\n[Workflows you save](#save-the-workflow-for-reuse)yourself become commands the same way and appear in\n\n`/`\n\nautocomplete alongside the bundled ones.\n### Watch the run\n\nWorkflows run in the background, so the session stays responsive while agents work. Run`/workflows`\n\nat any time to list running and completed workflows, then select one to open its progress view.\n| Key | Action |\n|---|---|\n`↑` / `↓` | Select a phase or agent |\n`Enter` or `→` | Drill into the selected phase, then into an agent to read its prompt, recent tool calls, and result |\n`Esc` | Back out one level |\n`j` / `k` | Scroll within the agent detail when it overflows |\n`p` | Pause or resume the run |\n`x` | Stop the selected agent, or stop the whole workflow when focus is on the run |\n`r` | Restart the selected running agent |\n`s` |\n|\n\n## Have Claude write a workflow\n\nYou can have Claude write a workflow for your task in two ways:[Ask for a workflow](#ask-for-a-workflow-in-your-prompt)in your prompt with the word`workflow`\n\n, and Claude writes one for the task.[Let Claude decide with ultracode](#let-claude-decide-with-ultracode): set`/effort ultracode`\n\nand Claude plans a workflow for every substantive task in the session.\n\n[bundled workflow](#bundled-workflows)like\n\n`/deep-research`\n\n, or one you’ve [saved](#save-the-workflow-for-reuse).\n\n### Ask for a workflow in your prompt\n\nTo run a single task as a workflow without changing the session’s effort level, include the word`workflow`\n\nanywhere in your prompt.\n[save it as a command](#save-the-workflow-for-reuse)afterward. If Claude Code highlights the word when you didn’t mean to trigger one, press\n\n`alt+w`\n\nto ignore it for this prompt.\n### Let Claude decide with ultracode\n\nUltracode is a Claude Code setting that combines`xhigh`\n\n[reasoning effort](/docs/en/model-config#adjust-effort-level)with automatic workflow orchestration. With it on, Claude plans a workflow for each substantive task instead of waiting for you to ask.\n\n`/effort high`\n\nwhen you return to routine work. It’s available on models that support `xhigh`\n\n[effort](/docs/en/model-config#adjust-effort-level); on other models the\n\n`/effort`\n\nmenu doesn’t offer it.\n### Approve the plan before it runs\n\nIn the CLI, the per-run prompt shows the planned phases and these options:**Yes, run it**: start the run** Yes, and don’t ask again for**: start, and skip this prompt for this workflow in this project from now on`<name>`\n\nin`<path>`\n\n**View raw script**: read the script before deciding** No**: cancel\n\n`Ctrl+G`\n\nopens the script in your editor. `Tab`\n\nlets you adjust the prompt before the run starts.\nWhether you see this prompt depends on your [permission mode](/docs/en/permission-modes):\n\n| Permission mode | When you’re prompted |\n|---|---|\n| Default, accept edits | Every run, unless you’ve selected Yes, and don’t ask again for that workflow in this project |\n| Auto | First launch only. Any Yes records consent in your user settings, and later launches start without prompting. Skipped entirely when ultracode is on |\nBypass permissions, `claude -p` , Agent SDK | Never. The run starts immediately |\n\n**Once**,\n\n**Always**, and\n\n**Deny** actions. The progress view appears in the Background tasks side pane. Your permission mode controls only the launch prompt above. The subagents the workflow spawns always run in\n\n`acceptEdits`\n\nmode and inherit your [tool allowlist](/docs/en/settings#permission-settings), regardless of your session’s mode. File edits are auto-approved. Shell commands, web fetches, and MCP tools that aren’t in your allowlist can still prompt you mid-run. To avoid this on a long run, add the commands the agents need to your allowlist before starting. In\n\n`claude -p`\n\nand the Agent SDK there is no one to prompt, so tool calls follow your configured permission rules without interactive confirmation.\n### Save the workflow for reuse\n\nWhen Claude writes a workflow for a task you’ll repeat, you can save that run’s script as a command. A process like a review you run on every branch then runs the same orchestration each time. Run`/workflows`\n\n, select the run you want to keep, and press `s`\n\n. In the save dialog, Tab toggles between the two save locations:\n`.claude/workflows/`\n\nin your project: shared with everyone who clones the repo`~/.claude/workflows/`\n\nin your home directory: available in every project, visible only to you\n\n`/<name>`\n\nin future sessions from either location.\nIf a project workflow and a personal workflow share a name, the project one runs.\n## How a workflow runs\n\nThe workflow runtime executes the script in an isolated environment, separate from your conversation. Intermediate results stay in script variables instead of landing in Claude’s context. The runtime tracks each agent’s result as the run progresses, which is what makes a run[resumable](#resume-after-a-pause)within the same session.\n\n### Behavior and limits\n\nThe runtime applies the following constraints:| Constraint | Why |\n|---|---|\n| No mid-run user input | Only agent permission prompts can pause a run. For sign-off between stages, run each stage as its own workflow |\n| No direct filesystem or shell access from the workflow itself | Agents read, write, and run commands. The script coordinates the agents |\n| Up to 16 concurrent agents, fewer on machines with limited CPU cores | Bounds local resource use |\n| 1,000 agents total per run | Prevents runaway loops |\n\n## Manage runs\n\nOnce a run starts, you manage it from the`/workflows`\n\nview, or by expanding its progress line in the task panel below the input box.\n### Resume after a pause\n\nIf you stop a run, you can resume it: agents that already completed return their cached results, and the rest run live. Resume a paused run from`/workflows`\n\nby selecting it and pressing `p`\n\n, or ask Claude to relaunch the workflow with the same script.\nResume works within the same Claude Code session. If you exit Claude Code while a workflow is running, the next session starts the workflow fresh.\n### Cost\n\nA workflow spawns many agents, so a single run can use meaningfully more tokens than working through the same task in conversation. Runs count toward your plan’s usage and rate limits like any other session. You can stop a running workflow from`/workflows`\n\nat any time without losing completed work.\nEvery agent in a workflow uses your session’s model unless the script routes a stage to a different one. To control the model cost:\n- Check\n`/model`\n\nbefore a large run if you usually switch to a smaller model for routine work - Ask Claude to use a smaller model for stages that don’t need the strongest one when you describe the task\n\n### Turn workflows off\n\nWorkflows are available in the CLI, the Desktop app, the IDE extensions,[non-interactive mode](/docs/en/headless)with\n\n`claude -p`\n\n, and the [Agent SDK](/docs/en/agent-sdk/overview). The same disable settings apply on every surface. To turn workflows off for yourself:\n\n- Toggle Dynamic workflows off in\n`/config`\n\n. Persists across sessions. - Set\n`\"disableWorkflows\": true`\n\nin`~/.claude/settings.json`\n\n. Persists across sessions. - Set\n`CLAUDE_CODE_DISABLE_WORKFLOWS=1`\n\n. Read at startup, so it applies wherever you set it.\n\n`\"disableWorkflows\": true`\n\nin [managed settings](/docs/en/server-managed-settings), or use the toggle on the\n\n[Claude Code admin settings](https://claude.ai/admin-settings/claude-code)page. When workflows are disabled, the bundled workflow commands are unavailable, the\n\n`workflow`\n\nkeyword no longer triggers a run, and `ultracode`\n\nis removed from the `/effort`\n\nmenu.\n## Related resources\n\n[Run agents in parallel](/docs/en/agents): compare subagents, agent view, agent teams, and workflows[Create custom subagents](/docs/en/sub-agents): the worker primitive workflows orchestrate[Manage costs](/docs/en/costs): how multi-agent runs count toward usage limits", "url": "https://wpnews.pro/news/orchestrate-subagents-at-scale-with-dynamic-workflows", "canonical_source": "https://code.claude.com/docs/en/workflows", "published_at": "2026-05-29 06:09:29+00:00", "updated_at": "2026-05-29 06:18:18.363644+00:00", "lang": "en", "topics": ["ai-agents", "ai-tools", "ai-products", "large-language-models", "generative-ai"], "entities": ["Claude Code", "Anthropic", "Amazon Bedrock", "Google Cloud Vertex AI", "Microsoft Foundry"], "alternates": {"html": "https://wpnews.pro/news/orchestrate-subagents-at-scale-with-dynamic-workflows", "markdown": "https://wpnews.pro/news/orchestrate-subagents-at-scale-with-dynamic-workflows.md", "text": "https://wpnews.pro/news/orchestrate-subagents-at-scale-with-dynamic-workflows.txt", "jsonld": "https://wpnews.pro/news/orchestrate-subagents-at-scale-with-dynamic-workflows.jsonld"}}