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 Metadata and inherits its fields.

File Suffix and Directory Location 

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

Version 

Introduced in API version 55.0.

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 

agentType 

  • Type: GenAiAgentType
  • Required: No

botDialogGroups 

  • Type: BotDialogGroup[]
  • Required: No
  • Description: The list of dialog groups in this bot template.

botDialogs 

  • Type: BotDialog[]
  • Required: No
  • Description: The list of dialogs in this bot template.

contextVariables 

  • Type: ConversationContextVariable[]
  • Required: No
  • Description: Represents the context variables that enable your bot to gather customer information regardless of channel.

conversationGoals 

conversationLanguages 

  • Type: string

  • Required: Yes

  • Description: Required.

    Specifies the language of the bot template.

conversationSystemDialogs 

conversationVariables 

  • Type: ConversationVariable[]
  • Required: No
  • 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 

  • Type: string
  • Required: No
  • Description: A description of the bot template.

entryDialog 

  • Type: string
  • Required: No
  • Description: A reference to the first dialog that the bot presents to your customer. For example, Welcome.

icon 

  • Type: string
  • Required: No
  • Description: The icon used to identify the template.

mainMenuDialog 

  • Type: string
  • Required: No
  • Description: A reference to the dialog identified as the main menu dialog. For example, Main Menu.

masterLabel 

  • Type: string

  • Required: Yes

  • Description: Required.

    A user-friendly label for BotTemplate, which is defined when the BotTemplate is created.

mlDomain 

  • Type: LocalMlDomain

  • Required: No

  • Description: Required.

    Represents the Einstein Intent Set that groups intents, entities, and variables associated with a template.

permissionSet 

  • Type: string
  • Required: No
  • Introduced: API version 59.0
  • Description: The permission set associated with the bot template.

richContentEnabled 

  • Type: boolean
  • Required: No
  • Description: Indicates whether the template is available for enhanced bots (true) or for standard bots (false). The default is false.

type 

  • Type: BotType (enumeration of type string)
  • Required: No
  • Description: This field represents the configuration type of the bot. The default value is Bot.

BotDialog Type 

Fields 

botDialogGroup 

  • Type: string
  • Required: No

botSteps 

description 

  • Type: string
  • Required: No
  • Description: A description of this component. The description should explain the component’s purpose and behavior so that administrators and developers understand when to use it.

developerName 

  • Type: string
  • Required: Yes
  • Description: The unique developer name of this component. Used as an API reference and must follow Salesforce identifier rules.

isPlaceholderDialog 

  • Type: boolean
  • Required: No

label 

  • Type: string
  • Required: Yes
  • Description: The label that identifies this component in the Salesforce UI and in metadata listings. Character limits and translation behavior follow the enclosing type.

mlIntent 

  • Type: string
  • Required: No

mlIntentTrainingEnabled 

  • Type: boolean
  • Required: No

showInFooterMenu 

  • Type: boolean
  • Required: No

ConversationContextVariable Type 

Fields 

contextVariableMappings 

dataType 

  • Type: ConversationDataType (enumeration of type string)
  • Required: Yes

description 

  • Type: string
  • Required: No
  • Description: A description of this component. The description should explain the component’s purpose and behavior so that administrators and developers understand when to use it.

developerName 

  • Type: string
  • Required: Yes
  • Description: The unique developer name of this component. Used as an API reference and must follow Salesforce identifier rules.

includeInPrompt 

  • Type: boolean
  • Required: No

label 

  • Type: string
  • Required: Yes
  • Description: The label that identifies this component in the Salesforce UI and in metadata listings. Character limits and translation behavior follow the enclosing type.

SObjectType 

  • Type: string
  • Required: No

ConversationContextVariableMapping Type 

Fields 

fieldName 

  • Type: string
  • Required: Yes

messageType 

  • Type: MessageType (enumeration of type string)
  • Required: Yes

SObjectType 

  • Type: string
  • Required: Yes

ConversationVariable Type 

Fields 

collectionType 

  • Type: ConversationVariableCollectionType (enumeration of type string)
  • Required: No

dataType 

  • Type: ConversationDataType (enumeration of type string)
  • Required: Yes

description 

  • Type: string
  • Required: No
  • Description: A description of this component. The description should explain the component’s purpose and behavior so that administrators and developers understand when to use it.

developerName 

  • Type: string
  • Required: Yes
  • Description: The unique developer name of this component. Used as an API reference and must follow Salesforce identifier rules.

includeInPrompt 

  • Type: boolean
  • Required: No

label 

  • Type: string
  • Required: Yes
  • Description: The label that identifies this component in the Salesforce UI and in metadata listings. Character limits and translation behavior follow the enclosing type.

SObjectType 

  • Type: string
  • Required: No

visibility 

  • Type: ConversationVariableVisibilityType (enumeration of type string)
  • Required: No

SynonymGroup Type 

Represents a group of synonymous words or phrases.

Fields 

languages 

  • Type: Language (enumeration of type string)[]
  • Required: No

terms 

  • Type: string[]
  • Required: No

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.