Note: This release is in preview. Features described here don’t become generally available until the latest general availability date that Salesforce announces for this release. Before then, and where features are noted as beta, pilot, or developer preview, we can’t guarantee general availability within any particular time frame or at all. Make your purchase decisions only on the basis of generally available products and features.
BotTemplate
Parent Type
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.
Bot metadata deployment and retrieval are not supported for Lead Nurturing and Sales Coach Agents.
Fields
| Field Name | Description |
|---|---|
| botDialogGroups |
|
| botDialogs |
|
| conversationLanguages |
|
| contextVariables |
|
| conversationGoals |
|
| conversationSystemDialogs |
|
| conversationVariables |
|
| description |
|
| entryDialog |
|
| icon |
|
| mainMenuDialog |
|
| masterLabel |
|
| mlDomain |
|
| permissionSet |
|
| richContentEnabled |
|
| type |
|
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'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 "End Chat" 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.