Loading
Feature degradation | Gmail Email delivery failureRead More
Agentforce and Einstein Generative AI
Table of Contents
Select Filters

          No results
          No results
          Here are some search tips

          Check the spelling of your keywords.
          Use more general search terms.
          Select fewer filters to broaden your search.

          Search all of Salesforce Help
          Create a Custom Action

          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

          Available in: Lightning Experience
          Available in: Enterprise, Performance, Unlimited, and Developer Editions. Required add-on licenses vary by agent type.
          User Permissions Needed
          To create a custom agent action: Manage AI Agents AND the required permissions for your agent type
          To create or modify prompt templates: Prompt Template Manager
          To create or modify flows: Manage Flow

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

          To make changes to your agent, it must be in a draft state. To make changes to a committed agent, create a new draft.

          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.
          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.
              Output Setting Details
              Include in agent context 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.
              Show in conversation

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

              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.

            5. Specify any additional settings for your action.
              Additional Setting Details
              Require user confirmation 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.
              Show loading text for this action

              Show loading text in the agent conversation while the action is running in the background.

              For a custom action, you can specify the loading text for the action in the Loading Text field. In 1–3 words with no punctuation, tell your users what your action is doing. For example, “Crafting your email,” “Making updates,” or “Getting activity details.”

              When this setting is disabled, or when this setting is enabled but no loading text is specified, default loading text is shown. For example, “Working,” “Making progress,” or “Checking my notes.”

              To show loading text in enhanced Messaging channel conversations, additional configuration is required for Enhanced Chat.

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

          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.
              Setting Details
              Show loading text for this action

              Show loading text in the agent conversation while the action is running in the background.

              For a custom action, you can specify the loading text for the action in the Loading Text field. In 1–3 words with no punctuation, tell your users what your action is doing. For example, “Crafting your email,” “Making updates,” or “Getting activity details.”

              When this setting is disabled, or when this setting is enabled but no loading text is specified, default loading text is shown. For example, “Working,” “Making progress,” or “Checking my notes.”

              To show loading text in enhanced Messaging channel conversations, additional configuration is required for Enhanced Chat.

            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.
              Output Setting Details
              Include in agent context 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.
              Show in conversation

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

              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.

          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.

          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.

           
          Loading
          Salesforce Help | Article