Introducing the Agentforce Guide

to Reasoning, Topics, Instructions and Actions

Data Cloud Components for Extensibility and Control

Component When to Use Skills Required
Agent Invocable Actions To invoke an agent from Flow or Apex Low-code
Agent API To invoke an agent from outside Salesforce Pro-code
Agent Variables To add additional controls to how your agent reasons through topic and action selection. Low-code
Agentforce SDK To build an agent from scratch using Python code via a programmatic interface to Salesforce’s Agentforce infrastructure. Pro-code
Model Builder Customise a generative AI model or create a predictive model Low-code

Agentforce Customised Action Selection

Component When to Use Skills Required Additional Licence Required?
Prompt Template To invoke an LLM to generate a response. Prompt template actions are how an agent uses RAG. Low-code Yes
Flow To run low-code rules-based automation and record retrieval Low-code No
Apex code To run pro-code rules-based automation and record retrieval Pro-code No
MuleSoft API To retrieve data from legacy systems and other external applications in a complex enterprise environment Pro-code Yes
External Service To retrieve data from REST APIs that support OpenAPI specs Low-code Yes
Predictive Model To use predictive AI with your agent Low-code Yes
Atlas Reasoning Engine Process Flow

Variable Types and Limits Matrix

Component Context Variables Customised Variables
Can be instantiated by user No Yes
Can be input of actions Yes Yes
Can be output of actions No Yes
Can be updated by actions No Yes
Can be used in filters of actions and topics Yes Yes
Supported types Text/Number Text/Number
Agentforce 2.0 Reasoning Engine for Service Template

1. Topic Name

Bad Example Good Example Why It’s Better
Customer Info Account management Clearly describes the job to be done
Help Technical Support Specifies the type of help provided
Transactions Payment Processing Specifies the type of help provided

2. Topic Classification Description

This describes what user messages should trigger this topic. It’s critical for helping your agent understand when to use this topic and is used at the classification step.

Bad Example Good Example Why It’s Better
Handle order related questions. Answer questions related to orders, delivering status, delivery times or tracking. Help with finding order details, changing or cancelling orders and addressing order-related concerns. Lists specific scenarios customers might ask about.
Help with accounts. Help customers manage their profile information, update personal details, reset passwords, change email preferences or handle issues with account access. Details the range of account-related tasks.
Verify before handling payment issues. Verify the customer before proceeding to check payment status, obtaining payment information or updating their payment method. Specifically mentions to redirect to a different topic before handling a topic with sensitive information. Also, remember to use conditional topic filters for more determinism.

3. Topic Scope

This defines the boundaries of what your agent can and cannot do within this topic.

Bad Example Good Example Why It’s Better
Handle order questions and issues. Your job is only to answer questions related to a customer’s order status, return status or return and repair policy. Never initiate or generate an order or return. Sets clear boundaries on what the agent should and shouldn’t do.
Help with log in problems. Your job is only to help customers who cannot log in with resetting their password or looking up their username. You cannot update account information or modify permissions. Explicitly states limitations.

Topic Overview

Component Contents
Topic Name Password Reset
Classification Description Assist customers who have forgotten passwords, can’t log in, need credential resets, are locked out or are experiencing log in problems. Help users change passwords or recover account access.
Scope Your job is only to help customers reset passwords or recover usernames. You can verify identity via email/phone and initiate password resets. You cannot access account details beyond verification or modify any customer information other than passwords.

Instructions

Instruction
Ask which verification method the customer prefers (email or phone) before proceeding with identity verification.
Use Verify Customer Email or Verify Customer Phone action based on customer preference. Don’t attempt password reset until verification succeeds.
After verification, explain the reset process: “I’ll send a secure reset link to your email that expires in 24 hours.”
Use Security Question Verification only if the customer can’t access their registered email/phone.
After completing a reset, ask if they need help with anything else related to account access.

Actions

Action Name description Input(s)
ToVerify Customer Email Verifies identity by matching email to an account. Returns verification status and customer ID if successful. Email Address: Customer’s email (format: example@domain.com).
Verify Customer Phone Verifies identity by sending a code to the customer’s phone. Use when email verification isn’t possible. Phone Number: 10-digit number without special characters.
Send Password Reset Email Sends a 24-hour expiry reset link to verified email. Use only after successful verification. Customer ID: Verified ID from successful verification

Writing Effective Instructions

Here are some examples of instructions that work well with the reasoning engine:

Bad Example Good Example Input(s)
Get the customer’s order details. If a customer asks for the status of an order, offer all options to look up the status using either their email address, order date or the order ID. Provides specific guidance on how to handle a common scenario and provide guidance to use an action that. Uses language that is semantically similar to the action name.
Help with device issues Before using the Answer Questions with Knowledge action to retrieve troubleshooting information, clarify what type of device (iOS or Android). Include the device type in the SearchQuery of the Answer Questions with Knowledge action. Gives clear instruction on what information to gather first and specifies which action to use.
Use knowledge for product questions. For questions about product features, first identify which specific product the customer is asking about. Then use the Knowledge action with the exact product name to retrieve accurate information. Provides a clear sequence of steps and specifies how to make the action more effective.
Check if customers need help. After providing information on delivering status, always ask if the customer needs help with anything else related to their order. Specific about when and how to follow up.

1. Action Name (Action API Name)

Bad Example Good Example Why It’s Better
GetOrderInfo LookupOrderStatus Clearly describes what information the action provides
UpdateContactRecord UpdateCustomerPhoneNumber Specifically describes what is being updated
ProcessPmt ProcessPayment Avoids abbreviations for clarity

2. Action Instructions

Action instructions tell the reasoning engine what the action does and when to use it. These instructions are critical for helping your agent select the right action at the right time.

Bad Example Good Example Why It’s Better
Updates a phone number. Updates the user’s phone number associated with their record. If there is no matching record, it will create a new record. Explains what the action does and how it handles edge cases.
Gets tracking information. Returns tracking information for a customer order based on the tracking number and destination Postcode. Explains when to use this action and what information it requires.
Provides knowledge. Searches the knowledge base for answers to user questions about products, policies or procedures. This action should be used when the user asks “how to” questions or needs information that isn’t specific to their account. Explains when the action should be used in the conversation flow.
Checks account. Verifies if a customer account exists and returns account status information. Use this action when customers are trying to determine if they already have an account or if their account is active. Requires either an email address or phone number to perform the lookup. Clearly explains the purpose, when to use it and what information is needed.

3. Action Input Instructions

Action input instructions define what information the action needs and how the agent should collect it from the customer. Clear input instructions help the agent gather the right information in the right format.

Bad Example Good Example Why It’s Better
Enter order ID. The order ID is an 18-character alphanumeric identifier. Provides format details.
Customer email. The customer’s email address used for account verification. Format should be a valid email address (example@domain.com). Specifies format and validation requirements.
Search query. A detailed search query describing the user’s question. Include specific product names, error codes or symptoms mentioned by the user to improve search results. For technical issues, always include the device type (iOS/Android) and app version if mentioned. Explains how to construct an effective query with specific elements to include.
Phone number. The customer’s 10-digit phone number without spaces or special characters. If the customer provides a number with formatting (like 555-123-4567), remove the special characters before passing to the action. Provides clear formatting instructions and handling guidance.

AI Feature Considerations with Data Cloud

Agentforce Feature description Provisioning
Audit Trail & Feedback Logging Generative AI audit data Optional
Data Library Automation Automates creation of search indexes and retrievers to support Agent Actions like Answer Questions with Knowledge Provisioned by Default
Bring Your Own Large Language Model (BYO-LLM) Allows customers to use their own LLM Optional
Agent Analytics Streams usage data to Data Cloud for Reports & Dashboards Provisioned by Default
External Data Sources (non-CRM) Enables customers to use data from external sources to ground AI generated responses Optional
Unstructured Data Enables customers to use unstructured data to ground AI generated responses Optional
Real Time Data Graphs Enables customers to use normalised data from multiple Data Cloud sources for near real-time grounding of AI generated responses Optional
Retrieval Augmented Generation (RAG) Enables customers to augment their prompts with data from Salesforce and Data Cloud, retrieved at inference time Provisioned by Default