Newer Version Available

This content describes an older version of this product. View Latest

BotVersion

Represents the configuration details for a specific Einstein Bot version, including dialogs, intents, entities, and slots. This type extends the Metadata metadata type and inherits its fullName field.

File Suffix and Directory Location

BotVersion components have the suffix .bot and are stored in the bot folder. BotVersion is a top-level child of Bot and shares its suffix and file directory.

Version

BotVersion components are available in API version 43.0 and later.

Special Access Rules

BotVersion is available only if Live Agent and Einstein Bots are enabled in your org.

Fields

Field Name Field Type Description
botDialogGroups BotDialogGroup[] The list of dialog groups in this bot version.
botDialogs BotDialog[] The list of dialogs in this bot version.
entryDialog string Required. A reference to the first dialog that the bot presents to your customer. For example, Welcome.
localMlDomain LocalMlDomain Required. An Einstein Intent Set local to a bot version that groups intents, entities, and slots associated with a bot version.
mainMenuDialog string Required. A reference to the dialog identified as the main menu dialog. For example, Main Menu.
responseDelayMilliseconds int An optional default or custom delay after every bot response to simulate typing.

BotDialogGroup

The list of dialog groups in this bot version.

Field Name Field Type Description
description string A description of the bot dialog group.
developerName string Required. This unique name prevents conflicts with other dialog groups associated with the same bot version. This name can contain only underscores and alphanumeric characters. The name must begin with a letter, not include spaces, not end with an underscore, and not contain two consecutive underscores.
label string Required. A label that identifies the dialog group throughout the Salesforce user interface.

BotDialog

The list of dialogs in this bot version.

Field Name Field Type Description
botDialogGroup string The bot dialog group that contains this bot dialog.
botSteps BotStep[] A list of steps that are executed as part of the dialog.
description string A description of the bot dialog.
developerName string Required. This unique name prevents conflicts with other dialogs associated with the same bot version. This name can contain only underscores and alphanumeric characters. It must begin with a letter, not include spaces, not end with an underscore, and not contain two consecutive underscores.
label string Required. A label that identifies the dialog throughout the Salesforce user interface.
mlIntent string Required. The name of the intent associated with a dialog.
showInFooterMenu boolean Show this dialog in the Bot Options menu. The default value is false.

BotStep

A step that is executed as part of the dialog.

Field Name Field Type Description
booleanFilter string This field is reserved for future use.
botInvocation BotInvocation Bot Invocation used by a BotStep of type Invocation.
botMessages BotMessage[] List of bot messages used by a BotStep of type Message.
botNavigation BotNavigation Bot Navigation used by a BotStep of type Navigation.
botStepConditions BotStepCondition[] List of BotStep conditions associated with a BotStep of type Group.
botSteps BotStep[] List of BotSteps associated to a Bot Step of type Group.
botVariableOperation BotVariableOperation[] Bot Variable Operation used by a BotStep of type VariableOperation.
type BotStepType (enumeration of type string) Required. Valid values are:
  • Navigation
  • Invocation
  • VariableOperation
  • Message
  • Wait
  • Group

BotInvocation

Bot Invocation used by a BotStep of type Invocation.

Field Name Field Type Description
apexClass string Required. The name of the Apex class used by a Bot Invocation.
invocationMappings BotInvocationMapping[] List of Bot Invocation Mappings for a Bot Invocation.

BotInvocationMapping

List of Bot Invocation Mappings for a Bot Invocation.

Field Name Field Type Description
botVariable string Name of the Bot Variable that is used as part of an Invocation Mapping.
parameterName string Required. Name of an Input/Output parameter of the parent Bot Invocation target.
type BotInvocationMappingType (enumeration of type string) Required. Valid values are:
  • Input
  • Output

BotMessage

A bot messages used by a BotStep of type Message.

Field Name Field Type Description
message string Required. Message to display as part of an outgoing message from the bot to the customer.

BotNavigation

Bot navigation used by a BotStep of type Navigation.

Field Name Field Type Description
botNavigationLinks BotNavigationLink[] List of Bot Navigation links associated with a Bot Navigation of type Call or Redirect.
type BotNavigationType (enumeration of type string) Required. Valid values are:
  • Call
  • Redirect
  • TransferToAgent
  • EndChat

BotNavigationLink

List of Bot Navigation links associated with a Bot Navigation of type Call or Redirect.

Field Name Field Type Description
label string Label displayed when more than one Bot Navigation Link is available under a Bot Navigation of type Redirect. The target dialog label is used when no label is provided.
targetBotDialog string Required. Name of the target dialog to be called as part of this Bot Navigation Link.

BotStepCondition

List of BotStep conditions associated with a BotStep of type Group.

Field Name Field Type Description
leftOperandBotVariable string Required. Name of the bot variable that is used as the left side of the condition operation.
operatorType BotStepConditionOperatorType (enumeration of type string) Required. Valid values are:
  • Equals
  • NotEquals
  • IsSet
  • IsNotSet
rightOperandValue string Value that is used as the right side of the condition operation. This value is ignored when using IsSet and IsNotSet operators.

BotVariableOperation

Bot variable operation used by a BotStep of type VariableOperation.

Field Name Field Type Description
botInvocation BotInvocation Bot Invocation used to provide Dynamic choices by a Bot Variable Operation of type Collect and quickReplyType of Dynamic.
botMessages BotMessage[] List of Bot Messages used as prompt messages by a Bot Variable Operation of type Collect.
botQuickReplyOptions BotQuickReplyOption[] List of static choice options used by a Bot Variable Operation of type Collect and quickReplyType of Static.
botVariableOperands BotVariableOperand[] List of Bot Variable Operands associated with a Bot Variable of type Set or Unset.
invalidInputBotNavigation BotNavigation Bot Navigation used by a Bot Variable Operation of type Collect. This navigation is executed when the associated Bot Invocation doesn’t return any options.
quickReplyOptionTemplate string Formula template used to resolve a label for Dynamic choice options of type Object.
quickReplyType BotQuickReplyType (enumeration of type string) Valid values are:
  • Static
  • Dynamic
quickReplyWidgetType BotWidgetType (enumeration of type string) Valid values are:
  • Menu
  • Buttons
type Required. BotVariableOperationType (enumeration of type string) Valid values are:
  • Set
  • Unset
  • Collect

BotQuickReplyOption

List of static choice options used by a bot variable operation of type Collect and quickReplyType of Static.

Field Name Field Type Description
literalValue string Required. Value to be displayed as a menu or button choice to your customer.

BotVariableOperand

List of bot variable operands associated with a bot variable of type Set or Unset.

Field Name Field Type Description
botVariable string Name of the bot variable that is used as part of the operand.
disableAutoFill boolean Disables auto-fill behavior for a bot bariable under a bot variable operation of type Collect.
field string API Name of an SObject Field to be used as part of the operand.
operandType BotVariableOperandType (enumeration of type string) Required. Valid values are:
  • Source
  • Target
sobjectType string SObject Type for the field property defined as part of the operand. LiveChatTranscript is the only allowed value.
value string This field is reserved for future use.

LocalMlDomain

An Einstein Intent Set local to the current bot version.

Field Name Field Type Description
label string Label that represents an Einstein Intent Set local to the current bot version throughout the Salesforce user interface.
mlIntents MlIntent[] List of intents associated with this local intent set.
mlSlotClasses MlSlotClass[] List of entities associated with this local intent set.
mlSlots MlSlot[] List of slots associated with this local intent set.
name string Required. This unique name prevents conflicts with other local Einstein Intent Sets. This name can contain only underscores and alphanumeric characters and must be unique in your org. It must begin with a letter, not include spaces, not end with an underscore, and not contain two consecutive underscores.

MlSlot

A slot associated with this local intent set.

Field Name Field Type Description
developerName string Required. This unique name prevents conflicts with other slots in a bot version's local intent set. This name can contain only underscores and alphanumeric characters and must be unique in your org. It must begin with a letter, not include spaces, not end with an underscore, and not contain two consecutive underscores.
label string Label that identifies a slot throughout the Salesforce user interface.
mlSlotClass string Required. Name of the entity type used by this slot.

Declarative Metadata Sample Definition

The following is an example of a BotVersion.

1<?xml version="1.0" encoding="UTF-8"?>
2<Bot xmlns="http://soap.sforce.com/2006/04/metadata">
3    <botVersions>
4        <fullName>v1</fullName>
5        <botDialogGroups>
6            <developerName>Order_Management</developerName>
7            <label>Order Management</label>
8            <description>Order Management</description>
9        </botDialogGroups>
10        <botDialogs>
11            <botSteps>
12                <botMessages>
13                    <message>Hi! I&apos;m your helpful bot.</message>
14                </botMessages>
15                <type>Message</type>
16            </botSteps>
17            <botSteps>
18                <botSteps>
19                    <botVariableOperation>
20                        <botVariableOperands>
21                            <botVariable>Contact_Id</botVariable>
22                            <operandType>Target</operandType>
23                        </botVariableOperands>
24                        <botVariableOperands>
25                            <sobjectType>LiveChatTranscript</sobjectType>
26                            <field>ContactId</field>
27                            <operandType>Source</operandType>
28                        </botVariableOperands>
29                        <type>Set</type>
30                    </botVariableOperation>
31                    <type>VariableOperation</type>
32                </botSteps>
33                <botSteps>
34                    <botNavigation>
35                        <type>TransferToAgent</type>
36                    </botNavigation>
37                    <type>Navigation</type>
38                </botSteps>
39                <type>Group</type>
40            </botSteps>
41            <botSteps>
42                <botNavigation>
43                    <botNavigationLinks>
44                        <targetBotDialog>Main_Menu</targetBotDialog>
45                    </botNavigationLinks>
46                    <type>Redirect</type>
47                </botNavigation>
48                <type>Navigation</type>
49            </botSteps>
50            <developerName>Welcome</developerName>
51            <label>Welcome</label>
52            <mlIntent>Welcome</mlIntent>
53            <showInFooterMenu>false</showInFooterMenu>
54        </botDialogs>
55        <botDialogs>
56            <botSteps>
57                <botMessages>
58                    <message>What would you like to do?</message>
59                </botMessages>
60                <type>Message</type>
61            </botSteps>
62            <botSteps>
63                <botNavigation>
64                    <botNavigationLinks>
65                            <label>Track Order</label>
66                        <targetBotDialog>Track_Order</targetBotDialog>
67                    </botNavigationLinks>
68                    <botNavigationLinks>
69                            <label>New Order</label>
70                        <targetBotDialog>New_Order</targetBotDialog>
71                    </botNavigationLinks>
72                    <botNavigationLinks>
73                        <targetBotDialog>Update_Order</targetBotDialog>
74                    </botNavigationLinks>
75                    <type>Redirect</type>
76                </botNavigation>
77                <type>Navigation</type>
78            </botSteps>
79            <developerName>Main_Menu</developerName>
80            <label>Main Menu</label>
81            <mlIntent>Main_Menu</mlIntent>
82            <showInFooterMenu>false</showInFooterMenu>
83        </botDialogs>
84        <botDialogs>
85            <botSteps>
86                <botNavigation>
87                    <type>TransferToAgent</type>
88                </botNavigation>
89                <type>Navigation</type>
90            </botSteps>
91            <developerName>Transfer_To_Agent</developerName>
92            <label>Transfer To Agent</label>
93            <mlIntent>Transfer_To_Agent</mlIntent>
94            <showInFooterMenu>false</showInFooterMenu>
95        </botDialogs>
96        <botDialogs>
97            <botSteps>
98                <botMessages>
99                    <message>Goodbye! Click the &quot;End Chat&quot; button to end this chat</message>
100                </botMessages>
101                <type>Message</type>
102            </botSteps>
103            <botSteps>
104                <type>Wait</type>
105            </botSteps>
106            <developerName>End_Chat</developerName>
107            <label>End Chat</label>
108            <mlIntent>End_Chat</mlIntent>
109            <showInFooterMenu>false</showInFooterMenu>
110        </botDialogs>
111        <botDialogs>
112            <botDialogGroup>Order_Management</botDialogGroup>
113            <botSteps>
114                <botVariableOperation>
115                    <botMessages>
116                        <message>What is the size?</message>
117                    </botMessages>
118                    <botQuickReplyOptions>
119                        <literalValue>Small</literalValue>
120                    </botQuickReplyOptions>
121                    <botQuickReplyOptions>
122                        <literalValue>Medium</literalValue>
123                    </botQuickReplyOptions>
124                    <botQuickReplyOptions>
125                        <literalValue>Large</literalValue>
126                    </botQuickReplyOptions>
127                    <botVariableOperands>
128                        <botVariable>Burrito_Size</botVariable>
129                        <disableAutoFill>false</disableAutoFill>
130                        <operandType>Target</operandType>
131                    </botVariableOperands>
132                    <quickReplyType>Static</quickReplyType>
133                    <quickReplyWidgetType>Buttons</quickReplyWidgetType>
134                    <type>Collect</type>
135                </botVariableOperation>
136                <type>VariableOperation</type>
137            </botSteps>
138            <botSteps>
139                <botVariableOperation>
140                    <botMessages>
141                        <message>What type of salsa would you like?</message>
142                    </botMessages>
143                    <quickReplyType>Dynamic</quickReplyType>
144                    <quickReplyWidgetType>Buttons</quickReplyWidgetType>
145                    <botInvocation>
146                        <apexClass>GetSalsaTypes</apexClass>
147                        <invocationMappings>
148                                <parameterName>output</parameterName>
149                            <type>Output</type>
150                        </invocationMappings>
151                        </botInvocation>
152                    <quickReplyOptionTemplate>{!name} - {!spiceLevel}</quickReplyOptionTemplate>
153                    <invalidInputBotNavigation>
154                        <botNavigationLinks>
155                            <label>Main Menu</label>
156                                    <targetBotDialog>Main_Menu</targetBotDialog>
157                            </botNavigationLinks>
158                            <type>Redirect</type>
159                    </invalidInputBotNavigation>
160                    <type>Collect</type>
161                    <botVariableOperands>
162                        <botVariable>Salsa_Type</botVariable>
163                        <disableAutoFill>false</disableAutoFill>
164                        <operandType>Target</operandType>
165                    </botVariableOperands>
166                </botVariableOperation>
167                <type>VariableOperation</type>
168            </botSteps>
169            <botSteps>
170                <botInvocation>
171                    <apexClass>NewOrderService</apexClass>
172                    <invocationMappings>
173                        <botVariable>Burrito_Size</botVariable>
174                        <parameterName>order</parameterName>
175                        <type>Input</type>
176                    </invocationMappings>
177                </botInvocation>
178                <type>Invocation</type>
179            </botSteps>
180            <botSteps>
181                <botVariableOperation>
182                    <botInvocation>
183                        <apexClass>NewOrderService</apexClass>
184                        <invocationMappings>
185                            <botVariable>Burrito_Size</botVariable>
186                            <parameterName>order</parameterName>
187                            <type>Input</type>
188                        </invocationMappings>
189                        <invocationMappings>
190                            <botVariable>Order_Number</botVariable>
191                            <parameterName>output</parameterName>
192                            <type>Output</type>
193                        </invocationMappings>
194                    </botInvocation>
195                    <type>Set</type>
196                </botVariableOperation>
197                <type>VariableOperation</type>
198            </botSteps>
199            <botSteps>
200                <botStepConditions>
201                    <leftOperandBotVariable>Order_Number</leftOperandBotVariable>
202                    <operatorType>IsNotSet</operatorType>
203                </botStepConditions>
204                <botSteps>
205                    <botVariableOperation>
206                        <botVariableOperands>
207                            <botVariable>Burrito_Size</botVariable>
208                            <operandType>Target</operandType>
209                        </botVariableOperands>
210                        <type>Unset</type>
211                    </botVariableOperation>
212                    <type>VariableOperation</type>
213                </botSteps>
214                <botSteps>
215                    <botNavigation>
216                        <type>TransferToAgent</type>
217                    </botNavigation>
218                    <type>Navigation</type>
219                </botSteps>
220                <type>Group</type>
221            </botSteps>
222            <botSteps>
223                <botStepConditions>
224                    <leftOperandBotVariable>Burrito_Size</leftOperandBotVariable>
225                    <operatorType>Equals</operatorType>
226                    <rightOperandValue>Godzilla</rightOperandValue>
227                </botStepConditions>
228                <botSteps>
229                    <botNavigation>
230                        <type>TransferToAgent</type>
231                    </botNavigation>
232                    <type>Navigation</type>
233                </botSteps>
234                <type>Group</type>
235            </botSteps>
236            <botSteps>
237                <type>Wait</type>
238            </botSteps>
239            <developerName>New_Order</developerName>
240            <label>New Order</label>
241            <mlIntent>New_Order</mlIntent>
242            <showInFooterMenu>false</showInFooterMenu>
243        </botDialogs>
244        <botDialogs>
245            <botDialogGroup>Order_Management</botDialogGroup>
246            <botSteps>
247                <type>Wait</type>
248            </botSteps>
249            <developerName>Track_Order</developerName>
250            <label>Track Order</label>
251            <mlIntent>Track_Order</mlIntent>
252            <showInFooterMenu>false</showInFooterMenu>
253        </botDialogs>
254        <botDialogs>
255                <description>Order Management</description>
256            <botDialogGroup>Order_Management</botDialogGroup>
257            <botSteps>
258                <type>Wait</type>
259            </botSteps>
260            <developerName>Update_Order</developerName>
261            <label>Update Order</label>
262            <mlIntent>Update_Order</mlIntent>
263            <showInFooterMenu>false</showInFooterMenu>
264        </botDialogs>
265        <entryDialog>Welcome</entryDialog>
266        <localMlDomain>
267            <label>TacoCat Bot</label>
268            <mlIntents>
269                <developerName>End_Chat</developerName>
270                <label>End Chat</label>
271                <description>End Chat</description>
272            </mlIntents>
273            <mlIntents>
274                <developerName>Main_Menu</developerName>
275                <label>Main Menu</label>
276            </mlIntents>
277            <mlIntents>
278                <developerName>New_Order</developerName>
279                <label>New Order</label>
280            </mlIntents>
281            <mlIntents>
282                <developerName>Track_Order</developerName>
283                <label>Track Order</label>
284            </mlIntents>
285            <mlIntents>
286                <developerName>Transfer_To_Agent</developerName>
287                <label>Transfer To Agent</label>
288            </mlIntents>
289            <mlIntents>
290                <developerName>Update_Order</developerName>
291                <label>Update Order</label>
292                <mlIntentUtterances>
293                    <utterance>I want to order a burrito</utterance>
294                </mlIntentUtterances>
295                <mlIntentUtterances>
296                    <utterance>I want to place an order</utterance>
297                </mlIntentUtterances>
298                <mlIntentUtterances>
299                    <utterance>Do you have tacos and burritos</utterance>
300                </mlIntentUtterances>
301                <mlIntentUtterances>
302                    <utterance>Create a new order</utterance>
303                </mlIntentUtterances>
304                <mlIntentUtterances>
305                    <utterance>I want to start a new order</utterance>
306                </mlIntentUtterances>
307                <relatedMlIntents>
308                        <relatedMlIntent>RestaurantDomain.Update_Order</relatedMlIntent>
309                </relatedMlIntents>
310            </mlIntents>
311            <mlIntents>
312                <developerName>Welcome</developerName>
313                <label>Welcome</label>
314            </mlIntents>
315            <mlSlotClasses>
316                <developerName>Burrito_Size</developerName>
317                <description>Size of Burrito</description>
318                <extractionType>Value</extractionType>
319                <label>Burrito Size</label>
320            </mlSlotClasses>
321            <mlSlotClasses>
322                <developerName>Order_Number</developerName>
323                <extractionRegex>/bO[0-9]{4}/b</extractionRegex>
324                <extractionType>Pattern</extractionType>
325                <label>Order Number</label>
326            </mlSlotClasses>
327            <mlSlotClasses>
328                <developerName>location</developerName>
329                <extractionType>Value</extractionType>
330                <label>location</label>
331                <mlSlotClassValues>
332                    <synonymGroup>
333                        <languages>en_US</languages>
334                        <terms>San Francisco</terms>
335                        <terms>The City</terms>
336                    </synonymGroup>
337                    <value>SF</value>
338                    </mlSlotClassValues>
339                    <mlSlotClassValues>
340                        <synonymGroup>
341                        <languages>en_US</languages>
342                        <terms>Oakland</terms>
343                        <terms>The Town</terms>
344                    </synonymGroup>
345                        <value>OAK</value>
346                    </mlSlotClassValues>
347                </mlSlotClasses>
348            <mlSlots>
349                <developerName>Burrito_Size</developerName>
350                <label>Burrito Size</label>
351                <mlSlotClass>Burrito_Size</mlSlotClass>
352            </mlSlots>
353            <mlSlots>
354                <developerName>Order_Number</developerName>
355                <label>Order Number</label>
356                <mlSlotClass>Order_Number</mlSlotClass>
357            </mlSlots>
358            <mlSlots>
359                <developerName>Salsa_Type</developerName>
360                <label>Salsa Type</label>
361                <mlSlotClass>_Object</mlSlotClass>
362            </mlSlots>
363            <mlSlots>
364                <developerName>Contact_Id</developerName>
365                <label>Contact Id</label>
366                <mlSlotClass>_Text</mlSlotClass>
367            </mlSlots>
368            <name>TacoCat_Bot_ld1</name>
369        </localMlDomain>
370        <mainMenuDialog>Main_Menu</mainMenuDialog>
371        <responseDelayMilliseconds>100</responseDelayMilliseconds>
372    </botVersions>
373    <description>This is the perfect bot</description>
374    <label>TacoCat Bot</label>
375</Bot>

The following is an example package.xml that references the previous definition.

1<?xml version="1.0" encoding="UTF-8"?>
2<Package xmlns="http://soap.sforce.com/2006/04/metadata">
3    <types>
4        <members>TacoCat_Bot.v1</members>
5        <name>BotVersion</name>
6    </types>
7    <version>43.0</version>
8</Package>