An architect is designing a multi-agent system with the following dependency graph: Agent A must complete before Agents B and C can begin; Agents B and C can run concurrently; Agent D cannot start until both B and C are complete. Which coordination pattern is most appropriate?
Select an answer to reveal the explanation.
Short Explanation
Here's the deal — when one agent feeds two parallel agents and a final agent waits on both, you use fan-out/fan-in. You run the two middle agents at the same time, then hold the final agent at a barrier until both are done. That matches the graph and cuts wall-clock time.
Full Explanation
The dependency graph where the first agent must complete before two middle agents can begin, and the final agent cannot start until both middle agents are complete, maps directly to the fan-out/fan-in pattern: the first agent produces output, which fans out to the two middle agents running concurrently, then the final agent is gated on both middle agents completing at a barrier synchronization point. This is the canonical pattern for this topology and minimizes total workflow duration. The sequential execution pattern, where agents pass outputs in a chain to ensure no race conditions, is logically correct but suboptimal — the two middle agents have no dependency on each other and can run in parallel, halving that phase's duration. The broadcast pattern, where the first agent's output is broadcast to all agents and the final agent monitors completion signals autonomously, is incorrect — the final agent must wait for the two middle agents' processed outputs, not just the first agent's raw output. The event-driven pattern, where completion events go to a message queue and a subscriber triggers downstream agents, is a valid variant but adds infrastructure complexity beyond what's needed.