---
schema_version: "1"
id: 07a65f12db60ef490223c6670c575957dc0b244ae91502035fb8a032ed51d7c8
title: Design the Subagents and Actions
collection: admin
version: current
locale: en-us
portal_url: https://docs.salesforce.com/admin/current/en-us/ai/264-0-0/agent_plan_action_design.md
canonical_url: https://help.salesforce.com/s/articleView?id=ai.agent_plan_action_design.htm&release=264.0.0&type=5
source_site: help.salesforce.com
content_type: documentation
content_hash: c3a0d4f4070cb60c9aaf06bc051a5d1a3ee7635331d6016db7455048919a8ea9
description: After identifying the right subagents and actions for your AI agent, start planning how to build them. Following best practices when designing the subagents and actions can help your agent perform reliably and effectively.
products:
  - Agentforce
  - Cross Cloud
release: "264"
---
# Design the Subagents and Actions

After identifying the right subagents and actions for your AI agent, start planning how to build them. Following best practices when designing the subagents and actions can help your agent perform reliably and effectively.

### 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>

As you plan your subagents and actions, simultaneously build and test your AI agent in a sandbox environment. Try different approaches to figure out what works and what doesn’t. The key is to use prototyping and continuous refinement to guide your planning and development efforts.

## Design the Subagents

Subagents are an important component of Agentforce because they define the AI agent’s goals and provide the context and direction it needs to achieve those goals. When building an agent, you can customize standard subagents to get up and running quickly, or you can create custom subagents that are tailored to your business. To learn how to design subagents, review the different [parts of a subagent](https://help.salesforce.com/s/articleView?id=ai.copilot_topics.htm&type=5&language=en_US) and follow the [best practices for subagent instructions](https://help.salesforce.com/s/articleView?id=ai.copilot_topics_instructions.htm&type=5&language=en_US).

## Design the Actions

If none of the [standard agent actions](https://help.salesforce.com/s/articleView?id=ai.copilot_actions_ref.htm&type=5&language=en_US) suit your needs, you can build custom actions for your AI agent. When you create a custom action, you build it on top of existing platform functionality that you want to make available in Agentforce—invocable and REST Apex classes, autolaunched flows, prompt templates, external services, and MuleSoft APIs. In Agentforce, that underlying functionality is called a _reference action_.

## Design Considerations for Reference Actions

Here are some factors to consider when approaching the design of the underlying reference actions for your agent actions.

## Deterministic or Prompt-Based

When developing the underlying platform functionality for your agent actions, first review the business processes and tasks related to your use case. Then decide whether the process or task should be deterministic or prompt-based.

- Deterministic: Uses an invocable or REST Apex class or autolaunched flow to generate output. Actions based on flows or Apex are deterministic and use business logic and rules to produce a consistent outcome.
- Prompt-based: Uses one or more prompt templates to generate output. A prompt-based action lets you control how a response is written or use reasoning and generative capabilities of an LLM. For example, to generate a summary or perform sentiment analysis, you need to use a prompt template as a reference action. Prompt templates are also used to ground an agent in data, such as knowledge or external system data.

Keep in mind that an action can combine both deterministic and prompt-based approaches. For example, an Appointment Management subagent might include an action that cancels appointments. When a user asks to cancel their appointment, the flow-based action is triggered to complete the cancellation. At some point during that flow, the agent could also launch a prompt template that summarizes the user’s reason for cancelling.

## Atomic or Composite

Another factor to consider is whether the reference action is atomic or composite.

- Atomic: A small, singular task. A modular approach gives the agent freedom to combine actions in different ways to accomplish a more sophisticated goal. It also tends to provide more opportunities for action reuse across different subagents.
- Composite: A complex task made up of multiple subtasks. The benefit of a composite action is that you control the exact sequence of steps the agent takes to complete a task.

## Inputs and Outputs

In Agentforce, each agent action must have at least one input, which means the underlying flow, Apex, or prompt template must also have at least one input. For example, to look up a hotel reservation, the input might be the guest’s email or reservation number. During a conversation, the AI agent has the autonomy to gather information and decide if it has all the details required for it to trigger the action and pass in the input.

Each action must also have at least one output. The way you build the action determines what the output is, how it’s used, and whether and how it’s displayed to users in the conversation. Don’t be afraid to experiment with test actions that aren’t fully implemented—they can be a great way to see how your ideas work in execution.

After you decide how to build your actions, review the [Best Practices for Agent Action Instructions](https://help.salesforce.com/s/articleView?id=ai.copilot_actions_instructions.htm&type=5&language=en_US).

#### See Also

- [Edit a Standard Subagent in the Legacy Builder](https://help.salesforce.com/s/articleView?id=ai.copilot_topics_edit.htm&release=264.0.0&type=5 "Edit an out-of-the-box subagent to make sure it meets the needs of your specific use case and respects the right guardrails for your business.")
- [Add a Subagent to Your Agent in the Legacy Builder](https://help.salesforce.com/s/articleView?id=ai.copilot_topics_add.htm&release=264.0.0&type=5 "You can create a custom subagent from scratch or add a standard subagent from the asset library. Consider best practices for creating a subagent as you decide. When you add a subagent to an agent, Salesforce makes a copy of the subagent so that each agent and agent version has its own independent copy.")
- [Create a Custom Agent Action in the Legacy Builder](https://help.salesforce.com/s/articleView?id=ai.copilot_actions_custom.htm&release=264.0.0&type=5 "With custom actions, you can extend your agent with Salesforce functionality so that it’s ready to assist users with tasks specific to your business. Build custom actions using Apex, flows, prompt templates, and API integrations.")
- [_Trailhead_: Agentforce: Agent Planning](https://trailhead.salesforce.com/content/learn/modules/agentforce-agent-planning)
- [Enhance Agent Action UI with Custom Lightning Types](https://help.salesforce.com/s/articleView?id=ai.copilot_actions_enhance.htm&release=264.0.0&type=5 "Customize the user interface (UI) for an agent action’s input and output by using custom Lightning types. ")
- [Standard Lightning Types](https://developer.salesforce.com/docs/ai/agentforce/guide/lightning-types-standard.html)
- [Custom Lightning Types](https://developer.salesforce.com/docs/ai/agentforce/guide/lightning-types-custom.html)