Anthropic's Dynamic Workflows: What Everyone Gets Wrong!

Prompt EngineeringAbout 4 min readJun 1, 2026Watch original
THE SUMMARYAI-generated

Key Concepts

  • Dynamic Workflows: An advanced agentic pattern where an orchestrator generates executable code (scripts) to manage tasks, rather than relying solely on a model's context window.
  • Orchestrator: The lead agent responsible for breaking down tasks, generating the workflow script, and managing sub-agents.
  • Implement-Verify-Fix Loop: A core methodology where agents implement tasks, independent verifiers perform adversarial reviews, and a fixer resolves issues.
  • Context Window vs. Script: The fundamental shift where the "plan" is stored as a versionable, readable script rather than being trapped within the model's transient context window.
  • Objective Oracle: A requirement for dynamic workflows; tasks must have a measurable, verifiable "ground truth" (e.g., unit tests).
  • Token Consumption: The high cost associated with running multiple concurrent agents; dynamic workflows can consume millions of tokens rapidly.

1. Evolution of Agentic Patterns

The video outlines the progression of agent design, focusing on where the "plan" resides:

  • Single Agent: The plan and execution exist entirely within one context window.
  • Sub-agents: An orchestrator divides tasks, but sub-agents operate in isolation without inter-communication.
  • Agent Teams: Agents share a task list, allowing for coordination, but the plan remains within the context window of the models.
  • Dynamic Workflows: The plan is externalized as a JavaScript script. This allows for complex, multi-step execution where results are stored in script variables, not just the model's memory.

2. The Dynamic Workflow Framework

Dynamic workflows utilize specific primitives:

  • Metadata & Labeling: Initial setup and stage identification.
  • Parallelization: The ability to "fan out" tasks across multiple agents (limited to 16 concurrent agents, with a maximum of 1,000 per run).
  • Adversarial Verification: Independent agents are tasked with "poking holes" in the implementation, ensuring higher quality through a competitive review process.
  • Fixer: A dedicated agent that processes feedback from the verifiers to finalize the output.

3. When to Use vs. Avoid

The speaker emphasizes that dynamic workflows are not a "silver bullet" and can lead to massive financial loss if misused.

| Use Case | Recommendation | Reason | | :--- | :--- | :--- | | Code Migrations | Use | High test coverage provides an objective "oracle" for success. | | Security/Bug Sweeps | Use | Measurable, objective outcomes. | | Creative/Subjective Tasks | Avoid | No "ground truth" leads to "vibes-based" results and wasted tokens. | | Small, Well-scoped Changes | Avoid | Overkill; standard sub-agent patterns are more cost-effective. |

Decision Tree for Implementation:

  1. Is there an objective oracle/measurement? (If No: Stop).
  2. Do you need massive fan-out (hundreds of agents)? (If No: Use sub-agents or /goal).
  3. Do you need state management mid-run? (If Yes: Use Dynamic Workflows).

4. Real-World Application: Model Migration

The speaker demonstrates migrating an app ("Quorum") from MLX Swift to Transformers.

  • Process: The orchestrator analyzed the codebase, requested human-in-the-loop confirmation, and generated a 4-phase, 12-agent workflow.
  • Outcome: The system successfully migrated the code and passed the test suite.
  • Cost/Performance: The task consumed approximately 750,000 tokens. The speaker notes that while successful, the output should always be treated as non-production-ready until verified.

5. Notable Quotes

  • "The main idea again is who holds the plan? ... In the case of dynamic workflows, it's a real script, actual code that holds the plan, not a subagent or a main orchestrator in its context window."
  • "If you don't have ground truth... it's basically based on vibes now."
  • "Don't just try to use the newest feature out there. You're going to burn through your token quota pretty quickly."

6. Synthesis and Conclusion

Dynamic workflows represent a significant leap in agentic capability by moving the "plan" from the volatile context window into persistent, executable code. While powerful for large-scale, objective tasks like code migration or security auditing, they are highly resource-intensive. The primary takeaway is to prioritize objective measurability—if you cannot define what "success" looks like through automated tests, the cost of dynamic workflows will far outweigh the benefits. Always verify the generated script and monitor token usage to avoid unexpected financial impact.

AI summaries can miss context or contain errors. Check important details against the original video.

Go a little deeper.

Have a question about this video? Load its transcript to open the video chat.