| name | hub-spoke |
| description | Implement a central Coordinator (Hub) that manages, distributes, and merges tasks performed by specialized worker sessions (Spokes). Spokes communicate only with the Hub and not with each other. Useful for ad-hoc project management and complex workflow distribution. Triggers: "ํ๋ธ ์คํฌํฌ", "์ค์ ํต์ ", "์์
๋ฐฐ๋ถ", "hub and spoke", "coordinator pattern", "centralized workflow".
|
Hub-and-Spoke
The Hub-and-Spoke pattern designates a central Coordinator session (Hub) to manage planning, task distribution, progress checking, and final result merging. The Worker sessions (Spokes) execute their specific assignments independently and communicate only with the Hub.
5-Stage Workflow
โโโโโโโโโโโโโโโโโ
โ Coordinator โ โโโ Planning, task queue, and spoke bridging
โโโโโโโโโฌโโโโโโโโ
โโโโโโโโโโโผโโโโโโโโโโ
โผ โผ โผ
Worker Worker Worker
(A) (B) (C)
- Role Definition: Spawn a dedicated Coordinator session (Hub) and define specialized Spoke Worker configs.
- Task Planning: The Hub analyzes the goal, creates a task dependency list, and allocates work.
- Execution Routing:
- The Hub spawns Spokes asynchronously using
agent__startSession(waitForResult=false).
- Spokes work in isolation. If inter-spoke coordination is needed, the Hub routes messages. See routing.md.
- Monitoring: The Hub polls Spoke statuses via
agent__checkSession.
- Synthesis: The Hub merges all finished spoke artifacts and runs integration checks.
๐ ๏ธ MCP Tools Guide
- Context Management: Do not let the Hub read all conversation logs from all Spokes to prevent context overflow. Instruct the Hub to only request summarized status reports and file list results.
- Message Bridging: If Worker B depends on Worker A's output, the Hub collects the artifact details from A and injects them to B via
agent__messageToSession.
References