Claude Code Dynamic Workflows: A New Primitive That Moves Orchestration Into Code
Anthropic introduces Dynamic Workflows, a primitive that turns task orchestration into JavaScript scripts executed by a deterministic runtime. The script manages loops, branching, and intermediate results, so only the final answer enters the main Claude context—solving the bottleneck of context overflow and attention dilution when coordinating hundreds of parallel tasks. A deep dive into architecture, primitives, and execution model is paired with a real-world Bun-to-Rust migration (11 days, 750K lines, 99.8% test pass) and a personal 133-session analysis. Comparisons with n8n/Coze/Dify show Workflow's advantage: Turing-complete code offers more expressiveness than visual DAGs, and the orchestration can be generated on‑the‑fly by a model. It shines for codebase audits, large migrations, and adversarial verification but comes with high token costs and current preview limits. Target audience: engineers tackling massive, automated coding tasks.