---
schema_version: "1"
id: 558523634931d1096142563ef05a4d40d3b1c38fb67e1e14d59f62fb4be74106
title: Orchestrating Multi-Agent Processes with Agent Networks
collection: mulesoft
version: current
locale: en-us
portal_url: https://docs.salesforce.com/mulesoft/current/en-us/agent-network/latest/af-use-case-orchestration.md
canonical_url: https://docs.mulesoft.com/agent-network/latest/af-use-case-orchestration
source_site: docs.mulesoft.com
content_type: documentation
content_hash: 02747202e1c37043b0b92cb771525a6232f07e286c6affa9f9bb8a18b71deb88
description: MuleSoft Documentation Site
release: "2.0"
latest: true
---
---
product: Building Agent Networks
version: 2.0
is-latest-version: true
---

# Orchestrating Multi-Agent Processes with Agent Networks

> For the full documentation index, see: https://docs.mulesoft.com/llms.txt

Agent brokers and agent networks coordinate task delegation across specialized agents with guided
determinism. This coordination produces reliable, predictable outcomes from complex business
processes. You define broker routing logic in Agent Script and configure the network composition in
`agent-network.yaml`. This file brings agents, LLMs, and MCP servers together in a single
coordinated system. Use this approach when a single agent can’t handle the process and your business
process requires multiple specialized agents working in sequence or in parallel.

## The Problem

A single agent can handle straightforward tasks, but complex business processes expose the limits of
working with one agent in isolation:

- Specialization gaps: One agent can’t excel at research, financial analysis, regulatory review, and
  customer communication simultaneously.

- No intelligent routing: Without a broker, there’s no component to match an incoming request to the
  right specialist agent based on context.

- Process reliability: Multi-step processes that involve multiple agents and systems are difficult
  to make reliable and predictable without explicit coordination.

- Opaque execution: When something goes wrong in a multi-agent process, it’s hard to know which
  agent failed, why, and what state the process was in.

- Duplication: Teams that build similar multi-agent processes independently create inconsistent
  behavior and duplicated effort.

Making a single agent smarter doesn’t solve these challenges. They require a coordination layer—an
agent network with a broker.

## The Solution

Agent Fabric’s agent brokers and agent networks provide a coordination layer for multi-agent
processes:

- Agent networks: A YAML-configured composition of agents, brokers, LLMs, and MCP servers that
  defines the structure of your agentic solution.

- Agent brokers: Intelligent routing services, defined in Agent Script, that delegate tasks to the
  right A2A-compliant agent based on context.

- Guided determinism: Graph-based broker logic makes sure that tasks follow defined paths, handling
  both expected outcomes and error conditions.

- Anypoint Exchange integration: Published agent networks and brokers appear in Exchange for
  discovery and reuse across your organization.

- Integrated observability: Agent Visualizer displays the network topology, real-time request flows,
  and performance metrics for the entire network.

Key benefits of agent networks and brokers include:

- Reliable outcomes from complex processes: Graph-based routing runs operations in the correct order
  with defined paths for both expected outcomes and error conditions, so multi-step processes behave
  predictably instead of drifting.

- Better results by using the right specialist: Route each task to the agent best suited to handle
  it, instead of stretching one agent to do everything and accepting weaker output on every task.

- Build once, reuse across teams: Publish brokers and agent networks to Exchange so other teams
  compose them into their own networks rather than rebuilding the same process.

- Know exactly where a process failed: Monitor broker routing decisions, agent performance, and
  request flows with Agent Visualizer, so a failure points to the agent and step that caused it.

- Start small, scale when ready: Begin with a simple agent network and add brokers as complexity
  grows. You don’t need a broker to get started, so there’s no upfront coordination cost.

## How Agent Brokers Work

When a request arrives at a broker, it follows this path:

1.  A request arrives at the broker, either from an external caller or from another broker higher in
    the network.

2.  The broker evaluates the request against its routing logic, defined as a graph of nodes in Agent
    Script.

3.  The broker generates a context ID and task ID to track state across the interaction.

4.  The broker delegates the task to the A2A-compliant agent or sub-broker best suited to handle it.

5.  The assigned agent processes the task, calling LLMs and MCP servers as needed.

6.  Results return to the broker, which continues routing through the graph until the process is
    complete.

7.  The broker returns the final result to the original caller.

## Who This Is For

Agent brokers and agent networks are for:

- Teams building multi-agent solutions where tasks are routed across specialized agents based on
  context

- Companies that need reliable, predictable outcomes from complex processes spanning multiple agents
  and systems

- Architects designing reusable agentic components that other teams can discover and compose

- Teams that need end-to-end visibility into how multi-agent processes execute and where failures
  occur

## Example Scenarios

### Scenario 1: Order Processing

**Challenge:** Processing customer orders involves checking inventory, routing to fulfillment,
handling payment, and sending confirmation. Each step is handled by a specialized agent. Without
coordination, the process is fragile and hard to monitor.

Agent brokers and agent networks provide reliable coordination with clear routing logic:

1.  Define an agent network in `agent-network.yaml` that registers a broker, an inventory agent, a
    payment agent, and a fulfillment agent.

2.  Define the broker in Agent Script with nodes for each step and explicit routing logic for
    inventory shortfalls, payment failures, and partial fulfillment.

3.  Deploy the agent network to CloudHub 2.0.

4.  Monitor execution in Agent Visualizer to trace each step and identify where issues occur.

**Result:** Orders move through inventory, payment, and fulfillment on defined paths, with explicit
handling for shortfalls and payment failures instead of silent breakage. When a step fails, Agent
Visualizer shows which agent and which state, so recovery is fast rather than a guessing game.

### Scenario 2: Multi-Discipline Research

**Challenge:** Answering a strategic research question requires market analysis, competitive
intelligence, technical feasibility assessment, and financial modeling — capabilities that belong in
separate specialized agents.

With an agent network, a broker decomposes the request and coordinates the specialists:

1.  Define an agent network that registers market, competitive, technical, and financial analysis
    agents alongside a synthesis agent.

2.  Define a broker in Agent Script that routes each research sub-task to the appropriate specialist
    agent, then routes all results to the synthesis agent.

3.  The synthesis agent produces the final report from the aggregated specialist outputs.

4.  Agent Visualizer shows the routing path, which agents were called, and where time was spent.

**Result:** A strategic question is answered by four specialists working in parallel and synthesized
into one report. The report is faster and higher-quality than a single general-purpose agent, with a
visible trail of which analysis contributed what.

### Scenario 3: Document Processing Pipeline

**Challenge:** Processing incoming documents requires classification, data extraction, quality
validation, and routing for human review — in sequence, with defined rules for what happens when
quality thresholds aren’t met.

With guided determinism in Agent Script:

1.  Define an agent network that includes a classification agent, an extraction agent, and a review
    routing agent.

2.  Define a broker with nodes for each processing stage and explicit paths for low-confidence
    extractions that require human review.

3.  Deploy the network and monitor processing quality and throughput in Agent Visualizer.

**Result:** Documents flow through classification, extraction, and validation automatically, and
only low-confidence cases route to a human. Staff review the exceptions instead of every document,
and quality thresholds are enforced by the graph rather than left to chance.

### Scenario 4: Customer Support Triage

**Challenge:** Incoming support requests range from simple account questions to complex technical
issues and billing disputes. Each type requires a different specialized agent, and misrouting wastes
time.

With a broker handling intelligent triage:

1.  Define a broker in Agent Script that classifies the incoming request and routes it to the
    appropriate specialist: account agent, technical agent, or billing agent.

2.  Each specialist agent calls the relevant MCP servers to retrieve customer data, account history,
    or billing records.

3.  The broker consolidates the specialist’s response and returns it to the caller.

4.  Publish the agent network to Exchange so other teams can reuse the triage broker.

**Result:** Requests reach the right specialist on the first hop, so account, technical, and billing
issues stop bouncing between the wrong agents. Publishing the triage broker to Exchange lets other
teams adopt the same routing instead of rebuilding it.

## Implementation Steps

### Step 1: Map the Process

1.  List the steps in the process and identify which require specialized capabilities.

2.  Document decision points such as where the process branches based on outcomes or data.

3.  Identify which steps can run in parallel and which must be sequential.

4.  Determine what backend systems each agent needs to call, and whether MCP servers already expose
    those systems.

### Step 2: Design the Agent Network

1.  Identify which agents exist and which to build.

2.  Determine whether a broker is needed. If the process involves multiple specialists that are
    routed dynamically, add a broker.

3.  Sketch the broker graph: nodes represent steps, edges represent routing logic between them.

4.  Identify which LLMs agents use for reasoning and which MCP servers provide backend access.

### Step 3: Configure agent-network.yaml

1.  In Anypoint Code Builder, create a new agent network project.

2.  Configure `agent-network.yaml` to declare the registry (agents and MCP servers), context
    (connections), and brokers.

3.  For each broker, create an Agent Script file (`.agent`) that defines the routing graph and node
    behavior.

For more information, see
[Define Your Agent Network Specification](https://docs.mulesoft.com/agent-network/latest/af-define-your-agent-network-specification).

### Step 4: Deploy and Test

1.  Deploy the agent network to CloudHub 2.0.

2.  Send test requests that exercise each routing path in the broker graph.

3.  Verify that each agent receives the tasks it is responsible for.

4.  Test failure paths.

### Step 5: Monitor with Agent Visualizer

1.  Open Agent Visualizer to view the network topology and confirm that agents, brokers, and MCP
    servers are connected as expected.

2.  Send live requests and watch routing decisions in real time.

3.  Use performance metrics to identify latency, error rates, and bottlenecks.

4.  Review historical analysis to identify patterns and optimize routing logic.

For more information, see
[monitoring agent networks with Agent Visualizer](https://docs.mulesoft.com/agent-visualizer/troubleshoot-agent-network).

### Step 6: Publish for Reuse

1.  After validating the agent network, publish it to Exchange.

2.  Other teams can discover the published broker and reuse it as a component in their own agent
    networks.

3.  Apply Omni Gateway policies to the broker endpoint to enforce authentication, rate limiting, and
    audit logging.

## Broker Design Patterns

These patterns represent common approaches to structuring broker routing logic in Agent Script.

<table><colgroup><col> <col> <col></colgroup><thead><tr><th>Pattern</th><th>Description</th><th>When to Use</th></tr></thead><tbody><tr><td><p>Sequential Routing</p></td><td><p>Route a request through a fixed sequence of specialist agents, where each agent’s output is the input for the next.</p></td><td><p>Steps must run in order and each step depends on the previous result.</p></td></tr><tr><td><p>Parallel Dispatch</p></td><td><p>Dispatch a request to multiple specialist agents simultaneously and aggregate the results.</p></td><td><p>Sub-tasks are independent and can run concurrently for faster completion.</p></td></tr><tr><td><p>Conditional Routing</p></td><td><p>Route a request to different agents based on the content or classification of the request.</p></td><td><p>The right specialist depends on context that isn’t known until the request arrives.</p></td></tr><tr><td><p>Hierarchical Delegation</p></td><td><p>A broker delegates to another broker, which in turn delegates to specialist agents.</p></td><td><p>Complex processes can be decomposed into distinct sub-processes, each managed by its own broker.</p></td></tr></tbody></table>

## Security Considerations

When deploying agent networks and brokers in production:

- Apply Omni Gateway policies to broker endpoints to enforce authentication, rate limiting, and
  audit logging.

- Make sure that each specialist agent’s MCP server connections use appropriate authentication.

- Review which agents have access to which backend systems and apply the principle of least
  privilege to MCP tool selection.

- Use Agent Visualizer to monitor for unexpected routing paths or anomalous agent behavior.

## Next Steps

Get started with your first agent network, from setting up your environment through deploying it to
a target.

1.  [Get started with agent networks](https://docs.mulesoft.com/agent-network/latest/af-get-started).

2.  [Create an agent network project](https://docs.mulesoft.com/agent-network/latest/af-create-agent-network).

3.  [Define your agent network](https://docs.mulesoft.com/agent-network/latest/af-define-your-agent-network-specification).

4.  [Publish your agent network](https://docs.mulesoft.com/agent-network/latest/af-publish-agent-network-assets).

5.  [Deploy an agent network instance](https://docs.mulesoft.com/agent-network/latest/af-deploy-agent-network-targets).

[Getting Started with Agent Networks](https://docs.mulesoft.com/agent-network/latest/af-get-started)
