Bot Action
A Bot Action in Salesforce is a configurable step inside an Einstein Bot or Agentforce Bot dialog that does something beyond conversation: calls an Apex method, runs a Flow, fetches data from a Salesforce object, posts to an external system, transfers the conversation to a human agent, or attaches a Knowledge article to the response.
Definition
A Bot Action in Salesforce is a configurable step inside an Einstein Bot or Agentforce Bot dialog that does something beyond conversation: calls an Apex method, runs a Flow, fetches data from a Salesforce object, posts to an external system, transfers the conversation to a human agent, or attaches a Knowledge article to the response. Bot Actions are the bridge between the conversational layer (intent recognition, response templates) and the rest of Salesforce. A bot that only chats is a chatbot; a bot that chats then books an appointment, looks up an order, or escalates to support is one that uses Bot Actions to do real work.
Bot Actions are configured inside Einstein Bot Builder (or its successor surface in Agentforce). Each Action has a type, a set of input variables (filled from prior conversation context), a set of output variables (used to shape subsequent responses), and a configuration specific to the action type. The bot's dialog nodes string Bot Actions together with conversational steps and decision logic so the whole conversation feels coherent. Most production Einstein Bot deployments invest more design effort in Bot Actions than in the dialog tree because the actions are where the actual customer value happens.
How Bot Actions execute work inside Salesforce conversations
The action type catalogue
Bot Actions include Call Flow, Call Apex (Invocable Method), Object Search (find a record), Object Create (create a record), Send Email, Transfer to Agent, Attach Knowledge, and several conversational helpers. Each type has a different configuration surface; the choice depends on what the dialog needs to do at that point.
Input and output variables
Bot Actions take input variables (collected from earlier conversation, passed in from URL, looked up from CRM context) and return output variables (the order ID looked up, the appointment time confirmed, the error message captured). Dialog steps after the action reference the outputs to shape the next response.
Calling Flow from a bot
The Call Flow action invokes an autolaunched Flow with input variables and receives outputs. This is the recommended pattern for non-trivial business logic; Flow is easier to maintain than Apex for most admin-written automation. Subflows and Apex-from-Flow extend the pattern further.
Calling Apex from a bot
The Call Apex action invokes an @InvocableMethod method. Apex is the right choice for complex logic, custom integrations, or anything beyond what Flow can express cleanly. Like all Apex, the method respects governor limits and should be bulkified.
Transfer to Agent
The Transfer to Agent action escalates the conversation to a human in Omni-Channel. The bot passes the transcript and any captured context so the human sees the full conversation. This is the safety net for every Einstein Bot: when the bot cannot resolve, escalation is the supported path.
Knowledge attachment
The Attach Knowledge action surfaces relevant Knowledge articles inline in the conversation. Configuration ties the action to a search query (often derived from the user's question), and the bot returns one or more articles as part of the response. This is the standard self-service pattern.
Error handling within actions
Each Bot Action can fail (Flow errors, Apex exceptions, external system timeouts). The dialog should branch on the action's success/failure output and route the conversation to a graceful fallback. Without explicit error handling, the bot can stall or produce confusing responses.
Agentforce evolution of Bot Actions
Agentforce reframes Bot Actions as Topics and Actions inside a reasoning engine. The underlying mechanics (Flow, Apex, search, transfer) are the same; the orchestration is reasoning-driven rather than dialog-tree-driven. Customers migrating from Einstein Bots to Agentforce keep their Flow- and Apex-based Bot Actions and rewire them as Agent Actions in the new model.
How to design and configure Bot Actions
Effective Bot Actions are the difference between a chat surface and an automated customer-service capability. The design work is choosing the right action types and getting input/output variables right.
- Map the customer journey
For each intent the bot handles, list what happens after the conversation collects the necessary information. Each step that touches data or routes the conversation is a Bot Action.
- Pick the right action type
Object lookup for simple reads, Flow for business logic, Apex for complex integrations, Transfer to Agent for escalation, Attach Knowledge for self-service.
- Map inputs and outputs
Decide which variables flow into each action and which variables come back. The mapping is the contract between the action and the surrounding dialog.
- Add error handling
Every action can fail. Branch the dialog on success/failure and route the conversation gracefully when something breaks.
- Test against real customer phrasings
Bot Actions chain off intent recognition. Test the full flow with the variety of phrasings real customers use; rigid test scripts hide intent-misrecognition bugs.
- Bot Actions can fail. Without explicit error branching, the bot stalls or produces confusing responses when the underlying action errors.
- Input/output variable typos break the chain silently. The mapping is the contract; misnamed variables produce no error but no result either.
- Calling Apex from a bot subjects the action to governor limits. Bulkification and exception handling matter as much as in any other Apex invocation.
- Transfer to Agent only works when Omni-Channel is configured and an Agent is available. Plan the unavailability path (waiting room, callback request) explicitly.
Trust & references
Cross-checked against the following references.
- Bot Dialog ActionsSalesforce Help
- Einstein Bots OverviewSalesforce Help
Straight from the source - Salesforce's reference material on Bot Action.
- Build Bot DialogsSalesforce Help
About the Author
Dipojjal Chakrabarti is a B2C Solution Architect with 29 Salesforce certifications and over 13 years in the Salesforce ecosystem. He runs salesforcedictionary.com to help admins, developers, architects, and cert/interview candidates sharpen their fundamentals. More about Dipojjal.
Test your knowledge
Q1. What is a Bot Action in Einstein Bots?
Q2. Which of these is NOT a typical Bot Action type?
Q3. How are Bot Actions used to build a dialog?
Discussion
Loading discussion…