Workflow:Microsoft Agent framework Multi Agent Sequential Orchestration
| Knowledge Sources | |
|---|---|
| Domains | AI_Agents, Multi_Agent_Systems, LLM_Ops, Python |
| Last Updated | 2026-02-11 17:00 GMT |
Overview
End-to-end process for orchestrating multiple specialized AI agents in a sequential pipeline where each agent receives the shared conversation history and adds its contribution before passing to the next.
Description
This workflow demonstrates the sequential orchestration pattern using the SequentialBuilder from the agent-framework-orchestrations package. Multiple agents with distinct roles (such as a content writer and a critical reviewer) are chained in a linear pipeline. Each agent receives the full conversation history accumulated by previous agents in the chain, adds its own response, and passes the enriched context forward. The SequentialBuilder handles all the internal wiring: normalizing input into a conversation format, routing messages between agents, and collecting the final output as a list of Messages.
Usage
Execute this workflow when you need multiple agents to collaborate on a task in a defined order, where each agent's output informs the next. Common scenarios include content creation pipelines (write then review then edit), analysis chains (research then summarize then recommend), and multi-step reasoning (plan then execute then validate). You need at least two agents with complementary roles and a task that benefits from sequential refinement.
Execution Steps
Step 1: Create specialized agents
Define multiple agents with distinct roles and instructions. Each agent should have a clear, focused persona that contributes a specific capability to the pipeline. Use the chat client's .as_agent() convenience method or the Agent constructor directly, providing a unique name and detailed instructions for each agent.
Key considerations:
- Each agent needs a unique name for identification in the conversation
- Instructions should be specific to the agent's role in the pipeline
- All agents can use the same or different chat clients and LLM providers
- Agents can optionally have their own tools for domain-specific capabilities
Step 2: Build the sequential workflow
Use SequentialBuilder to wire the agents into a sequential pipeline. Pass the list of agent participants in the desired execution order. The builder creates internal adapters that normalize the input, route conversation context between agents, and collect the final output.
Key considerations:
- The participants list order determines execution order
- The builder internally creates input-conversation, to-conversation, and complete adapters
- Each agent sees the full conversation history from all previous agents
- The resulting workflow object is reusable for multiple runs
Step 3: Run the workflow with streaming
Execute the workflow by calling workflow.run() with the user prompt and stream=True. Iterate over the async event stream to receive real-time updates from each agent as it generates its response. Filter events by type to extract output messages.
Key considerations:
- Events with type "output" contain AgentResponseUpdate objects
- Each update includes the author agent name for attribution
- The streaming mode provides real-time feedback as each agent works
- Non-streaming mode is also available by omitting stream=True
Step 4: Process the final conversation
After all agents have completed, the workflow yields the final output containing the complete conversation as a list of Messages. Each message is attributed to its source agent, allowing the application to display the full multi-agent dialogue or extract the final agent's conclusion.
Key considerations:
- The output is a list of Message objects with role and author metadata
- The last message typically contains the final refined output
- The conversation can be stored, displayed, or passed to further processing
- The workflow can be wrapped as an agent using .as_agent() for nested composition