How do administrators build and manage conversational dialogue blocks within Einstein Bot builder?
Answer
Basics: A bot conversation is a set of dialogs. Each dialog does one job (check order status, reset password). Admins connect dialogs through menus, rules and NLP intents, with no code unless a custom action is needed.
How it works: Setup > Einstein Bots (Bot Builder). Standard dialogs include Welcome, Main Menu, Transfer to Agent, End Chat, Confused (fallback) and Error. Within a dialog, add steps: Message, Menu, Question (collects into a variable), Rule (conditions and branching), Action (Flow, Apex, quick action or Prompt), Variable Operation, Transfer, End Chat. Intent Sets with sample utterances train the NLP model that maps user text to dialogs. Test in the builder preview, then activate a version and connect it to a Messaging channel or Embedded Service with Omni-Channel routing for escalation.
Advanced / deep dive: Use conversation variables and context variables to pass data. Put real logic in Flows or Apex invocable methods. Design for failure: a Confused dialog that offers a menu and escalation after repeated misses; Error dialog with a handoff. Keep intents distinct (overlapping utterances reduce accuracy) and provide enough varied utterances per intent; check current guidance in Salesforce help. Version control: bots have versions, so copy, test and activate; consider metadata deployment for promotion. The product line is evolving toward Agentforce service agents, so evaluate when to migrate.
Code / config example:
public with sharing class CaseStatusAction {
public class In { @InvocableVariable(required=true) String caseNumber; }
{ String status; }
List<Out> {
Set<String> nums = <String>();
(In r : reqs) nums.add(r.caseNumber);
Map<String, Case> byNum = <String, Case>();
(Case c : [SELECT CaseNumber, Status FROM Case WHERE CaseNumber IN :nums]) byNum.put(c.CaseNumber, c);
List<Out> res = <Out>();
(In r : reqs) { (); o.status = byNum.containsKey(r.caseNumber) ? byNum.get(r.caseNumber).Status : ; res.add(o); }
res;
}
}