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

Available in: Lightning Experience
Available in: Enterprise, Performance, Unlimited, and Developer Editions. Required add-on licenses vary by agent type.
User Permissions Needed
To add a connected subagent to an orchestrator agent Manage AI Agents AND the required permissions for your agent type
Note
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:

To change your agent, it must be in a draft state. To change a committed agent, create a new draft.

  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.
  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
    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) 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.