Newer Version Available

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

BotTemplate

Represents the configuration details for a specific Einstein Bot template, including dialogs and variables.

Where possible, we changed noninclusive terms to align with our company value of Equality. We maintained certain terms to avoid any effect on customer implementations.

Important

Parent Type

This type extends the Metadata metadata type and inherits its fullName field.

File Suffix and Directory Location

BotTemplate components have the suffix .botTemplate and are stored in the botTemplates folder.

Version

BotTemplate components are available in API version 55.0 and later.

Special Access Rules

BotTemplate is available only if Chat and Einstein Bots are enabled in your org.

Fields

Field Name Description
botDialogGroups
Field Type
BotDialogGroup[]
Description
The list of dialog groups in this bot template.
botDialogs
Field Type
BotDialog[]
Description
The list of dialogs in this bot template.
conversationLanguages
Field Type
string
Description

Required.

Specifies the language of the bot template.
contextVariables
Field Type
ConversationContextVariable[]
Description
Represents the context variables that enable your bot to gather customer information regardless of channel.
conversationGoals
Field Type
ConversationDefinitionGoal[]
Description
The list of goals in this bot template. Available in API version 57.0 and later.
conversationSystemDialogs
Field Type
ConversationSystemDialog[]
Description
A system function assigned to a dialog.
conversationVariables
Field Type
ConversationVariable[]
Description
A container that stores a specific piece of data collected from the customer. You can use variables within dialog actions as both inputs and outputs.
description
Field Type
string
Description
A description of the bot template.
entryDialog
Field Type
string
Description
A reference to the first dialog that the bot presents to your customer. For example, Welcome.
icon
Field Type
string
Description
The icon used to identify the template.
mainMenuDialog
Field Type
string
Description
A reference to the dialog identified as the main menu dialog. For example, Main Menu.
masterLabel
Field Type
string
Description

Required.

A user-friendly label for BotTemplate, which is defined when the BotTemplate is created.
mlDomain
Field Type
LocalMlDomain
Description

Required.

Represents the Einstein Intent Set that groups intents, entities, and variables associated with a template.
permissionSet
Field Type
string
Description
The permission set associated with the bot template. Available in API version 59.0 and later.
richContentEnabled
Field Type
boolean
Description
Indicates whether the template is available for enhanced bots (true) or for standard bots (false). The default is false.
type
Field Type
BotType (enumeration of type string)
Description
This field represents the configuration type of the bot. The default value is Bot.
Valid values are:
  • Bot—Default Einstein Bot configuration.
  • ExternalCopilot— An external-facing agent. For example, an Agentforce Service agent.
  • InternalCopilot— An internal-facing agent. For example, an Agentforce Employee agent.

Declarative Metadata Sample Definition

The following is an example of a BotTemplate component.

1<?xml version="1.0" encoding="UTF-8"?>
2<BotTemplate xmlns="http://soap.sforce.com/2006/04/metadata">
3    <botDialogGroups>
4        <developerName>dialog_group1</developerName>
5        <label>dialog group1</label>
6    </botDialogGroups>
7    <botDialogs>
8        <developerName>Test_Dialog_1</developerName>
9        <label>Test_Dialog_1</label>
10        <showInFooterMenu>false</showInFooterMenu>
11    </botDialogs>
12    <botDialogs>
13        <developerName>Test_Dialog_2</developerName>
14        <label>Test_Dialog_2</label>
15        <showInFooterMenu>false</showInFooterMenu>
16    </botDialogs>
17    <botDialogs>
18        <botSteps>
19            <botMessages>
20                <message>Hi! I&apos;m your helpful bot.</message>
21                <messageIdentifier>m1</messageIdentifier>
22            </botMessages>
23            <stepIdentifier>s1</stepIdentifier>
24            <type>Message</type>
25        </botSteps>
26        <botSteps>
27           <conversationRecordLookup>
28               <SObjectType>Account</SObjectType>
29               <conditions>
30                   <leftOperand>Account.Phone</leftOperand>
31                   <operatorType>Equal</operatorType>
32                   <rightOperandValue>Value</rightOperandValue>
33                   <sortOrder>0</sortOrder>
34               </conditions>
35               <lookupFields>
36                   <fieldName>Account.Phone</fieldName>
37               </lookupFields>
38               <lookupFields>
39                   <fieldName>Account.OwnerId</fieldName>
40               </lookupFields>
41               <maxLookupResults>1</maxLookupResults>
42               <sourceVariableName>_LastCustomerInput</sourceVariableName>
43               <sourceVariableType>ConversationVariable</sourceVariableType>
44               <targetVariableName>MyCustomVariable</targetVariableName>
45           </conversationRecordLookup>
46           <stepIdentifier>s2</stepIdentifier>
47           <type>RecordLookup</type>
48        </botSteps>
49        <botSteps>
50            <botNavigation>
51                <botNavigationLinks>
52                    <targetBotDialog>Main_Menu</targetBotDialog>
53                </botNavigationLinks>
54                <type>Redirect</type>
55            </botNavigation>
56            <stepIdentifier>s3</stepIdentifier>
57            <type>Navigation</type>
58        </botSteps>
59        <developerName>Welcome</developerName>
60        <label>Welcome</label>
61        <mlIntent>Welcome</mlIntent>
62        <showInFooterMenu>false</showInFooterMenu>
63    </botDialogs>
64    <botDialogs>
65        <botSteps>
66            <stepIdentifier>s4</stepIdentifier>
67            <type>Wait</type>
68        </botSteps>
69        <developerName>Main_Menu</developerName>
70        <label>Main Menu</label>
71        <mlIntent>Main_Menu</mlIntent>
72        <showInFooterMenu>false</showInFooterMenu>
73    </botDialogs>
74    <botDialogs>
75        <botSteps>
76            <botMessages>
77                <message>Goodbye! Click the &quot;End Chat&quot; button to end this chat</message>
78                <messageIdentifier>m2</messageIdentifier>
79            </botMessages>
80            <stepIdentifier>s6</stepIdentifier>
81            <type>Message</type>
82        </botSteps>
83        <botSteps>
84            <stepIdentifier>s7</stepIdentifier>
85            <type>Wait</type>
86        </botSteps>
87        <developerName>End_Chat</developerName>
88        <label>End Chat</label>
89        <mlIntent>End_Chat</mlIntent>
90        <showInFooterMenu>false</showInFooterMenu>
91    </botDialogs>
92    <botDialogs>
93        <botSteps>
94            <botMessages>
95                <message>Unfortunately, there are no agents available at the moment</message>
96                <messageIdentifier>m3</messageIdentifier>
97            </botMessages>
98            <stepIdentifier>s8</stepIdentifier>
99            <type>Message</type>
100        </botSteps>
101        <botSteps>
102            <stepIdentifier>s9</stepIdentifier>
103            <type>Wait</type>
104        </botSteps>
105        <developerName>No_Agent_Available</developerName>
106        <label>No Agent</label>
107        <showInFooterMenu>false</showInFooterMenu>
108    </botDialogs>
109    <contextVariables>
110        <contextVariableMappings>
111            <SObjectType>LiveChatTranscript</SObjectType>
112            <fieldName>LiveChatTranscript.ChatKey</fieldName>
113            <messageType>WebChat</messageType>
114        </contextVariableMappings>
115        <dataType>Text</dataType>
116        <developerName>ChatKey</developerName>
117        <label>Chat Key</label>
118    </contextVariables>
119    <conversationLanguages>en_US</conversationLanguages>
120    <conversationSystemDialogs>
121        <dialog>No_Agent_Available</dialog>
122        <type>TransferFailed</type>
123    </conversationSystemDialogs>
124    <conversationSystemDialogs>
125        <dialog>Test_Dialog_1</dialog>
126        <type>ErrorHandling</type>
127    </conversationSystemDialogs>
128    <conversationVariables>
129        <dataType>Text</dataType>
130        <developerName>TestVariableXYZ</developerName>
131        <label>TestVariableXYZ</label>
132    </conversationVariables>
133    <conversationVariables>
134        <collectionType>List</collectionType>
135        <dataType>Object</dataType>
136        <developerName>MyCustomVariable</developerName>
137        <label>MyCustomVariable</label>
138    </conversationVariables>
139    <description>Description of BotTemplate</description>
140    <entryDialog>Test_Dialog_1</entryDialog>
141    <icon>AA8qwqXXXXX</icon>
142    <mainMenuDialog>Test_Dialog_2</mainMenuDialog>
143    <masterLabel>Astro Bot</masterLabel>
144    <mlDomain>
145        <label>Astro Bot</label>
146        <mlIntents>
147            <developerName>End_Chat</developerName>
148            <label>End Chat</label>
149            <mlIntentUtterances>
150                <utterance>Utterance1</utterance>
151                <language>es</language>
152            </mlIntentUtterances>
153            <mlIntentUtterances>
154                <utterance>Utterance2</utterance>
155                <language>es</language>
156            </mlIntentUtterances>
157            <mlIntentUtterances>
158                <utterance>Utterance3</utterance>
159                <language>es</language>
160            </mlIntentUtterances>
161        </mlIntents>
162        <mlIntents>
163            <developerName>Main_Menu</developerName>
164            <label>Main Menu</label>
165            <description>Main Menu Intent</description>
166        </mlIntents>
167        <mlIntents>
168            <developerName>Welcome</developerName>
169            <label>Welcome</label>
170            <description>Welcome Intent</description>
171        </mlIntents>
172        <name>Astro_Bot_ld1</name>
173    </mlDomain>
174    <richContentEnabled>true</richContentEnabled>
175</BotTemplate>

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>*</members>
5        <name>BotTemplate</name>
6    </types>
7    <version>55.0</version>
8</Package>

Wildcard Support in the Manifest File

This metadata type supports the wildcard character * (asterisk) in the package.xml manifest file. For information about using the manifest file, see Deploying and Retrieving Metadata with the Zip File.