Claude Code Dynamic Workflows: Run Hundreds of Parallel Agents on Complex Tasks
Claude Code introduces Dynamic Workflows, a new orchestration primitive that lets a single top-level agent spawn and coordinate hundreds of parallel sub-agents at runtime. Designed for complex, long-horizon tasks β multi-repo refactors, exhaustive test generation, large-scale data migrations β Dynamic Workflows bring structured fan-out/fan-in parallelism to Claude Code's agentic pipeline.
Sources & Mentions
3 external resources covering this update
Dynamic Workflows: Structured Parallelism for Complex Agentic Tasks
Claude Code's multi-agent capabilities have taken a major step forward with the launch of Dynamic Workflows β a first-class orchestration primitive that enables a coordinating agent to dynamically spawn, manage, and aggregate the output of hundreds of parallel sub-agents within a single task run.
The Problem: Sequential Bottlenecks in Long-Horizon Tasks
Before Dynamic Workflows, running multi-agent pipelines in Claude Code required pre-defined, static task graphs or manual orchestration code. Tasks that naturally parallelize β "add tests for every function in this 200-file repo," "review every PR in this backlog," "migrate all API calls from v1 to v2" β were either handled sequentially (slow) or required custom scaffolding (fragile).
Dynamic Workflows solve this by making fan-out a first-class operation that the orchestrating agent can invoke at runtime based on actual task discovery, not pre-planning.
How Dynamic Workflows Work
1. Task decomposition at runtime The orchestrating agent analyzes the task, breaks it into independent work units (e.g., one unit per file, one per API endpoint, one per test class), and submits them as a parallel batch to the Dynamic Workflow engine.
2. Parallel sub-agent execution Each work unit is assigned to an isolated sub-agent with its own context window. Sub-agents run in parallel, capped at a configurable concurrency limit. They have access to a shared read-only snapshot of the repository at the time the workflow was launched.
3. Result aggregation with conflict detection As sub-agents complete, their outputs are streamed back to the orchestrator. The aggregation layer handles:
- Merge conflict detection when multiple agents touch the same file
- Deduplication of redundant outputs
- Structured summaries of per-unit results for the orchestrator to reason over
4. Human-in-the-loop checkpoints The orchestrator can pause the workflow at predefined checkpoints to surface a summary to the developer and await approval before proceeding β critical for large-scale changes where blind execution is unacceptable.
API Surface
Dynamic Workflows are accessible via the Claude Code SDK:
const workflow = await claude.workflows.dynamic({
task: "Add unit tests for every exported function",
context: { repo: "./src" },
concurrency: 50,
checkpoints: ["after-decomposition", "before-commit"]
});
for await (const event of workflow.events()) {
// Stream progress, partial results, checkpoint prompts
}
And via the CLI with --workflow dynamic for interactive use.
Use Cases
- Large-scale refactors: Rename a deprecated API across thousands of call sites in parallel
- Exhaustive test generation: Generate tests for every function in a codebase simultaneously
- Multi-repo migrations: Coordinate changes across multiple repositories in a single workflow
- Batch code review: Run
/code-reviewon every PR in a backlog concurrently
Availability
Dynamic Workflows are available to Max, Team, Enterprise, and API plan users. Concurrency limits vary by plan tier.