What are the types of Agent Actions and when would you use each?
Suggested answer
Agentforce supports four primary action types:
1. Flow Actions: Auto-launched Flows invoked by the agent. Best for multi-step processes involving data retrieval, record creation/update, or conditional logic that an admin can build declaratively. The agent passes input variables and receives output variables.
2. Apex @InvocableMethod Actions: Custom Apex methods annotated with @InvocableMethod. Used when Flow cannot handle the required complexity — calling external APIs, complex data transformations, or performance-sensitive operations. Must use List<> parameters. The label and description annotations are especially important as they guide the LLM in selecting and parameterising the action.
3. Prompt Template Actions: Invoke a configured Prompt Template to generate text — summarising a record, drafting an email, or classifying sentiment.
4. Knowledge Retrieval Actions: Query the Salesforce Knowledge Base to surface relevant articles, using Einstein Search with semantic ranking. Choosing the right action type balances maintainability (Flows), power (Apex), AI text generation (Prompt Templates), and information retrieval (Knowledge).
Practice content for interview preparation; not an official vendor answer. Verify details against current product documentation.
Community comments (0)
No comments yet.
Sign in or create a free account to add a comment. Comments are moderated before they appear.