Get Started with Agents
Bring the power of conversational AI to your business with agents. Build a trusted and customizable AI assistant that empowers your users to get more done in Salesforce.
You can build custom actions for agents from Apex code. Also, some agent functionality is available through our Metadata API and Tooling API.
With Agent Builder, developers can enhance agent capabilities by creating custom actions using Apex, flows, or prompt templates. This unique extensibility empowers developers to tailor agents to their business needs. To use your Apex code in a custom action, you must annotate your method with @InvocableMethod
. This annotation makes the action available for configuration in Agent Builder. The following sample code shows an Apex class that uses this annotation.
To learn how to turn an invocable Apex method into a custom agent action, check out these resources.
- Developer Blog: Build Custom Agent Actions Using Apex
- Salesforce Help: Create a Custom Action for Agents
- Apex Developer Guide: InvocableMethod Annotation
Manage actions and customize the planner service using the Metadata API.
- GenAiFunction: Represents an action that can be added to agents.
- GenAiPlanner: Represents a planner that uses a large language model (LLM) and a reasoning strategy to decompose a given task into smaller subtasks, identify the most suitable actions for each subtask, and invoke them.
Manage actions and customize the planner service using the Tooling API.
- GenAiFunctionDefinition: Represents an action that can be added to agents.
- GenAiPlannerDefinition: Represents a planner that uses an LLM and a reasoning strategy to decompose a given task into smaller subtasks, identify the most suitable actions for each subtask, and invoke them.
- Trailhead: Agents and Agentforce Basics