Use sequential orchestration
Unit 5 of 10 · Module 14: Orchestrate a multi-agent solution using the Microsoft Agent Framework
Before you start
Short explainers for ideas this lesson builds on. Watch these first if they're new to you.
Read this lesson
The assembly line
On an old car assembly line, the frame goes to welding, then painting, then trim, always in that order. Sequential orchestration is a line of agents like that: each one works on the task and passes it to the next. It suits jobs where each step depends on the one before, like reviewing documents, transforming data in stages, or reasoning step by step. The order is fixed before it starts; the agents don't choose what comes next.
When it fits, and when it doesn't
Use it when a process has clear stages in a set order, when each stage adds something the next one needs, when stages can't run side by side, or when you're refining work, like draft, review, polish. It also helps when you know how each agent performs and can cope if one step is slow or fails. Skip it when stages could run in parallel, when one agent could do the whole job, when a bad early step would spoil everything after it with no way to catch it, or when agents need to go back and forth or change route based on what they find.
In code
In code, create the agents, say a writer and a reviewer, then pass them to SequentialBuilder as participants, in the order they should run, and build it. Run the workflow with a task, like writing a tagline for a budget electric bike. By default, each agent sees the whole conversation so far, and the final output is the last agent's response. Set chain_only_agent_responses if each agent should see just the previous agent's answer, which suits translation chains. Set output_from to all to collect every agent's answer, or use streaming to watch each step as it happens. And if a person should check a step, add request info for that agent, or put approval mode on a risky tool.
Facts from Microsoft's documentation: Workflow orchestrations in Agent Framework; Sequential orchestration (CC BY 4.0), rewritten in Loop's own words and examples. Narration, animation, and quiz by Loop. Microsoft, Azure, and Microsoft Foundry are trademarks of Microsoft. Loop is independent and not affiliated with or endorsed by Microsoft.