---
schema_version: "1"
id: 6898c00636972816617037602876adfac8376a1e2ea54a9f167fcc0b3da1301f
title: Connect an Agent as a Subagent
collection: admin
version: current
locale: en-us
portal_url: https://docs.salesforce.com/admin/current/en-us/ai/264-0-0/agent_multi_orch_connect.md
canonical_url: https://help.salesforce.com/s/articleView?id=ai.agent_multi_orch_connect.htm&release=264.0.0&type=5
source_site: help.salesforce.com
content_type: documentation
content_hash: 60b59f7550f14892875378a2b400b0861a1edf5f1b840cedc441d3f26c09b3ba
description: Add an agent as a connected subagent to your orchestrator agent. Your orchestrator agent can coordinate efforts among connected subagents, such as delegating tasks and synthesizing results.
products:
  - Agentforce
  - Cross Cloud
release: "264"
---
# Connect an Agent as a Subagent

Add an agent as a connected subagent to your orchestrator agent. Your orchestrator agent can coordinate efforts among connected subagents, such as delegating tasks and synthesizing results.

### Required Editions

<table class="slds-table slds-table_bordered slds-max-medium-table_stacked slds-m-bottom_small edition"><colgroup><col></colgroup><tbody><tr class=""><td class="slds-cell-wrap" style="vertical-align:top;">Available in: Lightning Experience</td></tr><tr class=""><td class="slds-cell-wrap" style="vertical-align:top;">Available in: <strong>Enterprise</strong>, <strong>Performance</strong>, <strong>Unlimited</strong>, and <strong>Developer</strong> Editions. <a href="https://help.salesforce.com/s/articleView?id=ai.agent_setup_explore_types.htm&amp;release=264.0.0&amp;type=5" title="Learn about agent types and default templates for specific clouds and common use cases.">Required add-on licenses vary by agent type.</a></td></tr></tbody></table>

<table class="slds-table slds-table_bordered slds-max-medium-table_stacked slds-m-bottom_small permission">
        <colgroup>
          <col style="width:50%">
          <col style="width:50%">
        </colgroup>
        <thead class="slds-text-title_caps ">
          <tr class="">
            <th scope="colgroup" class="slds-cell-wrap" colspan="2" style="text-align:left;vertical-align:top;" id="d32818e78">User Permissions Needed</th>
          </tr>
        </thead>
        <tbody>
          <tr class="">
            <td data-label="User Permissions Needed" class="slds-cell-wrap" style="vertical-align:top;" headers="d32818e78 ">To add a connected subagent to an orchestrator agent</td>

            <td class="slds-cell-wrap" style="vertical-align:top;" headers="d32818e78 ">Manage AI Agents AND the <a href="https://help.salesforce.com/s/articleView?id=ai.agent_setup_explore_types.htm&amp;language=en_US" target="_blank">required permissions for your agent type</a>
            </td>

          </tr>
        </tbody>
      </table>

![Note](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-ai-generative_ai-264-0-0-production-enus/f8ef6498-d7b2-44e3-9b34-ffd5a850aae9/images/icon_note.png)

Note For customers who didn't participate in the Multi-Agent Orchestration for Agentforce (Pilot) program, before using an agent with Multi-Agent Orchestration for Agentforce:

- If the agent was built using the new Agent Builder, create and activate a new version of it.
- If the agent was built using the legacy Agentforce Builder, upgrade it to the new Agent Builder. See [Upgrade an Agent from the Legacy Builder to the New Builder](https://help.salesforce.com/s/articleView?id=ai.agent_setup_create_upgrade.htm&release=264.0.0&type=5 "Create a new version of an agent from the legacy Agentforce Builder in Setup in the new Agentforce Builder in Agentforce Studio, with just a few clicks. The new version contains all of the original agent's subagents, actions, system messages and settings, data, and connections, converted to Agent Script. Upgrading an agent doesn't affect the original agent in the legacy builder. You can continue to access and edit the agent in the legacy builder.").

To change your agent, it must be in a draft state. To change a committed agent, [create a new draft](https://help.salesforce.com/s/articleView?id=ai.agent_versions_draft.htm&release=264.0.0&type=5 "Create multiple versions of an agent to seamlessly iterate on your agent’s design. Create a version to experiment with different instructions, subagents, or actions and preserve your current configuration. Or create a version to save as a backup, so you can revert quickly.").

1. From the Agents list in the Agentforce Studio app, open the agent to which you want to add a connected subagent. This agent serves as the orchestrator agent that coordinates connected subagents.
2. From the Explorer panel, click **+**.
3. Select **Connect Agent as Subagent**.
4. Select one or more available agents that you want your agent to connect to. Select only active agents. Only agents from supported agent types are available. See [Considerations and Limitations in Multi-Agent Solutions](https://help.salesforce.com/s/articleView?id=ai.agent_multi_orch_consider.htm&release=264.0.0&type=5 "Review these considerations and limitations for Multi-Agent Orchestration for Agentforce.").
5. Click **Add to Agent**. Newly connected subagents appear in the Explorer panel.
    
    If you see **Problems** with input variables, expand the list and determine whether you want to set or remove each input variable. Change to Script view to make your changes (for example, to delete the `INPUTS` block). Be sure to fix all errors.
6. Save your work.
7. Configure the description for each connected subagent that you just added. Changes to the description affected only the connected subagent, within the context of your orchestrator agent. Changes don’t apply to the underlying reference agent on which the connected subagent is based.
    1. In the Explorer, select a connected subagent you want to configure. Accept the defaults or customize settings within the context of your orchestrator agent.
    2. Configure **Basic Information**. Specify a descriptive label that’s unique within the context of your orchestrator agent. Provide specific instructions on how to use this connected subagent to complete actions. Customize instructions to this orchestrator agent and use case. If you use the Agent Router for subagent classification, the orchestrator agent uses these details to determine when to route a conversation to the connected subagent, based on the user's question or request.
    3. Configure **Inputs**, which represent the context variables that you pass into the connected subagent. For each input, customize the variable description for this orchestrator agent and use case, or accept the default. To configure variable mappings, use the Script view.
    4. Configure **Additional Settings**. Change the loading text that’s shown to the user when the orchestrator agent routes the conversation to the connected subagent. This overrides any loading text specified in the underlying reference agent, including loading text for actions.
8. Optionally, configure variable mappings in the connected subagent editor view canvas. Under **Connected Subagent Variable Mapping**, expand the connected subagent name.
    
    - The left side shows the input variables for the connected subagent.
    - The right side shows a drop-down list of variables that you can pass from the orchestrator agent to the connected subagent. These orchestrator variables can be either context (linked) variables or custom (mutable) variables.
    
    For each input variable you want to map, select an orchestrator variable from the list.
    
    ![Note](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-ai-generative_ai-264-0-0-production-enus/f8ef6498-d7b2-44e3-9b34-ffd5a850aae9/images/icon_note.png)
    
    Note
    
    - You can set custom variables during a session. Context variables are immutable. You can't update them after the session has started. See [Agent Script Reference: Variables (Custom and Linked)](https://developer.salesforce.com/docs/ai/agentforce/guide/ascript-ref-variables.html) in the _Agentforce Developer Guide_.
    - In this release, variables pass in one direction only: from the orchestrator agent to the connected subagent. Variables aren’t passed from a connected subagent back to the orchestrator agent.
9. Optionally, for post-reply chaining to another agent, add an `after_response` section to the connected subagent. Click + in the canvas and select **Add After Response**. Use this block to configure inline actions that fire immediately after the connected subagent completes its response.
    
    - **If/Else (Conditional)**—Branches on outcome.
    - **Set a Variable**—Sets the value of a custom, or mutable, variable for the pipeline. The next agent receives those values only through its inputs block. Context doesn’t flow automatically. Missing inputs mapping is a common reason for errors at run time.
    - **Transition**—Delegates control to the next connected subagent. Any script commands placed after the transition are skipped.
10. Save your changes.