Summary: Agentic workflows are structured multi-agent orchestrations where multiple autonomous agents collaborate to solve complex tasks. They go beyond single-agent loops by composing specialized agents (planner, coder, reviewer, researcher) with explicit coordination patterns: sequential pipelines, parallel swarms, hierarchical delegation, and self-correction loops.
Single Agent → Multi-Agent
| Single Agent (Claude Code, Codex) |
Multi-Agent Workflow |
| One loop, one context |
Multiple agents, shared/isolated contexts |
| Generalist capabilities |
Specialized roles (planner, coder, critic) |
| Linear tool use |
Graph/cycle of agent interactions |
| Context = full history |
Context partitioned per agent |
Core Workflow Patterns
1. Sequential Pipeline
Planner → Researcher → Coder → Reviewer → Integrator
- Each agent completes phase → passes structured output to next
- LangGraph:
StateGraph with linear edges
- Best for: Well-defined multi-stage tasks (code generation, research)
2. Parallel Swarm
Task → [Agent₁, Agent₂, Agent₃...] (parallel) → Aggregator
- Multiple agents explore different approaches simultaneously
- Aggregator synthesizes best result
- LangGraph:
Send to parallel nodes
- Best for: Search, hypothesis generation, ensemble coding
3. Hierarchical Delegation (Manager-Worker)
Manager
├─→ Subagent A (investigate)
├─→ Subagent B (implement)
└─→ Subagent C (test)
↓
Summaries → Manager (verify) → Final
- Main agent delegates to subagents with fresh context
- Only summaries return (not full history)
- Claude Code SDK: Built-in
Agent tool for subagents
- Best for: Large codebases, multi-repo tasks
4. Reflexion / Self-Correction Loop
Agent → Output → Critic (self or separate) → Feedback → Agent (retry)
- Iterate until critic approves or max iterations
- Reflexion (Shinn et al., 2023): Verbal reflection + memory
- Self-Correction: Built-in for coding tasks
- Best for: Debugging, code review, quality-critical tasks
Framework Comparison
| Framework |
Orchestration |
State Mgmt |
Human-in-Loop |
Best For |
| LangGraph |
Graph (cycles ok) |
Checkpointed State |
Explicit nodes |
Complex workflows, cycles |
| AutoGen |
Group Chat |
Per-agent + shared |
Default |
Collaborative teams |
| CrewAI |
Sequential Process |
Process memory |
Task-level |
Business automation |
| Claude Code SDK |
Subagent delegation |
Main + isolated sub-context |
Via permissions |
Dev agents, research |
| Codex Goals |
Goal-driven loop |
Thread-scoped |
Goal boundaries |
Research repro, debugging |
Key Design Decisions
| Decision |
Options |
Trade-off |
| Context isolation |
Shared vs. per-agent |
Shared = coherent, Per-agent = focused + cheaper |
| Communication |
Structured (JSON) vs. natural language |
Structured = reliable, NL = flexible |
| Coordination |
Centralized (manager) vs. decentralized (swarm) |
Centralized = predictable, Decentralized = robust |
| State persistence |
Checkpoint every turn vs. end only |
Frequent = resumable, End = cheaper |
| Failure handling |
Retry, fallback, human escalation |
Retry = auto, Human = safe |
Subagents (Claude Code SDK Pattern)
# Main agent spawns subagent for subtask
subagent = Agent(
name="code-investigator",
tools=["Read", "Glob", "Grep"], # Minimal tool set
system_prompt="Find all auth-related files..."
)
result = await subagent.run("Investigate auth module")
# Returns: Summary only (not full transcript)
Benefits:
- Fresh context (no history bloat)
- Minimal tools (focused, cheaper)
- Only summary returns (compressed)
Related Concepts
Sources