BotBlock
Parent Type
File Suffix and Directory Location
BotBlock components have the suffix .botBlock and are stored in the botBlocks folder.
Version
BotBlock components are available in API version 58.0 and later.
Special Access Rules
BotBlock is available only if Chat and Einstein Bots are enabled in your org.
Fields
Field Name | Description |
---|---|
botBlockVersions |
|
description |
|
masterLabel |
|
richContentEnabled |
|
BotBlockVersion
Represents the configuration details for an Einstein Bot block version, including dialogs and variables.
Field Name | Description |
---|---|
botDialogs |
|
conversationGoals |
|
conversationLanguages |
|
conversationVariables |
|
description |
|
mlDomain |
|
permissionSet |
|
status |
|
Declarative Metadata Sample Definition
The following is an example of a BotBlock component.
<?xml version="1.0" encoding="UTF-8"?>
<BotBlock xmlns="http://soap.sforce.com/2006/04/metadata">
<access xsi:nil="true"/>
<botBlockVersions>
<fullName>Published</fullName>
<botDialogs>
<developerName>Test_Dialog_1646070168572</developerName>
<label>Test_Dialog_1646070168572</label>
<showInFooterMenu>false</showInFooterMenu>
</botDialogs>
<botDialogs>
<developerName>Test_Dialog_1646070168926</developerName>
<label>Test_Dialog_1646070168926</label>
<showInFooterMenu>false</showInFooterMenu>
</botDialogs>
<botDialogs>
<botSteps>
<stepIdentifier>s4</stepIdentifier>
<type>Wait</type>
</botSteps>
<developerName>Main_Menu</developerName>
<label>Main Menu</label>
<mlIntent>Main_Menu</mlIntent>
<showInFooterMenu>false</showInFooterMenu>
</botDialogs>
<botDialogs>
<botSteps>
<botMessages>
<message>Goodbye! Click the "End Chat" button to end this chat</message>
<messageIdentifier>m2</messageIdentifier>
</botMessages>
<stepIdentifier>s6</stepIdentifier>
<type>Message</type>
</botSteps>
<botSteps>
<stepIdentifier>s7</stepIdentifier>
<type>Wait</type>
</botSteps>
<developerName>End_Chat</developerName>
<label>End Chat</label>
<mlIntent>End_Chat</mlIntent>
<showInFooterMenu>false</showInFooterMenu>
</botDialogs>
<botDialogs>
<botSteps>
<botMessages>
<message>Unfortunately, there are no agents available at the moment</message>
<messageIdentifier>m3</messageIdentifier>
</botMessages>
<stepIdentifier>s8</stepIdentifier>
<type>Message</type>
</botSteps>
<botSteps>
<stepIdentifier>s9</stepIdentifier>
<type>Wait</type>
</botSteps>
<developerName>No_Agent_Available</developerName>
<label>No Agent</label>
<showInFooterMenu>false</showInFooterMenu>
</botDialogs>
<botDialogs>
<botSteps>
<botMessages>
<message>Hi! I'm your helpful bot.</message>
<messageIdentifier>m1</messageIdentifier>
</botMessages>
<stepIdentifier>s1</stepIdentifier>
<type>Message</type>
</botSteps>
<botSteps>
<conversationRecordLookup>
<SObjectType>Account</SObjectType>
<conditions>
<leftOperand>Account.Phone</leftOperand>
<operatorType>Equal</operatorType>
<rightOperandValue>Value</rightOperandValue>
<sortOrder>0</sortOrder>
</conditions>
<lookupFields>
<fieldName>Account.Phone</fieldName>
</lookupFields>
<lookupFields>
<fieldName>Account.OwnerId</fieldName>
</lookupFields>
<maxLookupResults>1</maxLookupResults>
<sourceVariableName>_LastCustomerInput</sourceVariableName>
<sourceVariableType>ConversationVariable</sourceVariableType>
<targetVariableName>MyCustomVariable</targetVariableName>
</conversationRecordLookup>
<stepIdentifier>s2</stepIdentifier>
<type>RecordLookup</type>
</botSteps>
<botSteps>
<botNavigation>
<botNavigationLinks>
<targetBotDialog>Main_Menu</targetBotDialog>
<targetVariable xsi:nil="true"/>
<targetVariableType xsi:nil="true"/>
</botNavigationLinks>
<type>Redirect</type>
</botNavigation>
<stepIdentifier>s3</stepIdentifier>
<type>Navigation</type>
</botSteps>
<developerName>Welcome</developerName>
<label>Welcome</label>
<mlIntent>Welcome</mlIntent>
<showInFooterMenu>false</showInFooterMenu>
</botDialogs>
<conversationLanguages>en_US</conversationLanguages>
<conversationVariables>
<dataType>Text</dataType>
<developerName>TestVariableABC</developerName>
<label>TestVariableABC</label>
</conversationVariables>
<conversationVariables>
<dataType>Text</dataType>
<developerName>TestVariableXYZ</developerName>
<label>TestVariableXYZ</label>
</conversationVariables>
<conversationVariables>
<collectionType>List</collectionType>
<dataType>Object</dataType>
<developerName>MyCustomVariable</developerName>
<label>MyCustomVariable</label>
</conversationVariables>
<description>Created for testing.</description>
<mlDomain>
<label>vPub</label>
<mlIntents>
<developerName>End_Chat</developerName>
<label>End Chat</label>
<mlIntentUtterances>
<language>es</language>
<utterance>Utterance1</utterance>
</mlIntentUtterances>
<mlIntentUtterances>
<language>es</language>
<utterance>Utterance2</utterance>
</mlIntentUtterances>
<mlIntentUtterances>
<language>es</language>
<utterance>Utterance3</utterance>
</mlIntentUtterances>
</mlIntents>
<mlIntents>
<description>Main Menu Intent</description>
<developerName>Main_Menu</developerName>
<label>Main Menu</label>
</mlIntents>
<mlIntents>
<description>Welcome Intent</description>
<developerName>Welcome</developerName>
<label>Welcome</label>
</mlIntents>
<name>blockDevName0001_vPub</name>
</mlDomain>
<status>Published</status>
</botBlockVersions>
<description>Collects the user's first name, last name, email address, phone number, and company name.</description>
<masterLabel>User Info Collection Block</masterLabel>
<richContentEnabled>true</richContentEnabled>
</BotBlock>
The following is an example package.xml that references the previous definition.
<?xml version="1.0" encoding="UTF-8"?>
<Package xmlns="http://soap.sforce.com/2006/04/metadata">
<types>
<members>AgentTransfer</members>
<name>BotBlock</name>
</types>
<version>58.0</version>
</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.