agent-patterns

fan-out

flowchart TD
    Task([Task input]) --> W1[Worker agent 1]
    Task --> W2[Worker agent 2]
    Task --> W3[Worker agent N]
    W1 --> Aggregator[Aggregator agent]
    W2 --> Aggregator
    W3 --> Aggregator
    Aggregator --> Done([Merged output])

A task is split into independent subtasks, each handled by a separate agent in parallel. Results are merged by an aggregator agent.

How it works

  1. The dispatcher breaks the task into N independent subtasks.
  2. N worker agents run in parallel, each processing one subtask.
  3. The aggregator receives all results and produces a single merged output.

When to use

When not to use

Trade-offs

   
Pro Wall-clock time scales with the slowest subtask, not the sum
Pro Each worker is focused and isolated — easy to reason about
Con All subtasks must complete before the aggregator can run
Con A single slow or failed worker blocks the merge step

Failure modes