---
schema_version: "1"
id: 95bebec7a3601cfb1d1563d2c0478933973f132d2de2e4d01b394fedb2f8d78b
title: Create a Custom Action
collection: admin
version: current
locale: en-us
portal_url: https://docs.salesforce.com/admin/current/en-us/ai/264-0-0/agent_actions_custom.md
canonical_url: https://help.salesforce.com/s/articleView?id=ai.agent_actions_custom.htm&release=264.0.0&type=5
source_site: help.salesforce.com
content_type: documentation
content_hash: 6126284e78f1ea4ef122d5197d1accb1da2a0a13fc867ab6a10934dd6ebce604
description: You can create a custom action from the asset library or from within an agent in Agentforce Builder. When you create an action from the asset library, it’s available to add to multiple agents and versions. When you create an action from within an agent in Agentforce Builder, it’s available only to that agent.
products:
  - Agentforce
  - Cross Cloud
release: "264"
---
# Create a Custom Action

You can create a custom action from the asset library or from within an agent in Agentforce Builder. When you create an action from the asset library, it’s available to add to multiple agents and versions. When you create an action from within an agent in Agentforce Builder, it’s available only to that agent.

### 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:center;vertical-align:top;" id="d122115e78">User Permissions
              Needed</th>
          </tr>
        </thead>
        <tbody>
          <tr class="">
            <td data-label="User Permissions Needed" class="slds-cell-wrap" style="vertical-align:top;" headers="d122115e78 ">To create a custom agent action:</td>

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

          </tr>
          <tr class="">
            <td data-label="User Permissions Needed" class="slds-cell-wrap" style="vertical-align:top;" headers="d122115e78 ">To create or modify prompt templates:</td>

            <td class="slds-cell-wrap" style="vertical-align:top;" headers="d122115e78 ">Prompt Template Manager</td>

          </tr>
          <tr class="">
            <td data-label="User Permissions Needed" class="slds-cell-wrap" style="vertical-align:top;" headers="d122115e78 ">To create or modify flows:</td>

            <td class="slds-cell-wrap" style="vertical-align:top;" headers="d122115e78 ">Manage Flow</td>

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

#### See Also

- [Identify a Customer by Phone Number](https://help.salesforce.com/s/articleView?id=ai.agent_identify_customer_by_phone.htm&release=264.0.0&type=5 "Give your agent a way to identify a customer by phone number so that voice callers aren't asked to spell out an email address. You build a flow that looks up a contact by phone, wrap it in a custom action, and make that action the agent's only identification path.")

## Create a Custom Action in Agentforce Builder

When you create a custom action from an agent in Agentforce Builder, it's available only to that agent. Any changes you make apply only to this agent version. To make an action available to add to other subagents, agents, and agent versions, create it in the asset library instead.

Before you begin:

- Review the [considerations for custom actions](https://help.salesforce.com/s/articleView?id=ai.copilot_considerations.htm&release=264.0.0&type=5 "Carefully review the support, limits, and considerations for AI agents.").
- Create the underlying Salesforce functionality that you want to use with your agent. When you create a custom action, you configure the functionality to use with your agent. You can create a custom action that calls invocable methods and REST Apex classes, external services, autolaunched flows, MuleSoft APIs, or prompt templates.

Access to a custom agent action depends on the type of Salesforce functionality that it references. For example, if a custom action is built using a flow, the custom action adheres to the permissions, field-level security, and sharing settings configured in the flow. To run the action, at minimum the user or Agent User must have the Run Flows permission and access to objects used in the flow. See [Common User Access for Standard Agent Actions](https://help.salesforce.com/s/articleView?id=ai.agent_actions_common_perms.htm&release=264.0.0&type=5 "Learn about the permissions required for users to run many standard agent actions.").

To make changes to your agent, it must be in a draft state. To make changes to 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 you want to add an action to.
2. If there are multiple versions of your agent, from the header in Agentforce Builder, select the agent version you want to edit.
3. In the Explorer panel, open the subagent you want to add the action to, then hover over Actions and click ![Plus sign icon](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-ai-generative_ai-264-0-0-production-enus/f8ef6498-d7b2-44e3-9b34-ffd5a850aae9/generative_ai/images/agent_builder_plus_icon.png).
4. Select **Create New Action**.
5. Give the action a name, and then click **Create and Open**. Your custom action is added to your subagent and agent.
6. From the Reference Action Type dropdown, select the type of functionality that you want to use to build your agent action, such as a flow or prompt template. Then select the category, if prompted, and the reference action. The descriptions for the custom action and each input and output are populated with the descriptions from the reference action.
7. Make changes to your action.
    1. Review the description for your action. If necessary, make changes to help your agent understand what the action does and when and how to use it.
    2. Review the description for each input and output.
    3. For each input, specify any applicable settings.
        
         
        | Input Setting | Details |
        | --- | --- |
        | Collect data from user | Require this parameter to be provided by the user. |
        | Require input | Require this parameter in order to execute the action. When this setting is enabled, if the input is missing, the action can’t be run. All other inputs are treated as optional. If an input is required by the reference action, this setting is enabled by default and read-only. |
    4. For each output, specify any applicable settings.
        
        <table class="slds-table slds-table_bordered slds-max-medium-table_stacked slds-m-bottom_small ">
                  <colgroup>
                    <col style="width:33.33333333333333%">
                    <col style="width:66.66666666666666%">
                  </colgroup>
                  <thead class="slds-text-title_caps ">
                    <tr class="">
                      <th scope="col" class="slds-cell-wrap" style="vertical-align:top;" id="d122115e323">Output Setting</th>
                      <th scope="col" class="slds-cell-wrap" style="vertical-align:top;" id="d122115e326">Details</th>
                    </tr>
                  </thead>
                  <tbody>
                    <tr class="">
                      <td data-label="Output Setting" class="slds-cell-wrap" style="vertical-align:top;" headers="d122115e323 ">Include in agent context</td>

                      <td data-label="Details" class="slds-cell-wrap" style="vertical-align:top;" headers="d122115e326 ">When you create an agent action, all inputs and outputs from the
                        reference action are added to the agent action. When this setting is
                        enabled for an output, the output is added to the agent’s conversation
                        history and made available for reasoning. Disable the setting for any
                        underlying reference action outputs you don’t want to use with your agent.
                        At least one output must be used with the agent action.</td>

                    </tr>
                    <tr class="">
                      <td data-label="Output Setting" class="slds-cell-wrap" style="vertical-align:top;" headers="d122115e323 ">Show in conversation</td>

                      <td data-label="Details" class="slds-cell-wrap" style="vertical-align:top;" headers="d122115e326 ">
                        <p>When this setting is enabled, the outputs are included in the agent's
                          response. On some channels, some outputs are converted to structured
                          content (for example, the Agentforce panel in Lightning Experience
                          recognizes record pages).</p>
                        <p style="margin-bottom:0;">When this setting is disabled for all outputs, the agent uses the LLM
                          to summarize the outputs in natural language in the agent's
                          response.</p>
                      </td>

                    </tr>
                  </tbody>
                </table>
    5. Specify any additional settings for your action.
        
        <table class="slds-table slds-table_bordered slds-max-medium-table_stacked slds-m-bottom_small ">
                  <colgroup>
                    <col style="width:33.33333333333333%">
                    <col style="width:66.66666666666666%">
                  </colgroup>
                  <thead class="slds-text-title_caps ">
                    <tr class="">
                      <th scope="col" class="slds-cell-wrap" style="vertical-align:top;" id="d122115e381">Additional Setting</th>
                      <th scope="col" class="slds-cell-wrap" style="vertical-align:top;" id="d122115e384">Details</th>
                    </tr>
                  </thead>
                  <tbody>
                    <tr class="">
                      <td data-label="Additional Setting" class="slds-cell-wrap" style="vertical-align:top;" headers="d122115e381 ">Require user confirmation</td>

                      <td data-label="Details" class="slds-cell-wrap" style="vertical-align:top;" headers="d122115e384 ">When an action makes a change to a record, you can require an agent
                        to ask the user to confirm the change before the agent can execute
                        it.</td>

                    </tr>
                    <tr class="">
                      <td data-label="Additional Setting" class="slds-cell-wrap" style="vertical-align:top;" headers="d122115e381 ">Show loading text for this action</td>

                      <td data-label="Details" class="slds-cell-wrap" style="vertical-align:top;" headers="d122115e384 ">
                        <p>Show loading text in the agent conversation while the action is running
                          in the background. Turn on this setting to specify the loading text in the
                          <strong class="uicontrol">Loading Text</strong> field. When this setting is on,
                          <strong class="uicontrol">Loading Text</strong> is required. When it's off, the
                          agent shows default loading text.
                        </p>
                        <p>To tailor the loading text for this action, including how to rotate
                          through multiple phrasings, see <a href="https://help.salesforce.com/s/articleView?id=ai.agent_actions_loading_text.htm&amp;release=264.0.0&amp;type=5" title="Loading text tells the user what an agent is doing while an action runs in the background. For editable actions, both standard and custom, you can specify the loading text and tailor it for each action individually.">Edit the Loading
                            Text for an Agent Action</a>.</p>
                        <p style="margin-bottom:0;">To show loading text in enhanced Messaging channel conversations, <a href="https://help.salesforce.com/s/articleView?id=ai.service_agent_messaging_progress_indicators.htm&amp;release=264.0.0&amp;type=5" title="Loading text tells the user what an agent is doing while an action runs in the background. To show your users loading text in Enhanced Chat v1, set up typing indicators. Users see loading text by default on Enhanced Chat v2 channels. Optionally, customize the loading text color and label on the Embedded Service Deployments Settings Setup page.">additional configuration is required for Enhanced Chat</a>.</p>
                      </td>

                    </tr>
                  </tbody>
                </table>
8. Save your changes.

Your action is available only in this agent subagent and version and isn’t available in the asset library. Any changes you make to the action apply only to this subagent and agent version. Changes don’t affect other subagents or agents.

Your action is automatically added to your subagent's reasoning actions (Actions Available for Reasoning), so the action is available for your agent to select during reasoning with an LLM. In reasoning actions, you can add logic to your agent action, such as filters and follow-up actions. To run the action deterministically before your agent begins reasoning, reference the action in your subagent's reasoning instructions.

## Create a Custom Action from the Asset Library

Create a custom action in the asset library to make your action available to multiple agents, versions, and subagents. Then add it to one or more agents.

Before you begin:

- Review the [considerations for custom actions](https://help.salesforce.com/s/articleView?id=ai.copilot_considerations.htm&release=264.0.0&type=5 "Carefully review the support, limits, and considerations for AI agents.").
- Create the underlying Salesforce functionality that you want to use with your agent. When you create a custom action, you configure the functionality to use with your agent. You can create a custom action that calls invocable methods and REST Apex classes, external services, autolaunched flows, MuleSoft APIs, or prompt templates.

Access to a custom agent action depends on the type of Salesforce functionality that it references. For example, if a custom action is built using a flow, the custom action adheres to the permissions, field-level security, and sharing settings configured in the flow. To run the action, at minimum the user or Agent User must have the Run Flows permission and access to objects used in the flow. See [Common User Access for Standard Agent Actions](https://help.salesforce.com/s/articleView?id=ai.agent_actions_common_perms.htm&release=264.0.0&type=5 "Learn about the permissions required for users to run many standard agent actions.").

1. From Setup, enter Agentforce Assets, and then select **Agentforce Assets**.
2. From the Actions tab, click **New Agent Action**.
3. From the Reference Action Type dropdown, select the type of functionality that you want to use to build your agent action, such as a flow or prompt template. Then select the category, if prompted, and the reference action.
    
    The descriptions for the custom action and each input and output are populated with the descriptions from the reference action.
4. Make changes to your action.
    1. Review the description for your action. If necessary, make changes to help your agent understand what the action does and when and how to use it.
    2. Optionally, specify loading text for your action. Otherwise, turn off the setting.
        
        <table class="slds-table slds-table_bordered slds-max-medium-table_stacked slds-m-bottom_small ">
                  <colgroup>
                    <col style="width:33.33333333333333%">
                    <col style="width:66.66666666666666%">
                  </colgroup>
                  <thead class="slds-text-title_caps ">
                    <tr class="">
                      <th scope="col" class="slds-cell-wrap" style="vertical-align:top;" id="d122115e567">Setting</th>
                      <th scope="col" class="slds-cell-wrap" style="vertical-align:top;" id="d122115e570">Details</th>
                    </tr>
                  </thead>
                  <tbody>
                    <tr class="">
                      <td data-label="Setting" class="slds-cell-wrap" style="vertical-align:top;" headers="d122115e567 ">Show loading text for this action</td>

                      <td data-label="Details" class="slds-cell-wrap" style="vertical-align:top;" headers="d122115e570 ">
                        <p>Show loading text in the agent conversation while the action is running
                          in the background. Turn on this setting to specify the loading text in the
                          <strong class="uicontrol">Loading Text</strong> field. When this setting is on,
                          <strong class="uicontrol">Loading Text</strong> is required. When it's off, the
                          agent shows default loading text.
                        </p>
                        <p>To tailor the loading text for this action, including how to rotate
                          through multiple phrasings, see <a href="https://help.salesforce.com/s/articleView?id=ai.agent_actions_loading_text.htm&amp;release=264.0.0&amp;type=5" title="Loading text tells the user what an agent is doing while an action runs in the background. For editable actions, both standard and custom, you can specify the loading text and tailor it for each action individually.">Edit the Loading
                            Text for an Agent Action</a>.</p>
                        <p style="margin-bottom:0;">To show loading text in enhanced Messaging channel conversations, <a href="https://help.salesforce.com/s/articleView?id=ai.service_agent_messaging_progress_indicators.htm&amp;release=264.0.0&amp;type=5" title="Loading text tells the user what an agent is doing while an action runs in the background. To show your users loading text in Enhanced Chat v1, set up typing indicators. Users see loading text by default on Enhanced Chat v2 channels. Optionally, customize the loading text color and label on the Embedded Service Deployments Settings Setup page.">additional configuration is required for Enhanced Chat</a>.</p>
                      </td>

                    </tr>
                  </tbody>
                </table>
    3. Review the description for each input and output.
    4. For each input, specify any applicable settings.
        
         
        | Input Setting | Details |
        | --- | --- |
        | Collect data from user | Require this parameter to be provided by the user. |
        | Require input | Require this parameter in order to execute the action. When this setting is enabled, if the input is missing, the action can’t be run. All other inputs are treated as optional. If an input is required by the reference action, this setting is enabled by default and read-only. |
    5. For each output, specify any applicable settings.
        
        <table class="slds-table slds-table_bordered slds-max-medium-table_stacked slds-m-bottom_small ">
                  <colgroup>
                    <col style="width:33.33333333333333%">
                    <col style="width:66.66666666666666%">
                  </colgroup>
                  <thead class="slds-text-title_caps ">
                    <tr class="">
                      <th scope="col" class="slds-cell-wrap" style="vertical-align:top;" id="d122115e697">Output Setting</th>
                      <th scope="col" class="slds-cell-wrap" style="vertical-align:top;" id="d122115e700">Details</th>
                    </tr>
                  </thead>
                  <tbody>
                    <tr class="">
                      <td data-label="Output Setting" class="slds-cell-wrap" style="vertical-align:top;" headers="d122115e697 ">Include in agent context</td>

                      <td data-label="Details" class="slds-cell-wrap" style="vertical-align:top;" headers="d122115e700 ">When you create an agent action, all inputs and outputs from the
                        reference action are added to the agent action. When this setting is
                        enabled for an output, the output is added to the agent’s conversation
                        history and made available for reasoning. Disable the setting for any
                        underlying reference action outputs you don’t want to use with your agent.
                        At least one output must be used with the agent action.</td>

                    </tr>
                    <tr class="">
                      <td data-label="Output Setting" class="slds-cell-wrap" style="vertical-align:top;" headers="d122115e697 ">Show in conversation</td>

                      <td data-label="Details" class="slds-cell-wrap" style="vertical-align:top;" headers="d122115e700 ">
                        <p>When this setting is enabled, the outputs are included in the agent's
                          response. On some channels, some outputs are converted to structured
                          content (for example, the Agentforce panel in Lightning Experience
                          recognizes record pages).</p>
                        <p style="margin-bottom:0;">When this setting is disabled for all outputs, the agent uses the LLM
                          to summarize the outputs in natural language in the agent's
                          response.</p>
                      </td>

                    </tr>
                  </tbody>
                </table>
5. Click **Finish**.

Your action is available in the asset library. To use your action, add it to an agent. See [Add an Action to a Topic from the Asset Library](https://help.salesforce.com/s/articleView?id=ai.agent_actions_add_asset_library.htm&release=264.0.0&type=5 "Add standard actions to your agent to start handling common business use cases quickly, or create custom actions tailored to your business needs. When you add these actions to an agent, the agent gets its own, independent copy. Changes to template actions within the asset library aren't automatically synced to subagents and actions within your agent. Changes made to one agent's actions don't affect another agent's subagents or actions.").

Any changes you make to the action in the asset library aren’t synced to any copies of the action you’ve added to agents. To apply changes made to an action in the asset library to an agent, you must add the updated action to the agent.