Create Custom Actions Using Apex Invocable Method
With Agentforce 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 can annotate your method with @InvocableMethod
. This annotation makes the action available for configuration in Agentforce Builder. The following sample code shows an Apex class that uses this annotation.
To learn how to turn an invocable method into a custom action in Agentforce, review these resources.
Salesforce Help
- Salesforce Help: Create a Custom Action for Agents
- Salesforce Help: Use Agentforce to Invoke External Service Actions
Developer Blog
- Developer Blog: Build Custom Agent Actions Using Apex
- Developer Blog: Best Practices for Building Agentforce Apex Actions
Developer Reference
- Apex Developer Guide: InvocableMethod Annotation