← Develop AI Apps and Agents o… Latent Shelf · Ch.14

Module Study Guide · Path 2 · AI agents

Orchestrate a Multi-Agent Solution Using the Microsoft Agent Framework

Turn specialized agents into a team — the same interface lets you swap orchestration patterns without rewriting agent logic.

— the module's payoff

Coordinating agents in code. This module covers the workflow building blocks (executors, edges, events) and the five orchestration patterns — concurrent, sequential, handoff, group chat, and Magentic — all reached through one unified interface.

5 orchestration patternsexecutors & edgesMagentic manager15 quiz questions
01Building blocks

Executors, edges, and events

Single-agent systems are limited to one prompt and model. Orchestration assigns distinct skills to each agent, combines their outputs, and routes control dynamically. A workflow is built from three parts.

Workflow components and edge types.
ComponentRole
ExecutorsThe workers — AI agents or custom logic that receive input, act, and produce output.
EdgesDefine message flow: direct (in sequence), conditional (only when a condition holds), switch-case (route by value), fan-out (one message to many), fan-in (combine many into one).
EventsObservability hooks — WorkflowStarted/Output/Error, ExecutorInvoke/Complete, RequestInfo.
02The five patterns

One interface, five strategies

The five orchestration patterns.
PatternHow it worksUse for
ConcurrentBroadcast the same task to many agents; aggregate results independently.Parallel analysis, ensemble decisions.
SequentialAgent A's output becomes B's input, in a fixed order.Pipelines, progressive refinement.
HandoffControl transfers between agents by rules; only one is active at a time.Escalation, fallback, expert routing.
Group chatAgents share a conversation; a chat manager chooses who speaks next.Brainstorming, consensus, multi-perspective.
MagenticA manager plans, delegates, and adapts across specialists.Complex, open-ended problems.

Key concept · The unified orchestration workflow

All patterns share one developer interface: define agents → select/create an orchestration pattern (add a manager if needed) → optionally configure callbacks/transforms → start a runtime → invoke with your task → retrieve results asynchronously. Because the interface is shared, you can experiment with different strategies without rewriting agent logic or learning new APIs.

03Magentic

Manager-driven planning

Magentic orchestration is the flexible, general-purpose pattern for complex, open-ended tasks with no predetermined solution path. A Magentic manager maintains shared context, tracks progress on a dynamic task ledger, and decides which specialist acts next — emphasizing planning over speed and producing a documented approach for human review.

Key concept · When (not) to use Magentic

Use it when the problem is open-ended, multiple specialists are needed, a documented plan aids review, and a step-by-step plan built dynamically adds value. Avoid it when the path is fixed/deterministic, no planning ledger is needed, the task is simple, or speed is the priority. Build it with the MagenticBuilder, configure round/stall limits on the standard manager, and stream results.

★Test yourself

Chapter 14 quiz

Fifteen questions on the building blocks, the five orchestration patterns, and Magentic. Answer first, then expand Show answer.

Part A · Multiple choice

Q1

In a workflow, what are the main "workers"?

  • A Edges
  • B Executors (AI agents or custom logic)
  • C Events
  • D Content filters
Show answer

B — Executors. They receive input, act, and produce output.

Q2

Which edge type sends one message to multiple executors at once?

  • A Direct edge
  • B Fan-out edge
  • C Fan-in edge
  • D Conditional edge
Show answer

B — Fan-out. Fan-in combines many messages into one.

Q3

Which orchestration pattern broadcasts the same task to many agents in parallel?

  • A Sequential
  • B Concurrent
  • C Handoff
  • D Magentic
Show answer

B — Concurrent. Results are aggregated independently.

Q4

Which pattern transfers control between agents so only one is active at a time?

  • A Handoff
  • B Concurrent
  • C Group chat
  • D Sequential
Show answer

A — Handoff. Good for escalation, fallback, and expert routing.

Q5

In group chat orchestration, who decides which agent speaks next?

  • A A chat manager
  • B The user only
  • C Random selection
  • D The first agent
Show answer

A — a chat manager. It orchestrates turn-taking in the shared conversation.

Q6

Which pattern uses a manager that plans, delegates, and adapts on a task ledger?

  • A Sequential
  • B Magentic
  • C Concurrent
  • D Handoff
Show answer

B — Magentic. For complex, open-ended problems.

Q7

When should you AVOID Magentic orchestration?

  • A When the solution path is fixed and speed matters
  • B When the problem is open-ended
  • C When a documented plan is needed
  • D When multiple specialists are required
Show answer

A. Magentic emphasizes planning over speed; use a lightweight pattern for deterministic tasks.

Part B · True or false

Q8

All orchestration patterns share the same core developer interface.

Show answer

True. You can swap strategies without rewriting agent logic.

Q9

Conditional edges trigger only when specified conditions are met.

Show answer

True. Switch-case edges route by value; direct edges run in sequence.

Q10

Events like WorkflowStartedEvent exist for observability and debugging.

Show answer

True. Built-in events trace execution across the workflow.

Q11

Sequential orchestration passes one agent's output as the next agent's input.

Show answer

True. A fixed order for pipelines and progressive refinement.

Part C · Short answer

Q12

Name the five orchestration patterns.

Show answer

Concurrent, sequential, handoff, group chat, and Magentic.

Q13

Name the three workflow components.

Show answer

Executors, edges, and events.

Q14

Name the five edge types.

Show answer

Direct, conditional, switch-case, fan-out, and fan-in.

Q15

What does the Magentic manager maintain to track the plan?

Show answer

A dynamic task ledger — recording goals, subgoals, and execution plans, built progressively.