Custom action types from Flow, Apex, and prompt templates
Key Takeaway
Use an Autolaunched Flow (No Trigger) for low-code, rule-based record changes, Apex for advanced logic that flows can't automate, and a prompt template when the task needs generated language.
A custom agent action lets an Agentforce agent do work that the standard agent actions don't cover. You build each custom action on top of existing platform functionality, called a reference action. The main types are an autolaunched flow, an invocable or REST Apex class, and a prompt template. Which type you pick depends mostly on whether the task needs a consistent, rule-based result or generated language.
What a custom action is
Agents can read any Salesforce data they have access to. They can't change records without a predefined agent action, so any work that creates, updates, or deletes records needs an action.
When you build a custom action, you choose its reference action from the "Reference Action Type" dropdown. Options include:
- Invocable methods and REST Apex classes
- Autolaunched flows
- Prompt templates
- External services
- MuleSoft APIs