Your profile

One profile for every MSDEVBUILD site. Only you can see it, and the site owner if you write in.

Lesson 19 of 39
❮Prev Next❯

Multi-Agent Orchestration

Module 2: GenAI & Agents ⏱ 12 min read Updated

Your note

My notes for this lesson

Select any text in the lesson to highlight it or add a note. Saved in this browser.

    No highlights yet. Select a sentence in the lesson, then pick a colour or add a note.

    All my bookmarks and notes

    Reading settings

    For every lesson, saved in this browser.

    Text size
    Line spacing
    Font

    With IaaS you rent the virtual machine. Microsoft looks after the building, power and hardware; you patch the operating system.

    30-second answer

    Multi-agent orchestration shares a job between specialist agents. In Microsoft Agent Framework you pick the pattern by who decides the next step: sequential (a fixed line), concurrent (parallel, then merged), handoff (the current agent passes control), group chat (a manager picks the next speaker) or Magentic (a manager plans and delegates open-ended work). Start with one agent and split only when instructions or tools start to collide.

    Simulate it » No Azure account needed

    Exam objective: 2.2.4 Implement orchestrated multi-agent solutions. (Skills measured as of April 16, 2026)

    Simulations

    Feel it before you read it. No account needed, nothing leaves this page.

    Azure portal: Connect specialist agents in a workflow Build a workflow of connected agents.
    </> Embed

    Embed this simulation

    Free for trainers, teachers and bloggers. Paste this into your page:

    Loading the portal…

    Open <strong>Build ➜ Workflows</strong> and create a workflow of agents.

    👆 Click the glowing item in the portal to continue

    Read the steps as text
    1. Open Build ➜ Workflows and create a workflow of agents.
    2. Give each agent one narrow job with its own instructions and tools. Small agents are easier to test than one agent that does everything.
    3. Pick the orchestration pattern. Sequential is a fixed line, concurrent fans out and merges, handoff passes control, group chat has a manager picking speakers, and Magentic plans open-ended work.
    4. Run it. The trace shows each agent’s turn, so you can see where the answer went wrong when it does.

    🧪 Simulation for learning. Screens are simplified versions of the Azure portal; names, prices and IDs are examples. Nothing here touches real Azure.

    😟 THE PROBLEM

    A single agent with fifteen tools picks the wrong one and its instructions keep growing.

    😊 THE SOLUTION

    Split the work between specialist agents and choose an orchestration pattern.

    • Draft, then review✓ Sequential
    • Independent checks✓ Concurrent
    • Route to the right specialist✓ Handoff
    🛠️ Solved with: Microsoft Agent Framework

    Start with a question

    Who answers when a customer says, charged twice and still no parcel?

    At a good service desk nobody handles everything. A receptionist listens, a billing clerk checks the charge, a delivery clerk checks the parcel, and someone writes one clear reply. Which clerk speaks first, and whether they work together or one after another, is a decision about the process.

    Multi-agent orchestration is that process for AI agents. Each agent has a narrow job, and the pattern says who goes next.

    Explain it like I’m 10

    The technical explanation

    Pick the pattern by who decides the next step

    PatternWho decidesGood forWatch out
    SequentialYou, in advanceDraft, then reviewTime adds up
    ConcurrentYou, in advanceIndependent checks, speedResults must be merged
    HandoffThe current agentTriage to a specialistThe route depends on the conversation
    Group chatA manager picks the speakerDebate and refinementSet a maximum number of rounds
    MagenticA manager plans and delegatesOpen-ended tasksMost calls, least predictable

    Build it with Microsoft Agent Framework

    # pip install agent-framework-foundry azure-identity
    from azure.identity import AzureCliCredential
    from agent_framework.foundry import FoundryChatClient
    from agent_framework.orchestrations import SequentialBuilder, ConcurrentBuilder
    
    client = FoundryChatClient(project_endpoint=os.environ["FOUNDRY_PROJECT_ENDPOINT"],
                               model="support-chat", credential=AzureCliCredential())
    triage   = client.as_agent(name="triage",   instructions="Work out what the customer needs. Don't answer it yourself.")
    billing  = client.as_agent(name="billing",  instructions="Answer billing and refund questions from the policy.")
    delivery = client.as_agent(name="delivery", instructions="Answer delivery questions. Use get_order_status.")
    writer   = client.as_agent(name="writer",   instructions="Write one friendly reply from the specialists' notes.")
    reviewer = client.as_agent(name="reviewer", instructions="Check the reply against policy. Say APPROVED or list fixes.")
    
    line     = SequentialBuilder(participants=[triage, writer, reviewer]).build()
    parallel = ConcurrentBuilder(participants=[billing, delivery]).build()      # fan out, then aggregate
    # handoff, group chat and Magentic use HandoffBuilder, GroupChatBuilder and MagenticBuilder

    Each agent keeps its own short instructions and only the tools it needs. That’s the main reason to split: the billing agent never sees the delivery tool, so it can’t call it by mistake.

    Design rules that save you

    1. Start with one agent. Split when instructions get long or tools collide.
    2. Narrow jobs. “Billing” beats “customer helper”.
    3. Limit rounds in group chat and Magentic, and set timeouts.
    4. Trace every turn. When the answer is wrong you need to see which agent said what.
    5. Evaluate the whole flow, not just each agent.

    Foundry’s portal also lets you wire agents into a workflow visually (preview as of 25 November 2026). The orchestration patterns above are the same ideas in code.

    Architect level Cost and latency add up

    Every extra agent turn is another model call. A five-agent sequential pipeline pays five latencies in a row, and a group chat of six rounds may call the model dozens of times. Concurrent runs cut waiting but not tokens. Measure with traces, use small models for narrow agents such as triage, and keep the large model for the agent that needs it.

    Real-world business scenario

    Retail

    Fabrikam Retail (fictional)

    The problem
    One support agent had eleven tools and long instructions. It picked the wrong tool for billing questions and its replies were inconsistent.
    What they used
    Five agents built with Microsoft Agent Framework on Foundry models: a triage agent hands off to billing or delivery, both can run concurrently for combined cases, and a writer and reviewer finish sequentially.
    Why that choice
    Each agent has short instructions and two or three tools, and the pattern decides who speaks, so mistakes are easier to find in the trace.
    The result
    Tool-choice errors fell sharply, and the reviewer step caught replies that broke policy before customers saw them.

    When to use it and when not to

    ✓ Use it when…

    • Different parts of the job need different tools, rules or models.
    • Independent checks can run in parallel to save time.
    • You want each specialist to be tested and replaced on its own.

    ✕ Think twice when…

    • One agent with a few tools already works. Keep it simple.
    • The task is a fixed script. A workflow of steps is clearer.
    • You can't afford extra latency and tokens for several model calls.

    ↔ Alternatives to consider

    • A single agent with a small set of tools.
    • A workflow of fixed steps and checks.
    • Routing to one model or agent based on the request.
    Ready for more?The full lesson adds the technical explanation, when to use it, interview questions and revision notes.

    Test yourself with exercises

    5 original practice questions in the AI-103 style. Pick your answers, then check them. You will see why each option is right or wrong. Score 75% or more and this topic is marked complete.

    Question 1

    Question 1 of 5

    A drafting agent writes a reply and a reviewing agent must check it afterwards. The order never changes.

    Which pattern should you use?

    Question 2

    Question 2 of 5

    A billing agent and a delivery agent must analyse the same customer message at the same time, and the results are combined.

    Which pattern should you use?

    Question 3

    Question 3 of 5

    A triage agent must pass the conversation to whichever specialist agent suits the request.

    Which pattern should you use?

    Question 4

    Question 4 of 5

    A research task has no known steps. A manager agent must create a plan, delegate tasks and track progress.

    Which pattern should you use?

    Question 5

    Question 5 of 5

    A developer wants builders for sequential, concurrent, handoff, group chat and Magentic orchestrations in Python.

    Which SDK provides them?

    Interview preparation

    Say your answer out loud first, then open the model answer. Interviewers care more about your reasoning than the exact words.

    Beginner Why use several agents instead of one?

    Model answer

    Each agent gets a narrow job, short instructions and only the tools it needs. That makes each easier to test and less likely to pick the wrong tool than one agent that does everything.

    Intermediate When is concurrent better than sequential?

    Model answer

    When the tasks don't depend on each other. Billing and delivery checks can run at the same time, and the total time is about the slower one. If the second task needs the first one's output, it has to be sequential.

    Experienced developer What are the risks of group chat and Magentic?

    Model answer

    They're the least predictable, use the most model calls and take the longest. I set a maximum number of rounds, log every turn, and use them only when I can't write the steps in advance.

    Scenario A customer was charged twice and the order never arrived. Which pattern?

    Model answer

    Concurrent is a good fit if a billing agent and a delivery agent can investigate independently and a writer merges the notes. If triage must first decide who should handle it, handoff fits.

    Quick revision

    Key points

    • Choose the pattern by who decides the next step.
    • Sequential is a fixed pipeline; concurrent fans out and merges.
    • Handoff moves control to the best agent for the conversation.
    • Group chat and Magentic use a manager and are the least predictable.
    • One agent with good tools is often enough.

    Important terminology

    Orchestration
    The logic that decides which agent runs next and how their outputs combine.
    Sequential
    Agents run in a fixed order, each receiving the previous output.
    Concurrent
    Agents run at the same time on the same input and the results are aggregated.
    Handoff
    The current agent transfers control of the conversation to a better-suited agent.
    Magentic
    A pattern where a manager agent builds a plan, delegates tasks to specialists and tracks progress.
    Microsoft Agent Framework
    An open-source SDK for Python and .NET to build agents and multi-agent workflows.

    Common mistakes

    • Using Magentic for a task with known steps.
    • Running dependent tasks concurrently.
    • No limit on rounds or turns.

    Exam tips

    • "Fixed order, each builds on the last" = sequential.
    • "Same input to several agents, combine results" = concurrent.
    • "Manager plans and delegates open-ended work" = Magentic.

    Five quick revision questions

    1. 1.Which pattern is a fixed pipeline?Show

      Sequential.

    2. 2.Which runs agents in parallel?Show

      Concurrent.

    3. 3.Which moves control between agents?Show

      Handoff.

    4. 4.Which uses a planning manager?Show

      Magentic.

    5. 5.Which SDK has these builders?Show

      Microsoft Agent Framework.

    Official references

    Finished this lesson? Tick it off. Your progress is saved in this browser.

    Next up: Autonomous Agents with Safeguards and Approvals

    Studying with a friend? Send them this lesson

    It's free and needs no sign-up. Their progress saves in their own browser.

    Lesson done? Make it stick with a quick gameSort It, Match the Pairs, Lightning Round and Who Am I? Earn XP and badges. Play ❯

    Install MSDEVBUILD Azure

    Free · no account · works offline

    Save the whole course for offline ›

    Hi, I’m your Nimbus

    Your study buddy. Pick what we do next.

    MSDEVBUILD · Multi-Stack Dev Build

    Sign in to MSDEVBUILD

    One account for Azure certifications and the blog: sign in here and you are signed in on both. Your XP, streak, practice deck and certificate stay in sync on every device. Optional: everything works without an account.