Introduction

Once you have an Apex class with an @InvocableMethod that wraps an Agentforce Context Protocol (ACP) tool, this method becomes available as an “Action” element within Salesforce Flow Builder. This guide will show you how to find and add these ACP-backed actions to your Flows.

Prerequisites

  • ACP-Backed Invocable Action: You must have an Apex class deployed in your Salesforce org containing at least one method annotated with @InvocableMethod. This method should be designed to call an ACP tool.
    • Example: An Apex class named ACPSlackActions with a method sendMessage annotated with @InvocableMethod(label='ACP Slack: Send Message' description='Sends a message to a Slack channel via ACP.').
  • Access to Flow Builder: You need the necessary Salesforce permissions to create or edit Flows.

Steps to Find and Add ACP Actions in Flow Builder

  1. Open Flow Builder:

    • Navigate to Setup in Salesforce.
    • In the Quick Find box, type “Flows” and select Flows.
    • Click New Flow to create a new Flow, or open an existing Flow where you want to add the ACP action.
    • Choose the type of Flow you want to create (e.g., Screen Flow, Autolaunched Flow, Record-Triggered Flow).
  2. Add an “Action” Element:

    • In the Flow Builder canvas, click the + (Add element) icon where you want to insert the ACP action.
    • Select the Action element from the “Interaction” or “Logic” section (depending on your Flow type and canvas view).

    (Ideally, replace this with an actual image or a more descriptive placeholder if images aren’t supported here)

  3. Search for Your ACP Action:

    • In the “New Action” configuration pane that appears on the right, click into the Action search box.
    • Search by Label: The easiest way to find your ACP action is to type the label you specified in the @InvocableMethod annotation in your Apex class.
      • For our example: Type “ACP Slack: Send Message”.
    • Search by Category: If you specified a category in the @InvocableMethod annotation (e.g., @InvocableMethod(label='...' category='ACP Tools')), you can filter by that category on the left side of the Action selection dialog.
    • Browse All Actions: You can also scroll through the list of available actions, but searching is usually faster.

    (Placeholder image)

  4. Select the ACP Action:

    • Once you find your ACP action in the search results, click on it to select it.
  5. Configure the Action:

    • Label: Give this specific instance of the action a unique and descriptive label within your Flow (e.g., “Send Welcome Message to Slack”).
    • API Name: An API name will be auto-generated. You can modify it if needed.
    • Input Values: This is where you provide the inputs that your Invocable Method expects.
      • For each input parameter defined with @InvocableVariable in your Apex method, a field will appear here.
      • You can set these values statically, or more commonly, map them from Flow resources (like variables, record fields, screen component inputs, or outputs from previous Flow elements).
      • Toggle “Include” for each parameter you want to set.
      • For example, if your ACPSlackActions.sendMessage method expects channelId and messageText, you’ll see input fields for these. You might map messageText to a Flow variable called varWelcomeMessageText.

    (Placeholder image)

  6. Handle Output Values (Optional but Recommended):

    • If your Invocable Method returns values (also defined with @InvocableVariable), you can store these outputs in Flow variables for use in subsequent Flow elements.
    • Under the “Advanced” section (or directly visible depending on the interface), you can manually assign output variables.
    • For example, if your action returns a success boolean or a responseId, you can create Flow variables to store these and use them for decision logic later in the Flow.

    (Placeholder image)

  7. Click “Done”:

    • Once you’ve configured the label, API name, inputs, and any outputs, click Done.

Your ACP-backed Invocable Action is now part of your Flow. You can connect it to other Flow elements, add decision logic based on its outputs, and incorporate it into your broader automation process.

Tips for Finding ACP Actions

  • Consistent Naming Convention: Use a consistent prefix or naming convention for the label of all your ACP-related Invocable Actions (e.g., “ACP [Connector Name]: [Action]”). This makes them easier to find and identify.
  • Use the category Attribute: Group related ACP actions using the category attribute in the @InvocableMethod annotation. This helps organize them in the Flow Builder action selection dialog.
  • Descriptive Labels and Descriptions: Ensure the label and description in your @InvocableMethod and @InvocableVariable annotations are clear and accurately reflect what the action and its parameters do. These are displayed in Flow Builder and help users understand how to use the action.

By following these steps, you can easily find and integrate your custom ACP tools into powerful Salesforce Flow automations.