Know your Einstein Bot

Salesforce provides Einstein Bots to build smart assistance for your customers through chat, messaging or voice. Bots answer customer questions with the right information and very efficiently.
Bot saves a lot of human effort and narrows down customers for Agents, they answer simple queries of customers like updating passwords or getting information related to customer and may be difficult tasks if we configure advance level bot.

When you’re ready to set up Einstein Bots for your production org, you need:

  • A Service Cloud license
  • A Live Agent license
  • Lightning Experience

Then you need to set up these things-

  • Publish a Salesforce Community
  • Live Agent setup
  • Add Snap-Ins Chat to Your Community

I am skipping these things because you can learn to set up these things from Trailhead in a better and detailed way. There is a Project named “Build an Einstein Bot” and it has all the info you need to set up bot Prerequisite.
Once you will setup above mentioned things then you can create an Einstein Bot.

So we can move forward to complex things and get to know everything about the bot. An Einstein bot has four options-

  1. Dialogs – we can add certain steps or series of steps in dialogs which includes Messages, Question, Action, Rules.
  2. Entities – If we need input from a customer in a certain format then we use Entities.
  3. Variables – These variables hold values which we get from a customer, Invocable Apex or Flows.
  4. Performance – In this section, we can check performance and error when bot fails.


It has four option and we can any of them in a sequence and bot execute them one by one.


If we want that Bot needs to say something to a customer then we use messages. It can be dynamic by using variables.
Ex – Hi {!VariableName}!


We can ask some questions to a customer and store the answer into some variable and use elsewhere. This also provides showing options to the customer, both static and dynamic. Also, display them as a Menu or Buttons.
Static – Add choices as text when configuring a question.
Dynamic – Pull choices from the Invocable apex or Flow dynamically.


An action will be performed when it bot reaches to this type of step which includes Apex, Flow, Send email.
Apex- An Invocable class method can be called from this action and output of the method will be assigned to any variable.


We can pass some inputs to the flow and flow will return Output(Only flow output variables will show on Bot UI for assigning them to bot variables)

Send Email

An Email will be sent according to the values passed in this step.


We can set some rules like on these conditions perform these actions(conditions and actions can’t be more than 5)

  • Condition – Set conditions on variables like it is set or not or equals to some value.
    • possible values –  Equals, Does Not Equal, Is set, Is Not Set, Is True, Is False.
  • Rule Action – Actions will be performed when all conditions will be fulfilled in sequence.
    • Call Dialog – Bot executes the dialog definition which is provided in this option. it will be a background process.
    • Redirect to Dialog – Bot redirects to the dialog and starts showing messages of that dialog.
    • Clear variable value – Value of the provided variable will be cleared. it can be used when we want to calculate something again in some condition.
    • Transfer to the agent – Bot will stop and chat will be transferred to Agent.
    • PreChat Form – You can access pre-chat form field values and assign them to bot variables. When you create any custom field in “Live chat transcript” object then that field starts to show in this rule action(Pre chat form) and when you pass any value from your Pre chat form Or Snap-In Script to Live chat transcript Object fields then this rule action can capture those values and you can use them in your bot.


We use entities if we want a customer input in a certain format and for this, we use Regular expressions.
Let’s create a Entity named “CaseNumber” with a extraction type Pattern and RegEx mask  \bC\-\d{4}\b
This indicates an order number must be one word, starting with a letter C, followed by a dash, then ended with 4 numbers.
So the customer can enter values only in this format.


We can create variables of these following types which hold values from the response of customer of Apex or flows.

  • Text
  • Number
  • Boolean
  • Object
  • Date
  • DateTime
  • Currency


We can check bot performance from this section and it shows data in two section


It has certain performance variables when shows bot performance in the dashboard.

  • AVG INTERACTIONS (Per Session)
  • AVG DURATION(Per Session)

Events log

It has ConversationsLogs in which we can see bot execution like what happened in any particular session and if any error occurred then it shows detailed error log with the following attributes.

  • DATE

This helps a lot when any apex, flow action fails and we don’t know what dialog or action actually failing.

Try to build you bot in a way that the customer should feel he/she is talking to a agent 😉

Leave a Reply

Your email address will not be published. Required fields are marked *