Subagents
A subagent is a job an agent can do. Learn about the parts of a subagent and how to use them to define an agent’s logic, reasoning, and conversational capabilities.
Required Editions
| Available in: Lightning Experience |
| Available in: Enterprise, Performance, Unlimited, and Developer Editions. Required add-on licenses vary by agent type. |
Think of a subagent as a particular job an agent can do. Collectively, the subagents assigned to your agent define the capabilities your agent can handle. Subagents contain instructions, which control agent logic and guide agent reasoning, and actions, which are the tools available for the agent to use.
The parts of a subagent include a name, description, reasoning instructions, reasoning actions, and agent actions.
| Subagent Field | What It Is | How It's Used |
|---|---|---|
| Name and Description | The name is the API name of the subagent. It’s usually 2-3 words that describe what the subagent does in plain language. The description is 1-3 sentences that describe what a subagent does and the types of user requests that should be classified into this subagent. In other words, the description describes what user messages should trigger this subagent. |
By default, these fields are used along with a special subagent, the Agent Router, to determine when to use a subagent in a conversation. Routing behavior can be customized. See Subagent Classification and Routing. The agent compares the names and descriptions of all of the subagents assigned to the agent to the user’s question or request and recent conversation history. Based on that context and the instructions in the Agent Router, the agent selects the best match. |
| Instructions | Instructions (sometimes called reasoning instructions) are the guidelines that tell your agent how to handle conversations in the context of the subagent, your business case, and the conversation in general. Instructions contain a combination of programmatic logic (written in Agent Script) and natural language prompts. Logic strictly defines your agent’s workflow and business rules. Prompts more flexibly guide your agent’s conversational skills. | Reasoning instructions are used to create the prompt that’s sent to the LLM. When the agent moves to a subagent, it begins resolving the reasoning instructions in order, executing any logic along the way to help the agent reason more accurately and reliably. See How Subagent Instructions are Resolved to Build a Prompt. When the agent reaches the end of the logic, the agent sends the resolved prompt, including any natural language instructions, to the LLM to start the reasoning process. |
| Actions Available for Reasoning (Reasoning Actions) | Actions available for reasoning (sometimes called reasoning actions) are the actions an agent is allowed to take during reasoning with the LLM). They include references to traditional agent actions, such as Answer Questions with Knowledge. But they can also include utilities, which include transitions to another subagent, setting variables, or escalations to a representative. In reasoning actions, you can define filters to control when an action can be used. You can also add logic after an action to chain actions together in sequence. |
Reasoning actions are sent to the LLM along with the prompt created from the reasoning instructions. The LLM chooses which actions and utilities to run based on the user’s message, the recent conversation history, the resolved reasoning instructions, and any logic defined in the reasoning actions. When you add an action to a subagent, the action is added to the subagent's reasoning actions by default. |
| Action Definitions | Behind the scenes, a subagent includes a list of all of the agent actions assigned to the subagent. Think of this as a list of all the actions relevant to the subagent’s use case, including the name and description of the action, the list of inputs and outputs, and the reference to the Salesforce functionality the agent action calls to get information or perform a task (such as a flow or prompt template). Action definitions make an action available to reference and use within your subagent. Action definitions aren't visible in Canvas view, but you can see them in Script view. | When you add an action to a subagent, the action is added to the subagent's action definitions and its reasoning actions by default. You can remove an action from a subagent's reasoning actions, so it's not available for the agent to run during reasoning, and still use it within your subagent.
To remove an action from your subagent altogether, from the Explorer panel, delete it. Or delete the action definition and references to the action in your agent's script. |
- Subagent Classification and Routing
Learn more about the Agent Router and how to customize it to control how your agent selects subagents in a conversation. - How Subagent Instructions are Resolved to Build a Prompt
Learn about how an agent executes programmatic expressions in a subagent’s reasoning instructions to prepare for reasoning. - Manage Subagents
Add and remove subagents from your agent. Create custom subagents. Manage subagents in the asset library.

