Deep Expertise Track · Lesson 9

Magentic Orchestration

Multi-agent Pattern 5: plan, build, execute — the most advanced pattern

Magentic Orchestration: Plan, Build, Execute

Lesson 9 — Multi-agent Pattern 5: the most advanced pattern, for open-ended problems with no predetermined path

What you'll learn
  1. What magentic orchestration is (dynamic orchestration, task-ledger-based)
  2. How it differs from all other patterns (the manager builds the plan AS it goes)
  3. The task ledger concept and why it's powerful
  4. When to use this vs every other pattern (and when it's overkill)

The Pattern

Magentic orchestration is designed for open-ended problems with no predetermined solution path. A manager agent dynamically builds and refines a task ledger, delegates to specialists, iterates, and adjusts the plan based on what it learns.

┌──────────────────────────────────────────────────────────────┐ │ MAGENTIC ORCHESTRATION │ │ (dynamic / task-ledger / adaptive planning) │ │ │ │ ┌──────────────────┐ │ │ │ MANAGER AGENT │ │ │ │ (builds plan as │──── invoke ────┐ │ │ │ it learns) │ │ │ │ └────────┬─────────┘ │ │ │ │ ▼ │ │ ┌──────────────────┐ ┌──────────────┐ │ │ │ TASK LEDGER │ │ Agent A │ │ │ │ ┌──────────────┐ │ │ (diagnostics) │ │ │ │ │ Goal: ... │ │ └──────────────┘ │ │ │ │ Task 1: ✓ │ │ │ │ │ │ │ Task 2: ... │ │◄─── results ───────┘ │ │ │ │ Task 3: NEW │ │ ┌──────────────┐ │ │ │ │ (added after │ │ │ Agent B │ │ │ │ │ learning X) │ │ │ (rollback) │ │ │ │ └──────────────┘ │ └──────────────┘ │ │ └──────────────────┘ │ │ │ │ │ │ │ ▼ │ │ │ ┌──────────────────┐ │ │ │ │ Evaluate: │◄──────────────────┘ │ │ │ Goal met? │ │ │ │ YES → Result │ │ │ │ NO → revise │ │ │ │ plan, loop │ │ │ └──────────────────┘ │ └──────────────────────────────────────────────────────────────┘

Source: Microsoft Azure — AI Agent Orchestration Patterns

What Makes Magentic Different

PatternPlanFlexibility
SequentialFixed, predefinedNone — can't deviate
ConcurrentFixed, but parallelCan't add agents mid-run
HandoffDynamic routingCan transfer, but no plan revision
Group ChatDiscussion-basedCan debate, but no plan structure
MagenticBuilt dynamicallyAdd/remove/reorder tasks mid-execution

Real-World Example: SRE Incident Response

Microsoft's guide describes an SRE team using magentic orchestration for incident response:

SRE INCIDENT RESPONSE (magentic) Manager agent detects outage → creates initial ledger: Task 1: Identify root cause Task 2: Restore service Task 3: Communicate to stakeholders Manager delegates Task 1 to Diagnostics Agent: Diagnostics: "Found database connection failure" Manager UPDATES LEDGER: Task 1: ✓ (root cause = DB connection) Task 2: Changed from "rollback deployment" to "restore DB connection" Task 3: NEW — "Notify DB team" (added after learning root cause) Task 4: NEW — "Review connection pool config" (added) Manager delegates revised tasks to different agents... ...continues until all tasks complete and service is restored.

The Task Ledger: The Key Innovation

The task ledger is what makes magentic different from all other patterns. It's a living document:

task_ledger = {
    "goal": "Analyze and recommend improvements for SBIN stock position",
    "tasks": [
        {"id": 1, "desc": "Get current price", "status": "done", "result": "₹1,054"},
        {"id": 2, "desc": "Get financials", "status": "done", "result": "Revenue up 18%"},
        {"id": 3, "desc": "Get peer comparison", "status": "in_progress", "agent": "market_agent"},
        {"id": 4, "desc": "Check RBI policy impact", "status": "new", 
         "note": "Added after learning NIM is compressed"},
        {"id": 5, "desc": "Calculate fair value", "status": "pending"},
    ],
    "revisions": [
        "Added task 4 after discovering NIM compression in financials",
        "Changed task 3 from 'get analyst ratings' to 'get peer comparison' for relevance"
    ]
}

The manager agent builds this ledger, revises it as it learns, and delegates tasks to specialists. It's the most human-like approach — exactly how a project manager works.

When to Use vs Avoid

Use whenAvoid when
Open-ended problem, no clear pathSolution path is known — use simpler pattern
Need to produce a reviewable planTime-sensitive (magentic is SLOW)
Agents have tools that change external systemsTask has low complexity
Requirements emerge during executionFrequent stalls expected
Warning

Magentic is the most expensive pattern. The manager agent iterates many times, calls multiple specialists, and revises the plan. Microsoft notes: "The pattern focuses on building and debating viable plans, not optimizing for speed."

The one-sentence summary

Magentic orchestration is the most advanced pattern — a manager agent builds and revises a task plan dynamically, adding/removing tasks as it learns — best for open-ended problems but slow and expensive.

Practice Drill

  1. Think of a BA problem that fits magentic: one where you can't predict the steps. Example: "Investigate why user satisfaction dropped in Q3" — you don't know if it's a product issue, support issue, or data issue until you start investigating.
  2. Sketch the task ledger for that problem. What are the initial tasks? What tasks might emerge after the first round of investigation?
  3. Compare: could you solve this with sequential? Handoff? Why does magentic fit better?
⚡ Quick Check
Q1: What's the task ledger and why is it the key innovation?
Show answer

The task ledger is a living document the manager agent maintains. It starts with high-level goals, then gets specific tasks added, removed, and reordered as the manager learns from specialist agents. No other pattern has this — sequential has a fixed plan, handoff has dynamic routing but no plan structure, group chat has discussion but no task tracking. The ledger makes the plan visible and revisable.

Q2: When is magentic overkill?
Show answer

When the solution path is known. If you know the steps are "get price → get financials → get peers → calculate → recommend," use sequential. If you know it's "4 independent analyses combined," use concurrent. Magentic is for when you CAN'T predict the steps — the plan must emerge during execution.

Want to see these patterns in action?

Explore the live apps built with these agent architectures.

Explore the Lab →

← Back to Deep Expertise Track