AI agents · OpenClaw · self-hosting · automation

Quick Answer

Claude Dynamic Workflows vs LangGraph vs CrewAI (May 2026)

Published:

Claude Dynamic Workflows vs LangGraph vs CrewAI (May 2026)

Anthropic shipped Dynamic Workflows in Claude Code on May 28, 2026 — Claude generates JavaScript orchestration on the fly and spawns up to 1,000 parallel subagents per run. That’s a different abstraction from LangGraph (state-machine framework) and CrewAI (role-based crew framework). Here’s how to choose.

Last verified: May 31, 2026.

TL;DR

PatternBest for
Claude Dynamic WorkflowsOne-shot codebase-scale engineering work — migrations, audits, repo-wide refactors, when you’re already in Claude Code.
LangGraphStateful production agents with custom topology, persistence, human-in-the-loop, model-agnostic routing.
CrewAIDeclarative role-based business-process automation with YAML config and clean crew abstractions.

What are they actually?

Claude Dynamic Workflows

A runtime feature of Claude Code that ships with Opus 4.8 (May 28, 2026). When Claude judges a task large enough, it dynamically writes a JavaScript orchestration script that:

  1. Spawns tens to hundreds of parallel subagents (capped at 1,000 total per run, 16 concurrent).
  2. Coordinates intermediate results outside Claude’s context window — the JS script manages state.
  3. Runs adversarial verifier agents over subagent output before final integration.
  4. Returns only the final aggregated answer to your Claude session.

You don’t write the graph. Claude writes it. You write the task description (or just ask).

LangGraph

A Python / TypeScript framework from LangChain (open-source, model-agnostic). You explicitly model agent execution as a stateful graph of nodes (with edges, conditional routing, parallel branches, persistence, and checkpoint-based human-in-the-loop). LangGraph powers many production agents — particularly ones that run for hours or days with intermittent human review.

CrewAI

A Python framework focused on role-based crew orchestration. You declare:

  • Agents with roles, goals, and backstories.
  • Tasks with descriptions and expected outputs.
  • A crew that runs tasks sequentially or hierarchically.

Strong YAML support, large library of templates, popular for business-process automation (sales sequencing, research workflows, content pipelines).

Side-by-side

DimensionDynamic WorkflowsLangGraphCrewAI
TypeRuntime feature (Claude Code)FrameworkFramework
LanguageJS (generated)Python, TSPython
Orchestration ownershipClaude generatesYou defineYou define
Model supportClaude Opus 4.8 onlyAny (OpenAI, Anthropic, Google, local)Any
ConcurrencyUp to 16 concurrent, 1,000 total per runManual parallel branchesSequential or hierarchical
State persistenceScript-managed, ephemeralFirst-class checkpoint storeLimited (use with stores)
Human-in-the-loopNot first-classFirst-classLimited
Best workloadCodebase-scale single-shotLong-running stateful agentsBusiness-process automation
Setup costZero (use Claude Code)Medium (write graphs)Medium (declare crew)
Production maturityNew (May 28, 2026)Mature (2024–2026)Mature (2024–2026)
Cost profileHigh (token-heavy)Tunable per nodeTunable per agent

When each one wins

Dynamic Workflows win when…

  • You’re tackling a codebase-scale single task — language migration, framework upgrade, security audit, bulk refactor, repo-wide bug hunt.
  • You’re already in Claude Code and want zero framework setup.
  • The work is inherently parallel and Claude-shaped — read many files, transform each, validate, integrate.
  • You can tolerate the token cost — Anthropic explicitly warns Dynamic Workflows burn dramatically more tokens than normal Claude Code sessions.
  • You don’t need persistence across days or human-checkpointed steps.

Real example from the launch: 750K-line Zig → Rust migration in 11 days with 99.8% test pass rate. Try writing that as a LangGraph graph.

LangGraph wins when…

  • You’re running a long-lived production agent (customer support, devops assistant, research workflow) over days or weeks.
  • You need custom state — vector store, SQL writes, external API state, checkpoint resumption.
  • You need human-in-the-loop at specific graph nodes (approval gates, manual reviews).
  • You want model routing — Opus 4.8 for hard nodes, Gemini Flash for cheap classification, GPT-5.5 for terminal work.
  • You need observability — LangSmith trace integration is mature.
  • You’re building agentic RAG with complex retrieval branching.

LangGraph is the framework if you’re operating an agent system as infrastructure.

CrewAI wins when…

  • You want declarative role-based workflows — “researcher → writer → editor” reads cleanly in YAML.
  • You’re doing business-process automation rather than engineering — sales sequencing, market research, content generation, customer onboarding.
  • Your team prefers explicit role decomposition for stakeholder communication.
  • You want a shorter time-to-first-agent than LangGraph but more structure than raw API calls.

CrewAI is widely deployed in non-engineering business workflows where the crew metaphor is genuinely useful.

What about Mastra, Pydantic AI, Autogen?

Brief context for related frameworks (mentioned for completeness):

  • Mastra — TypeScript-first agent framework, strong workflow primitives, growing fast in 2026. Use it if you’re TS-native.
  • Pydantic AI — Python framework with type-safe agent definitions. Best for teams that want pydantic-validated outputs end-to-end.
  • Autogen — Microsoft’s multi-agent framework, strong for conversational multi-agent patterns; integrates with Microsoft Foundry and Copilot Studio.

Dynamic Workflows do not replace any of these — they’re complementary for a specific shape of work (Claude-driven codebase tasks).

Combining them in production

The teams running the most ambitious agentic systems in May 2026 are not picking one — they’re stacking:

LangGraph (outer orchestration, state, human-in-the-loop)

  ├── Node: codebase refactor → invoke Claude Code with Dynamic Workflows
  ├── Node: research → CrewAI researcher + writer crew
  ├── Node: classification → Gemini 3.5 Flash batch
  └── Node: human approval gate → checkpoint, notify, resume

Dynamic Workflows are best thought of as a superpowered tool you call from a LangGraph node or a CrewAI task — not a replacement for your framework.

Cost reality check

Workload shapeApproximate cost
750K-line codebase migration with Dynamic WorkflowsHundreds to low thousands of dollars in Opus tokens
Same migration brute-forced with LangGraph + OpusLikely higher (no script-managed intermediate state)
Same migration with CrewAI + OpusLikely higher (sequential crew topology)
100K-token document research with CrewAI + Gemini FlashCents
Long-running support agent with LangGraph + GPT-5.5 NanoCents per conversation

Dynamic Workflows are token-expensive but not necessarily more expensive than the alternatives for the same job — they’re more efficient at large-scale Claude-shaped work because the orchestration overhead doesn’t burn context.

Quick decision tree

Is this a one-shot codebase-scale engineering task?
├── Yes → Dynamic Workflows (via Claude Code)
└── No → Is it a long-running production agent?
    ├── Yes, with custom state / HITL → LangGraph
    └── No, business-process automation → CrewAI

Verdict

Dynamic Workflows are not a framework — they’re a feature. They’re the right answer for codebase-scale engineering megatasks you’d otherwise script by hand or assemble awkwardly with LangGraph. LangGraph remains the production-agent framework of choice for stateful, long-running, model-agnostic systems with human-in-the-loop. CrewAI remains the role-based business-automation framework of choice for declarative non-engineering workflows. In serious production stacks, you’ll likely use all three: LangGraph as the outer state machine, Dynamic Workflows for big codebase nodes, CrewAI for business-process subroutines.

Sources: Anthropic Dynamic Workflows launch (May 28, 2026), Marktechpost coverage, LangGraph docs (langchain-ai.github.io/langgraph), CrewAI docs (docs.crewai.com), Reworked.co analysis, Towards AI agent-building writeup (verified May 31, 2026).