---
schema_version: "1"
id: 53b926c918bbc5cb425aea9e8755f22647754be074df3c02bb2bbfe0e83e8caf
title: Set Up a Custom Agent Invocable Action in Flow Builder
collection: admin
version: current
locale: en-us
portal_url: https://docs.salesforce.com/admin/current/en-us/ai/264-0-0/agent_custom_invocable_action_flow_set_up.md
canonical_url: https://help.salesforce.com/s/articleView?id=ai.agent_custom_invocable_action_flow_set_up.htm&release=264.0.0&type=5
source_site: help.salesforce.com
content_type: documentation
content_hash: 7035f927268a21b1058c01251dc8efefdc09f9c9b1c32d1e7e6caac5320b78c9
description: Add a custom agent invocable action to a new or existing flow to complete a task automatically with your Agentforce Service agent or default Agentforce agent.
products:
  - Agentforce
  - Cross Cloud
release: "264"
---
# Set Up a Custom Agent Invocable Action in Flow Builder

Add a custom agent invocable action to a new or existing flow to complete a task automatically with your Agentforce Service agent or default Agentforce agent.

### Required Editions

<table class="slds-table slds-table_bordered slds-max-medium-table_stacked slds-m-bottom_small edition"><colgroup><col style="width:100%"></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: Enterprise, Performance, Unlimited, and Developer Editions. Required add-on licenses vary by agent type.</td></tr></tbody></table>

![Important](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-ai-generative_ai-264-0-0-production-enus/f8ef6498-d7b2-44e3-9b34-ffd5a850aae9/images/icon_important.png)

Important Starting June 17, 2025, Agentforce (Default) will not include new features or improvements and isn’t available in new Salesforce environments. We recommend migrating to Agentforce Employee agent for continued enhancements and support. If you plan to transition to Agentforce Employee agent or make related license changes, complete the migration of your existing Agentforce (Default) agents in advance to avoid potential disruption in agent availability. If you can't complete the migration in advance, you can create new agents after the transition, which can involve some downtime. See [Migrate from Agentforce (Default) to Agentforce Employee Agent](https://help.salesforce.com/s/articleView?id=ai.migrate_agentforce_default_to_aea.htm&type=5&language=en_US).

<table class="slds-table slds-table_bordered slds-max-medium-table_stacked slds-m-bottom_small ">
        <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="d97346e67">User Permissions Needed</th>
          </tr>
        </thead>
        <tbody>
          <tr class="">
            <td data-label="User Permissions Needed" class="slds-cell-wrap" style="vertical-align:top;" headers="d97346e67 ">&nbsp;</td>

            <td class="slds-cell-wrap" style="vertical-align:top;" headers="d97346e67 ">&nbsp;</td>

          </tr>
          <tr class="">
            <td data-label="User Permissions Needed" class="slds-cell-wrap" style="vertical-align:top;" headers="d97346e67 ">To create an agent invocable action associated with an Agentforce Service
              agent:</td>

            <td class="slds-cell-wrap" style="vertical-align:top;" headers="d97346e67 ">
              <p>Manage Agentforce Service Agents AND Manage AI Agents</p>
              <p>OR</p>
              <p style="margin-bottom:0;">Customize Application</p>
            </td>

          </tr>
          <tr class="">
            <td data-label="User Permissions Needed" class="slds-cell-wrap" style="vertical-align:top;" headers="d97346e67 ">To create an agent invocable action associated with an Agentforce Employee
              agent:</td>

            <td class="slds-cell-wrap" style="vertical-align:top;" headers="d97346e67 ">
              <p>Manage AI Agents</p>
              <p>OR</p>
              <p style="margin-bottom:0;">Customize Application</p>
            </td>

          </tr>
          <tr class="">
            <td data-label="User Permissions Needed" class="slds-cell-wrap" style="vertical-align:top;" headers="d97346e67 ">To create an agent invocable action associated with Agentforce (Default):</td>

            <td class="slds-cell-wrap" style="vertical-align:top;" headers="d97346e67 ">
              <p>Manage AI Agents AND the required permissions for your
                agent type</p>
              <p>OR</p>
              <p style="margin-bottom:0;">Customize Application</p>
            </td>

          </tr>
          <tr class="">
            <td data-label="User Permissions Needed" class="slds-cell-wrap" style="vertical-align:top;" headers="d97346e67 ">To open, edit, or create a flow in Flow Builder:</td>

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

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

If you haven't already, [prepare to call an agent from an Apex class or flow](https://help.salesforce.com/s/articleView?id=ai.agent_custom_invocable_action_flow_apex.htm&release=264.0.0&type=5).

1. In Flow Builder, select **Action**. Then, from the AI Agent Actions category, select the custom invocable action for the agent that you want to call from your flow.
    
    Only invocable actions associated with active agents are listed.
2. Enter a name for your action and an optional description.
3. In the User Message field, enter a sample user message to the agent that defines the task to complete. The agent uses the utterance to search through the topics and actions assigned to it to identify the right action or actions for the task.
    
    For example, “Generate a summary of the incoming service case in less than 100 characters.”
4. (Optional) In the Resource field, select variables to include in the message.
    
    Add the elements you want to reference in the user message prior to the agent invocable action in the flow. For example, to fetch the ID for a record in the user message, add the Get Records element to your flow.
    
    Don’t include context variables in the user message. Instead, use input fields.
5. (Optional) Specify a session ID for the conversation with the agent.
    
    If you include multiple invocable actions associated with the same agent in your flow, you can use the session ID as an input in subsequent actions. If you don’t specify a session ID, a new session is created.
6. (Optional) If your invocable action is on version 1.1.0, click **Configure** in the Edit Structured Output section and then define at least one structured output field.
    
    When you edit an invocable action's stuctured output, the changes applies to earlier versions of the flow, including active versions.
7. (Optional) If your invocable action calls an Agentforce Service agent, the context variables that you added to the agent populate as inputs. To use a context variable as input, map it to a variable. If you don’t want to use a context variable, leave the field blank. Use Agentforce Builder to add or remove context variables.
8. (Optional) If your invocable action is on version 1.1.0, define the fields that you want the action to return as output to the flow. To make sure that the action always returns a specific field, mark the field as required.
9. Save your changes.
10. When you’re ready, give your users access and activate your flow.

To test your agent’s topic and action configuration, in Agentforce Builder, enter your user message in the preview conversation. To preview your agent’s response, use the Debug Flow feature in Flow Builder. Apex testing isn't supported for custom agent invocable actions.

If your invocable action is on version 1.1.0, the agent responds with an Apex object that includes the fields you specified.

If your invocable action is on version 1.0.0, the agent responds with a text-string response. You can use an Apex class in a flow to parse the agent response. See [Extend Flows with Apex](https://help.salesforce.com/s/articleView?id=platform.flow_build_extend_apex_container.htm&type=5&language=en_US).

`{   sessionId: "uuid",   message: {     type: text,     value: AGENT RESPONSE   } }`

#### See Also

- [_Trailhead_: Quick Start: Explore the Automation Components Sample App](https://trailhead.salesforce.com/content/learn/projects/quick-start-explore-the-automation-comps-sample-app)
- [Flow Core Action: AI Agent Actions](https://help.salesforce.com/s/articleView?id=platform.automate_flow_ref_elements_actions_generate_ai_agent_response.htm&language=en_US)