Chaining coordinates subagents by dispatching them in sequence. Use it when a task has dependent subtasks: each later subagent waits for the result of the preceding step. A coordinator can follow an order specified in its task instruction or a skill; it can also determine the next subagent as execution progresses. section 9.4.3
Choose chaining when the overall task can be expressed as sequential work:
- For a known sequence, specify the dispatch order in the task instruction or encapsulate it in a skill. section 9.4.3
- For adaptive work, let the coordinator select subsequent steps and subagents as execution progresses. section 9.4.3
Find and extend a Hailstone sequence
Ask one subagent to read a file of known Hailstone sequences. The coordinator compares their step counts, selects the starting number with the most steps, and asks a second subagent to compute the sequence for twice that number. The second task depends on the first subtask’s result. section 9.4.3
Figure 9.13 The Chaining MAS pattern where the main or coordinator LLM agent dispatches the subagents in a sequence (often known in advance), each handling a portion of the task that builds up to the final result

Diagram of a coordinator dispatching subagents in sequence, with each step contributing to the final result. section 9.4.3
