Jump to content

Connect Leeroopedia MCP: Equip your AI agents to search best practices, build plans, verify code, diagnose failures, and look up hyperparameter defaults.

Workflow:Microsoft Agent framework Multi Agent Concurrent Orchestration

From Leeroopedia
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 running in parallel with fan-out dispatch and fan-in aggregation of results.

Description

This workflow demonstrates the concurrent orchestration pattern using the ConcurrentBuilder from the agent-framework-orchestrations package. Multiple agents with different expertise areas (such as a researcher, a marketer, and a legal analyst) are executed simultaneously against the same prompt. The framework dispatches the input to all participants in parallel, collects their individual responses, and aggregates them into a combined output. A custom aggregator callback can optionally synthesize the diverse perspectives into a unified summary using an LLM.

Usage

Execute this workflow when you need diverse expert perspectives on the same input gathered simultaneously. Common scenarios include multi-disciplinary analysis (research, marketing, and legal review of a business proposal), parallel document review by different specialists, brainstorming from multiple creative personas, and any task where independent parallel processing reduces latency compared to sequential execution. You need at least two agents with complementary expertise areas.

Execution Steps

Step 1: Create specialized agents with domain expertise

Define multiple agents, each with a distinct area of expertise and focused instructions. Each agent should represent a different perspective or skill set relevant to the task. The agents will receive the same input independently and should not depend on each other's output.

Key considerations:

  • Each agent needs a unique name and domain-specific instructions
  • Agents operate independently and do not see each other's responses
  • Different agents can use different LLM providers if needed
  • Agents can have domain-specific tools for their area of expertise

Step 2: Build the concurrent workflow

Use ConcurrentBuilder to create a parallel execution workflow. Pass the list of agent participants. The builder creates internal adapters that broadcast the input to all agents simultaneously and collect their responses.

Key considerations:

  • All agents receive the same input prompt
  • The default aggregator concatenates all agent responses into a list of Messages
  • Use .with_aggregator(callback) to customize how results are combined
  • The resulting workflow is reusable for multiple queries

Step 3: Optionally configure a custom aggregator

For scenarios where a unified synthesis is preferred over raw concatenation, provide a custom aggregator callback. This callback receives the list of Messages from all agents and can use an LLM to summarize, reconcile conflicting viewpoints, or extract key themes across the expert responses.

Key considerations:

  • The aggregator callback receives list of Messages from all participants
  • Use an LLM call within the aggregator to synthesize diverse perspectives
  • The aggregator can filter, rank, or restructure the combined output
  • Without a custom aggregator, the default returns the raw concatenated messages

Step 4: Run the workflow with streaming

Execute the workflow by calling workflow.run() with the prompt and stream=True. Events arrive from multiple agents concurrently, each tagged with the source agent name. The streaming mode provides real-time visibility into all agents' progress simultaneously.

Key considerations:

  • Events include author metadata to attribute responses to specific agents
  • All agents process in parallel, reducing total latency
  • The workflow completes when all participants have finished
  • The aggregator runs after all individual responses are collected

Step 5: Process the aggregated output

After all agents complete and the aggregator runs, the final output contains either the concatenated messages or the custom-aggregated synthesis. The application can display each agent's contribution separately or present the unified summary.

Key considerations:

  • The final output preserves agent attribution for each contribution
  • Custom aggregation produces a single synthesized response
  • Results can be stored, displayed, or passed to downstream processing
  • The workflow can be wrapped as an agent using .as_agent() for composition

Execution Diagram

GitHub URL

Workflow Repository