Microsoft Agent Framework: Multi-Agent Patterns with Azure AI Foundry
Multi-agent patterns in the Microsoft Agent Framework — orchestrator-worker, sequential and concurrent handoffs, shared blackboard state and A2A — wired into Azure AI Foundry for deployment, RBAC, tracing and evaluation.
Published on • November 16, 2026
AI Assistant

One agent is a function call with a personality. The moment you need a writer and a reviewer and a compliance checker, you are no longer asking “which model?” — you are asking which pattern. Get it wrong and you get an in-process chat room where three agents agree and ship the same mistake.
The Agent Framework overview exists for that gap: it combines AutoGen’s simple agent abstractions with Semantic Kernel’s enterprise features — session state, middleware, telemetry — and adds graph-based workflows with explicit execution paths.
In this post, you will learn the recurring multi-agent patterns — orchestrator-worker, sequential and concurrent handoffs, shared blackboard state, and agent-to-agent (A2A) calls across service boundaries — in the Python agent-framework package, and how Azure AI Foundry (now Microsoft Foundry) supplies the deployments, RBAC, tracing, and evaluation underneath.
Prerequisites
- Python 3.11+ and
pip install agent-framework. - An Azure subscription with a Microsoft Foundry project and one model deployment; set
FOUNDRY_PROJECT_ENDPOINTandFOUNDRY_MODEL. pip install azure-identityplus an authenticatedaz loginfor the flow below.- Comfortable with
asyncioand Python typing. - For the A2A section:
pip install --pre agent-framework-a2a starlette uvicorn.
One API note: use the unified agent_framework package; the older autogen.agentchat / mae style is superseded — see the AutoGen and Semantic Kernel migration guides. The patterns transfer unchanged.
The Pattern Map: Which Orchestration When
The workflow orchestrations page lists five built-in multi-agent patterns. Choosing between them is an architecture decision, not a preference:
| Pattern | Mechanics | Reach for it when… |
|---|---|---|
| Sequential | Agents execute one after another in a defined order | Fixed stages; each output feeds the next |
| Concurrent | Agents execute in parallel | Stages are independent — fan out, then merge |
| Handoff | Agents transfer control to each other based on context | Routing is conversational and data-dependent (triage → specialist) |
| Group Chat | Agents collaborate in a shared conversation | You want deliberation, and can bound the rounds |
| Magentic | A manager agent dynamically coordinates specialized agents | The plan is not knowable up front |
Orchestrations support human-in-the-loop via approval-required tools that pause for review — essential around production side effects. On choosing: an agent for open-ended tasks, a workflow when steps are well-defined and you need explicit control — and bluntly, if you can write a function to handle the task, do that instead.
Pattern 1: The Sequential Pipeline (Verified WorkflowBuilder Code)
The Agents in Workflows tutorial is the canonical starting point: WorkflowBuilder, explicit edges, streaming output — which this snippet follows directly.
# patterns/sequential.py
import asyncio
import os
from agent_framework import AgentResponseUpdate, WorkflowBuilder
from agent_framework.foundry import FoundryChatClient
from azure.identity import AzureCliCredential
async def main() -> None:
# One shared client -> same deployment + credential for all agents
client = FoundryChatClient(
project_endpoint=os.environ["FOUNDRY_PROJECT_ENDPOINT"],
model=os.environ["FOUNDRY_MODEL"],
credential=AzureCliCredential(),
)
drafter = client.as_agent(
name="Drafter",
instructions="You write a first draft. Be concise and concrete.",
)
reviewer = client.as_agent(
name="Reviewer",
instructions="You give actionable feedback on the draft. Be terse.",
)
# Edges define the execution graph — the explicit control MAF adds
workflow = (
WorkflowBuilder(start_executor=drafter)
.add_edge(drafter, reviewer)
.build()
)
last_author = None
async for event in workflow.run("Draft a release note for v2.3.", stream=True):
if event.type == "output" and isinstance(event.data, AgentResponseUpdate):
update = event.data
if update.author_name != last_author:
print(f"\n{update.author_name}:", end=" ")
last_author = update.author_name
print(update.text, end="", flush=True)
if __name__ == "__main__":
asyncio.run(main())
add_edge is the primitive — the graph is the pattern; concurrency and routing are just different ways of connecting the same executors. FoundryChatClient matters too: deployment and auth live on the shared client, so agents inherit configuration instead of smuggling API keys per agent.
Pattern 2: Concurrent Fan-Out
Independent stages — parallel triage, multiple rubric evaluations — run concurrently and merge; the docs’ concurrent orchestration is built in; plain Python uses a gather over agent.run:
# patterns/concurrent.py
import asyncio
import os
from agent_framework import Agent
from agent_framework.foundry import FoundryChatClient
from azure.identity import AzureCliCredential
async def main() -> None:
client = FoundryChatClient(
project_endpoint=os.environ["FOUNDRY_PROJECT_ENDPOINT"],
model=os.environ["FOUNDRY_MODEL"],
credential=AzureCliCredential(),
)
rubrics = {
"accuracy": Agent(client=client, name="accuracy",
instructions="Score factual accuracy 1-5 with one reason."),
"tone": Agent(client=client, name="tone",
instructions="Score tone 1-5 with one reason."),
"safety": Agent(client=client, name="safety",
instructions="Score policy safety 1-5 with one reason."),
}
draft = "We're thrilled to announce the absolute best release ever!!!"
results = await asyncio.gather(
*(agent.run(draft) for agent in rubrics.values()),
return_exceptions=True, # one failed judge must not kill the run
)
for name, result in zip(rubrics, results):
print(f"{name}: {result if not isinstance(result, Exception) else 'ERROR'}")
if __name__ == "__main__":
asyncio.run(main())
return_exceptions=True lets one failing judge degrade to a partial score instead of killing the run. Mind rate limits too: fanning out multiplies requests-per-minute against the deployment — exactly what Foundry’s token limits govern (below).
Pattern 3: Orchestrator-Worker (Magentic)
Magentic — “a manager agent dynamically coordinates specialized agents” — is orchestrator-worker: the plan emerges at runtime, a manager holds the goal, delegates to specialists, and decides when the work is done.
# patterns/orchestrator_worker.py
import asyncio
import os
from agent_framework import Agent, ToolCallResult # names may vary by version
from agent_framework.foundry import FoundryChatClient
from azure.identity import AzureCliCredential
async def main() -> None:
client = FoundryChatClient(
project_endpoint=os.environ["FOUNDRY_PROJECT_ENDPOINT"],
model=os.environ["FOUNDRY_MODEL"],
credential=AzureCliCredential(),
)
retrieval = client.as_agent(
name="retrieval",
instructions="Answer only from the provided documents. Cite doc ids.",
)
policy = client.as_agent(
name="policy",
instructions="Check the answer against the compliance rules. Output pass/fail with reasons.",
)
# Illustrative: expose specialists to the manager as callable tools —
# verify the exact registration API for your installed version.
manager = client.as_agent(
name="orchestrator",
instructions=(
"Plan the task. Delegate retrieval first, then policy review. "
"Iterate until policy returns pass or you have tried twice."
),
tools=[retrieval.as_tool(), policy.as_tool()],
)
result = await manager.run(
"Summarize the refund window from the docs and confirm the draft complies."
)
print(result)
if __name__ == "__main__":
asyncio.run(main())
API caution: the
as_tool()shape is the pattern; exact helper names vary across preview versions — verify against your installed package (dir(agent_framework)) and the tools documentation. The invariant: the manager delegates through explicit calls, not free-form conversation.
Pattern 4: Shared Blackboard State
There is no Blackboard class in Agent Framework. Per the overview, assemble it from what exists: agent sessions for state, context providers for memory, workflows with explicit paths.
The recipe: put shared state in one session-backed store or DB row keyed by run ID; give every worker a typed read/write contract (e.g. findings: list[Finding]) not free-form mutation; carry the run ID so a resumed run sees the same board after a crash; log every write — a blackboard without provenance is an unattributable rumor.
# patterns/blackboard.py
from dataclasses import dataclass, field
from datetime import datetime, timezone
@dataclass
class RunBoard:
run_id: str
goal: str
artifacts: dict[str, str] = field(default_factory=dict)
decisions: list[tuple[str, str, str]] = field(default_factory=list) # (agent, decision, why)
updated_at: str = ""
def record(self, agent: str, decision: str, why: str) -> None:
self.decisions.append((agent, decision, why))
self.updated_at = datetime.now(timezone.utc).isoformat()
board = RunBoard(run_id="wf-2026-11-16-001", goal="publish release notes")
# drafter writes artifacts; reviewer appends a decision;
# orchestrator reads both before terminating.
Edges lose information when an agent must read everything decided so far — the board is that memory, and what your audit log replays.
Pattern 5: Handoffs
The handoff pattern is built in: “agents transfer control to each other based on context.” Use it when routing is data-dependent — a triage agent handing billing to a specialist.
Rule of thumb: handoff when only one agent should speak next; group chat when several should deliberate; sequential when you already know the order. A router is a handoff; a review board is group chat with bounded rounds.
Pattern 6: A2A Across Boundaries
Everything above assumes one process. Cross a process, service, team, or organizational boundary and the A2A integration takes over: A2AAgent wraps any A2A-compliant endpoint as a standard AIAgent — remote agents answer to the same run/run_streaming calls, whatever framework or language built them.
# patterns/a2a_client.py
# pip install --pre agent-framework-a2a
from agent_framework.a2a import A2AAgent # verify the import path in your version
async def main() -> None:
# Discover the remote agent's card at {domain}/.well-known/agent-card.json
remote = A2AAgent(url="https://compliance-agent.partner.example.com")
result = await remote.run("Review this vendor contract clause set.")
print(result)
Memorize the decision rule: same process, same team → agents-as-tools, simpler and cheaper. A2A earns its complexity only across a boundary — a partner agent whose code you cannot see, a separate service, a third-party provider.
The reverse direction exists too: agent-framework-a2a ships an A2AExecutor that exposes your agent as a server. Verify trust in the endpoint and its operator before connecting — the docs warn explicitly.
Azure AI Foundry: Where the Patterns Meet Production
Patterns run on infrastructure; Microsoft Foundry (the current name for Azure AI Foundry) supplies it:
- Model deployment.
FoundryChatClient(project_endpoint=..., model=...)points every agent at a deployment, not a raw model name — capacity, version pinning, and placement become platform concerns. - RBAC and identity. Project access runs through Azure role assignments; swap the samples’
AzureCliCredentialfor a managed or workload identity in production. Least privilege: the workflow needs model inference on one deployment, not contributor on the subscription. - Tracing and evaluation. The Foundry docs expose agent tracing, evaluation of agentic workflows, and a monitoring dashboard. This is where blackboard and platform reconcile: pattern-level decisions in your board, token-level behavior in the trace.
- Control plane and governance. Managing agents at scale, enforcing token limits, and Content Safety guard a fan-out before a runaway loop drains the budget.
- Production hosting. Foundry Agent Service hosts agents; hosting guides cover self-hosting, durable extensions, and A2A exposure.
Putting It All Together
A production-shaped assembly: a sequential draft→review workflow (Pattern 1) with a concurrent rubric fan-out inside review (Pattern 2), an orchestrator owning termination (Pattern 3), a typed blackboard for decisions (Pattern 4), a partner’s compliance agent over A2A (Pattern 6) — on a Foundry project behind RBAC with tracing on.
FoundryChatClient (project endpoint + managed identity + RBAC)
│
▼
WorkflowBuilder: drafter ──add_edge──► reviewer ──► orchestrator
│ │
▼ ▼
RunBoard (typed, audited) ◄──── decisions + artifacts
│
├──► A2AAgent → partner compliance service (cross-org boundary)
│
▼
Foundry tracing / evaluation dashboard / token limits
…then the orchestrator reads the board, sees policy pass, and terminates — every decision attributable to an agent, a reason, and a trace.
Conclusion and Next Steps
You now have the pattern vocabulary and the code: sequential pipelines via WorkflowBuilder.add_edge, safe concurrent fan-out, an orchestrator-worker loop that owns termination, a typed blackboard for shared state, A2A across boundaries, and the Foundry layer — deployments, RBAC, tracing, evaluation, token limits, hosting — underneath.
Homework:
- Add human-in-the-loop via approval-required tools — the orchestrations doc has a sequential HITL tutorial to follow.
- Build an eval set for your multi-agent graph and run it from CI with Foundry’s tooling; a pattern change without a regression score is a guess.
- Put A2A behind auth. Expose one agent with
agent-framework-a2aand call it from a second, separately authenticated process — that surfaces session and task-boundary questions early. - Load-test your fan-out and set deployment token limits before the first incident.
Patterns are not decoration. Pick the one that matches your process shape, and let the platform handle the rest.