---
schema_version: "1"
id: 894a369d755642fd0af3b74b619881522fc8d4738cf714b3de505d1b7ecbea8d
title: BotTemplate
collection: legacydeveloper
version: current
locale: en-us
portal_url: https://docs.salesforce.com/legacydeveloper/current/en-us/api_meta/meta_bottemplate.md
canonical_url: https://developer.salesforce.com/docs/atlas.en-us.api_meta.meta/api_meta/meta_bottemplate.htm
source_site: developer.salesforce.com
content_type: documentation
content_hash: 0c2612f76d5f483fb55127de7fdd5c34446d578c5daab911bbd3878682544e37
description: Represents the configuration details for a specific Einstein Bot template, including dialogs and variables.
---
# BotTemplate

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

![Important](https://developer.salesforce.com/docs/atlas.en-us.api_meta.meta/api_meta/images/icon_note_important.png)

#### Important

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.

## Parent Type

This type extends the [Metadata](https://developer.salesforce.com/docs/atlas.en-us.api_meta.meta/api_meta/metadata.htm "The base class for all metadata types. You can’t edit this object. A component is an instance of a metadata type.") 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.

Bot metadata deployment and retrieval are not supported for Lead Nurturing and Sales Coach Agents.

## Fields

| Field Name | Description |
| --- | --- |
| botDialogGroups | 
Field Type

[BotDialogGroup\[\]](meta_botversion.htm#BotDialogGroup)

Description

The list of dialog groups in this bot template.



 |
| botDialogs | 

Field Type

[BotDialog\[\]](meta_botversion.htm#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\[\]](meta_bot.htm#ConversationContextVariable)

Description

Represents the context variables that enable your bot to gather customer information regardless of channel.



 |
| conversationGoals | 

Field Type

[ConversationDefinitionGoal\[\]](meta_botversion.htm#ConversationDefinitionGoal)

Description

The list of goals in this bot template. Available in API version 57.0 and later.



 |
| conversationSystemDialogs | 

Field Type

[ConversationSystemDialog\[\]](meta_botversion.htm#ConversationSystemDialog)

Description

A system function assigned to a dialog.



 |
| conversationVariables | 

Field Type

[ConversationVariable\[\]](meta_botversion.htm#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](https://developer.salesforce.com/docs/atlas.en-us.api_meta.meta/api_meta/meta_bot.htm#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.

<?xml version="1.0" encoding="UTF-8"?>
<BotTemplate xmlns="http://soap.sforce.com/2006/04/metadata">
    <botDialogGroups\>
        <developerName\>dialog\_group1</developerName\>
        <label\>dialog group1</label\>
    </botDialogGroups\>
    <botDialogs\>
        <developerName\>Test\_Dialog\_1</developerName\>
        <label\>Test\_Dialog\_1</label\>
        <showInFooterMenu\>false</showInFooterMenu\>
    </botDialogs\>
    <botDialogs\>
        <developerName\>Test\_Dialog\_2</developerName\>
        <label\>Test\_Dialog\_2</label\>
        <showInFooterMenu\>false</showInFooterMenu\>
    </botDialogs\>
    <botDialogs\>
        <botSteps\>
            <botMessages\>
                <message\>Hi! I&apos;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\>
                </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\>
    <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 &quot;End Chat&quot; 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\>
    <contextVariables\>
        <contextVariableMappings\>
            <SObjectType\>LiveChatTranscript</SObjectType\>
            <fieldName\>LiveChatTranscript.ChatKey</fieldName\>
            <messageType\>WebChat</messageType\>
        </contextVariableMappings\>
        <dataType\>Text</dataType\>
        <developerName\>ChatKey</developerName\>
        <label\>Chat Key</label\>
    </contextVariables\>
    <conversationLanguages\>en\_US</conversationLanguages\>
    <conversationSystemDialogs\>
        <dialog\>No\_Agent\_Available</dialog\>
        <type\>TransferFailed</type\>
    </conversationSystemDialogs\>
    <conversationSystemDialogs\>
        <dialog\>Test\_Dialog\_1</dialog\>
        <type\>ErrorHandling</type\>
    </conversationSystemDialogs\>
    <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\>Description of BotTemplate</description\>
    <entryDialog\>Test\_Dialog\_1</entryDialog\>
    <icon\>AA8qwqXXXXX</icon\>
    <mainMenuDialog\>Test\_Dialog\_2</mainMenuDialog\>
    <masterLabel\>Astro Bot</masterLabel\>
    <mlDomain\>
        <label\>Astro Bot</label\>
        <mlIntents\>
            <developerName\>End\_Chat</developerName\>
            <label\>End Chat</label\>
            <mlIntentUtterances\>
                <utterance\>Utterance1</utterance\>
                <language\>es</language\>
            </mlIntentUtterances\>
            <mlIntentUtterances\>
                <utterance\>Utterance2</utterance\>
                <language\>es</language\>
            </mlIntentUtterances\>
            <mlIntentUtterances\>
                <utterance\>Utterance3</utterance\>
                <language\>es</language\>
            </mlIntentUtterances\>
        </mlIntents\>
        <mlIntents\>
            <developerName\>Main\_Menu</developerName\>
            <label\>Main Menu</label\>
            <description\>Main Menu Intent</description\>
        </mlIntents\>
        <mlIntents\>
            <developerName\>Welcome</developerName\>
            <label\>Welcome</label\>
            <description\>Welcome Intent</description\>
        </mlIntents\>
        <name\>Astro\_Bot\_ld1</name\>
    </mlDomain\>
    <richContentEnabled\>true</richContentEnabled\>
</BotTemplate\>

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\>\*</members\>
        <name\>BotTemplate</name\>
    </types\>
    <version\>55.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](https://developer.salesforce.com/docs/atlas.en-us.api_meta.meta/api_meta/file_based_zip_file.htm "The deploy() and retrieve() calls are used to deploy and retrieve a .zip file. Within the .zip file is a project manifest (package.xml) that lists what to retrieve or deploy, and one or more XML components that are organized into folders.").