AI Agent Workflow Patterns: Sequential, Parallel, and Beyond

By Tyler Cyert

AI agent workflow patterns are the architectural blueprints that determine how agents collaborate, pass work between each other, and produce consistent results. Choosing the right pattern is the difference between an agent system that works reliably and one that produces unpredictable output.

This guide covers the five most common patterns, when to use each, and how to implement them with tools like Claude Code and DotBox.

The Five Core Patterns

1. Sequential Pipeline

Agents run one after another. Each agent reads the previous agent's output and produces input for the next.

Flow: Agent A writes to specs/ then Agent B reads from specs/ and writes to implementation/ then Agent C reads from implementation/ and writes to reviewed/

Best for: - Content creation (research, draft, edit) - Code generation (spec, implement, review) - Data processing (extract, transform, load)

Strengths: Simple to understand, easy to debug, clear audit trail. Weaknesses: Slow — each step waits for the previous one. No parallelism.

Implementation: Define working directories for each stage. Each agent's instructions specify which directory to read from and write to. Handoffs happen through the file system.

2. Parallel Fan-Out

Multiple agents work simultaneously on independent tasks. An aggregator combines their results.

Flow: Lead agent spawns Agents A, B, and C in parallel. All three finish and report back. Lead agent combines results.

Best for: - Code review (security, performance, style reviewers in parallel) - Test generation (unit, integration, e2e tests simultaneously) - Research (multiple angles explored at once)

Strengths: Fast — work happens in parallel. Scales well. Weaknesses: Results need aggregation. Agents cannot coordinate with each other during execution.

Implementation: Use subagents for quick parallel tasks or agent teams for sustained parallel work. Define each agent's role in .claude/agents/.

3. Hierarchical Delegation

A lead agent breaks a complex task into subtasks and delegates each to a specialist. The lead coordinates, reviews, and integrates.

Flow: Lead agent analyzes the task, creates subtasks, assigns them to specialist agents, reviews results, and integrates or requests revisions.

Best for: - Feature implementation (lead architect delegates to frontend, backend, test writers) - Project scaffolding (lead creates structure, specialists fill in each module) - Complex refactors (lead plans the strategy, specialists execute per-module changes)

Strengths: Handles complexity. Each specialist stays focused. Weaknesses: Lead agent becomes a bottleneck. Coordination overhead.

Implementation: Use agent teams with a clear lead role. Define specialist agents in .claude/agents/ with focused roles, tool access, and directory boundaries.

4. Hub and Spoke

One source of truth feeds multiple consumers. Each consumer produces a different output from the same input.

Flow: Source material sits in raw/. Agent A reads from raw/ and writes to wiki/. Agent B reads from raw/ and writes to reports/. Agent C reads from raw/ and writes to summaries/.

Best for: - Knowledge management (one source, multiple output formats) - Documentation (one codebase, API docs plus guides plus changelog) - Content repurposing (one research brief, blog post plus social posts plus email)

Strengths: Single source of truth. Consumers are independent. Weaknesses: Source must be comprehensive enough for all consumers. No feedback loop between consumers.

Implementation: Define the hub as a working directory with an INSTRUCTIONS.md that describes the format and completeness requirements. Each spoke agent has its own output directory.

5. Feedback Loop

Agents iterate between creation and review until quality criteria are met.

Flow: Writer agent writes to drafts/. Reviewer agent reads from drafts/ and writes feedback to feedback/. Writer reads feedback and revises. Cycle repeats until the reviewer approves.

Best for: - Iterative refinement (drafting, reviewing, improving) - Quality assurance (implement, test, fix, re-test) - Code improvement (write, review, refactor)

Strengths: Converges toward quality. Catches issues iteratively. Pairs naturally with spec-driven development, where the spec's acceptance criteria define the exit condition. Weaknesses: Can loop indefinitely without clear exit criteria. Slower than single-pass patterns.

Implementation: Define clear exit criteria in the reviewer's instructions: "Approve when all acceptance criteria pass" or "Maximum 3 revision cycles." Use working directories for drafts/, feedback/, and final/.

Choosing the Right Pattern

Your SituationRecommended Pattern
Steps must happen in orderSequential Pipeline
Tasks are independent and can run in parallelParallel Fan-Out
Complex task needs to be broken into specialized workHierarchical Delegation
One input needs multiple different outputsHub and Spoke
Quality requires multiple review cyclesFeedback Loop

Most real-world systems combine patterns. A feature implementation might use hierarchical delegation (lead assigns frontend and backend work) with a feedback loop (reviewer sends code back for fixes) and a sequential finalization (merge, deploy, verify).

Pattern Building Blocks

Every pattern relies on the same building blocks:

Building BlockWhat It DoesWhere to Configure
Working directoriesDefine where agents read and writeProject structure + CLAUDE.md
Agent definitionsDefine each agent's role and scope.claude/agents/
CLAUDE.mdShared context for all agentsProject root
RulesFile-specific conventions.claude/rules/
PermissionsTool access per agentsettings.json
HooksDeterministic automationsettings.json

Designing Patterns with DotBox

Building an orchestrated agent system means coordinating working directories, agent roles, permissions, and handoff rules. For a deeper look at how orchestration coordinates these roles, see What Is Agent Orchestration?. DotBox lets you draw these patterns: each arrow is a handoff, several arrows out fan work out in parallel, and an arrow back makes a feedback loop. Copy the setup prompt, paste it into your agent, and it writes the agent definitions, the working directories and a CLAUDE.md that spells out the flow as part of your directory structure. Start with a pattern, customize it, and ship it.