Overview - Integrating with Agentforce Agents
Understand how Agentforce agents utilize the Agentforce Context Protocol (ACP) to perform actions and access data through Salesforce Custom Actions.
Introduction
Agentforce agents are designed to assist users by performing tasks and retrieving information across various systems. The Agentforce Context Protocol (ACP) is the underlying framework that empowers these agents by providing a standardized way to interact with different Salesforce clouds and external services through a set of “tools.”
This section of the guides explains how Agentforce agents connect to and leverage ACP, primarily through Salesforce Custom Actions. Increasingly, these Custom Actions are automatically generated from ACP Tools and made available as ‘Actions’ within ‘Topics’ in Agentforce Agent Builder, simplifying the enablement process.
The Role of Salesforce Custom Actions
Salesforce Custom Actions are a key mechanism within the Salesforce Platform that allow developers to extend the capabilities of Salesforce features, including Agentforce. In the context of ACP, Custom Actions serve as the bridge between an Agentforce agent’s intent and an ACP tool’s execution.
Here’s how it generally works:
-
User Instructs Agentforce Agent: A user gives a command or asks a question to an Agentforce agent (e.g., “Agentforce, create a case for this customer,” or “Agentforce, send a summary of this opportunity to the #sales-updates Slack channel”).
-
Agentforce Interprets Intent: The Agentforce agent processes the user’s request to understand the desired action and identify the relevant entities or data.
-
Mapping to an ACP Custom Action: The Agentforce platform is configured to map specific intents or recognized actions to corresponding Salesforce Custom Actions that are specifically designed to invoke ACP tools. With the evolution of ACP integration, this often involves administrators selecting pre-defined ‘Topics’ (representing Connectors) and ‘Actions’ (representing Tools) within Agentforce Agent Builder, which handles the underlying association with the appropriate Custom Action.
- For example, an administrator might add the ‘Send Slack Message’ Action from the ‘Slack’ Topic to their agent in Agent Builder, which internally maps to an
ACPSlackSendMessage
Custom Action. - Similarly, adding a ‘Query Customer Insights’ Action from a ‘Data Cloud’ Topic would map to an
ACPDataCloudQuery
Custom Action.
- For example, an administrator might add the ‘Send Slack Message’ Action from the ‘Slack’ Topic to their agent in Agent Builder, which internally maps to an
-
Custom Action Invokes ACP Tool: The Custom Action, typically an Apex class annotated with
@InvocableMethod
, takes the necessary parameters derived from the Agentforce agent’s understanding of the user’s request. It then:- Locates the appropriate ACP Connector (e.g., Slack Connector, Data Cloud Connector).
- Calls the specific ACP tool (e.g.,
slack_send_message
,data_cloud_query_dmo
) with the provided parameters.
-
ACP Tool Executes: The ACP tool interacts with the target system (e.g., Slack API, Data Cloud API) to perform the requested operation.
-
Result Returned to Agentforce Agent: The outcome of the ACP tool execution (success, failure, data retrieved) is passed back through the Custom Action to the Agentforce agent.
-
Agentforce Agent Responds to User: The Agentforce agent then formulates a response to the user based on the outcome (e.g., “Okay, I’ve sent the message to #sales-updates,” or “Here is the customer data I found in Data Cloud: …”).
Why Custom Actions?
Using Custom Actions provides several benefits:
- Encapsulation: Complex ACP tool interactions are encapsulated within a reusable Apex action.
- Salesforce Native Integration: Leverages standard Salesforce platform capabilities, making it familiar to Salesforce developers and administrators.
- Parameter Mapping: Allows for clear definition and mapping of input and output parameters between the Agentforce agent’s context and the ACP tool’s requirements.
- Security and Permissions: Salesforce platform security (sharing rules, user permissions) can be applied at the Custom Action level if needed, in addition to any security enforced by ACP itself or the target systems.
- Discoverability: Custom Actions can be made discoverable within Salesforce, aiding administrators in understanding and configuring Agentforce agent capabilities.
Key Takeaways
- Agentforce agents don’t call ACP tools directly in most user-facing scenarios. Instead, they leverage Salesforce Custom Actions that are specifically built to wrap ACP tool functionality.
- These Custom Actions translate an Agentforce agent’s understanding of a user’s request into a concrete call to an ACP tool.
- The introduction of automatically generated Topics and Actions in Agentforce Agent Builder significantly simplifies how administrators discover and enable these capabilities for their agents.
- This architecture allows for a clean separation of concerns, robust integration with the Salesforce platform, and a structured way to extend Agentforce agent capabilities.
Next Steps
To make these Custom Actions (and thus ACP tools) available to your Agentforce agents, specific configuration is usually required:
Understanding this foundational integration pattern is key to effectively managing and expanding what your Agentforce agents can do.