Bot defines an Einstein Bot configuration and can also represent an Agentforce agent. It contains one or more BotVersion configurations, but only one version can be active. The Bot's fullName identifies the bot; each botVersions.fullName identifies a version.
Keep the bot definition separate from its versions. Dialogs, executable steps, conversation variables, and planner associations belong to individual versions. The intent set under botMlDomain, however, is shared across all versions. A retrieved Bot is also not a complete record of its messaging channel assignments, because those assignments require UI configuration.
Key Elements
| Element | What the Element Controls |
|---|---|
type |
Required configuration type. The default is Bot. Salesforce documents Bot, ExternalCopilot, and InternalCopilot; the exposed schema additionally lists AgentforceOrchestrator. |
botVersions |
Contains version-specific configuration. BotVersion is a top-level child of Bot, with its own fullName. Only one version can be active. |
agentType, agentTemplate
|
For an agent configuration, identifies the agent kind, such as AgentforceServiceAgent, and the template used to create it. |
botUser |
Identifies the user account by username, not display name or Salesforce record ID. |
conversationChannelProviders |
Links conversation channels. chatButtonName is a LiveChatButton developer name. agentRequired defaults to false and controls whether a human agent must be online. |
defaultOutboundFlow |
References the Flow used for fallback escalation when the primary agent escalation behavior is unavailable. |
sessionTimeout |
Sets the maximum idle interval for a bot session, in minutes. |
botMlDomain |
Contains the shared intent set, including mlIntents and mlSlotClasses. Changes affect the intent set used by every version under the bot. |
contextVariables |
Defines channel-related customer context. Each mapping uses messageType, SObjectType, and fieldName to identify its source. includeInPrompt controls model prompt inclusion. |
pageContextVariables |
Defines page-level context, with its own SObjectType, dataType, and developerName. |
botVersions.conversationVariables |
Stores conversation data and action inputs or outputs. collectionType=List designates a list variable. visibility controls who can set it; includeInPrompt controls prompt inclusion. |
logPrivateConversationData |
Controls whether customer inputs are logged as conversation data. This is separate from variable inclusion in model prompts. |
botVersions.entryDialog, botVersions.mainMenuDialog
|
Identify the first dialog presented to the customer and the main menu dialog. entryDialog is required. |
botVersions.conversationSystemDialogs |
Maps system events, including ErrorHandling and TransferFailed, to dialogs. |
botVersions.conversationPlanner |
The documented planner-association container, using genAiPlannerName. The exposed schema names the container conversationDefinitionPlanners; see Documentation Inconsistencies. |
Behavior and Constraints
Availability and channel conditions
Chat and Einstein Bots must be enabled in the org. Bot metadata deployment and retrieval are not supported for Lead Nurturing and Sales Coach Agents.
type=Bot represents the default Einstein Bot configuration. ExternalCopilot represents an external-facing agent, and InternalCopilot represents an internal-facing agent. For agent configurations, agentType identifies the agent kind rather than replacing the configuration type.
Within conversationChannelProviders, agentRequired=true requires a human agent to be online for the bot to be active. Its default is false. This channel availability condition is separate from the restriction that only one BotVersion can be active.
defaultOutboundFlow describes fallback escalation only. It does not describe every transfer path configured in a version's dialogs. Navigation and system-message steps can also participate in transfer behavior.
Customer data, prompts, and variable scope
Conversation logging and prompt inclusion are separate controls. logPrivateConversationData determines whether customer inputs are logged. includeInPrompt on context variables and version-level conversation variables determines whether those variables are injected into the prompt sent to the Agentforce model. Their description values may also be used by the planner service, so descriptions can influence interpretation rather than serving only as administrator notes.
The default variables Id, EndUserId, and EndUserLanguage always appear in the UI's Included Fields section, regardless of their includeInPrompt values. Changing those values can prevent an agent from accessing important session data. Presence in Included Fields is therefore not sufficient to determine the configured flag.
Keep these variable scopes distinct:
-
Context variables:
contextVariablessupplies channel-related customer information. EachcontextVariableMappingsentry combines a channel'smessageType, anSObjectType, and a sourcefieldName. The mapping's documented object values areLiveChatTranscript,MessagingEndUser, andMessagingSession. -
Conversation variables:
botVersions.conversationVariablesstores data collected or produced during the conversation. Variables can supply action inputs and receive action outputs.collectionType=Listmakes a variable a list. -
Page context variables:
pageContextVariablessupplies page-level context and has its own associatedSObjectType.
The SObjectType on a context variable itself is not the mapping's object type. Salesforce documents BotDefinition and Queue for ConversationContextVariable.SObjectType and version-level ConversationVariable.SObjectType. Do not apply the mapping's three-object scope to these fields.
For version-level conversation variables, internal visibility permits setting values only through action outputs. External visibility also permits the API to set values. The documented and exposed enumeration casing differs, as described below.
Action mappings, conditions, navigation, and variable operations distinguish ContextVariable, ConversationVariable, and PageContextVariable. A matching variable name with a different variable type does not identify the same scope. Variable use can also be embedded in message merge expressions and quickReplyOptionTemplate formulas, not just explicit variableName elements.
Shared intents and language providers
botMlDomain holds the intent set shared by all versions, including intents in mlIntents and entities in mlSlotClasses. Editing this set has a broader scope than editing a dialog in one version.
Within botVersions.botDialogs, mlIntent associates a dialog with an intent. mlIntentTrainingEnabled=true enables Einstein training for that dialog intent. The default, false, selects exact matching.
The version-level intentThreshold controls how strictly a customer message must match an intent. Values range from 1, least strict, to 5, most strict. Enabling this feature requires Salesforce Customer Support.
Version-level nlpProviders selects a natural language provider for a language. With nlpProviderType=EinsteinAi, nlpProviderName is blank. With nlpProviderType=Apex, it identifies the Apex class providing the service.
Dialog execution and collection behavior
The executable configuration is nested under botVersions. entryDialog selects the first dialog, while mainMenuDialog selects the main menu. conversationSystemDialogs adds event-driven routes, so ordinary dialog navigation alone does not describe all possible paths.
A BotStep's type determines which payload applies. For example, Invocation uses botInvocation, Navigation uses botNavigation, and VariableOperation uses botVariableOperation. A Group contains nested botSteps and conditions combined through conditionLogicType, with values And or Or. Conditions using IsSet or IsNotSet ignore rightOperandValue.
BotInvocation selects an action through invocationActionType and invocationActionName. Input and Output mappings connect the action's parameterName values to literals or bot variables. An invocation can appear directly in a step or within a variable operation; the parameter mappings are part of the functional dependency.
- For a
Collectoperation,askCollectIfSet=trueasks again and overwrites an existing value. The default,false, skips populated variables and preserves their values. - For
CollectwithquickReplyType=Dynamic,autoSelectIfSingleChoice=trueselects the sole available answer without waiting for a response. Its default isfalse. -
invalidInputBotNavigationhandles the separate case where the associated invocation returns no options. -
ignoreIntentRecognition=truerepeats a question until the response meets the entity requirements, rather than recognizing other intents from invalid responses. -
optionalCollect=truepermits advancing after the documented single repair attempt. Its default isfalse. This setting andignoreIntentRecognitionaddress different behaviors; no precedence is established for their combination.
ConversationRecordLookup works only with Lightning Knowledge, despite its generic object and field element names. maxLookupResults must be from 1 through 3, and filterLogic accepts And or Or. This structure is not an unrestricted record-query mechanism.
Deployment and Retrieval
Bot components use the .bot suffix and are stored in the bots folder. In package.xml, select the bot by its fullName under metadata type Bot. Bot supports the * wildcard.
BotVersion is a top-level child of Bot. An explicit BotVersion manifest member combines the bot name and version name, separated by a period. Unlike Bot, BotVersion does not support the manifest wildcard. The documentation has inconsistent directory wording for this child, noted below.
Messaging channel assignments require the UI. Adding, editing, or removing a messaging channel must be done there. When a bot is deployed with messaging channel providers, those providers are not visible in Metadata API. A retrieved Bot must not be treated as a complete representation of its messaging channel setup.
botUser stores a username. Moving the configuration to an org with different usernames therefore requires attention to the account named in this field; a display name or record ID is not a substitute.
Version selection can also affect planner-related deployments. The reported PlannerId failure below concerns matching BotVersion and planner bundle versions, not a documented top-level Bot field.
Translation identifiers
Within version dialogs, stepIdentifier, messageIdentifier, variableOperationIdentifier, and quickReplyOptionIdentifier link translated labels to their corresponding records. The UI generates these identifiers. API-created records must supply them, and translated labels require them.
Each identifier supports letters, numbers, dashes, and underscores, up to 255 characters. Changing an identifier changes the key used to associate translations. Comparing displayed text alone can miss a consequential translation-link change.
Relationships
Many Bot dependencies occur several levels below the root, inside version dialogs, steps, mappings, and variable operations. Interpret action names with their action types and variable operand names with sourceType. These connections do not establish a universal name namespace or automatic deployment of related components.
References
-
ApexClass:invocationActionNamefor Apex actions;nlpProviderNamefor an Apex natural language provider. -
Bot:sourceName, interpreted with the variable operand'ssourceType. -
BotVersion:botVersions, the contained top-level child configurations. -
ConversationMessageDefinition:messageDefinitionNameinside rich-message configuration.messageDefinitionMappingssupplies inputs and can capture outputs. -
CustomField:fieldName,leftOperand,sortFieldName, andsourceName, within their respective mapping, lookup, or operand scopes. -
CustomObject:SObjectType, subject to the allowed object scope of the containing structure. -
ExternalServiceRegistration:invocationActionNamefor an external-service action. -
Flow:defaultOutboundFlow,invocationActionNamefor flow actions, andsourceNamefor applicable variable operands. -
GenAiPacker:genAiPlannerName, an alternative recognized destination for a planner association. -
GenAiPlanner:genAiPlannerName. The alternative planner destinations do not require including both types. -
LiveChatButton:chatButtonName, using the component's developer name. -
Queue:sourceNamefor applicable variable operands.
A variable operand's sourceName can also identify an entity used in the operation. Object and field elements do not all share the same allowed scope: context mapping fields, variable object types, and Lightning Knowledge lookup fields must be interpreted separately.
Referenced By
-
Bot:sourceName. -
BotVersion:sourceName. -
BotBlock:sourceName. -
BotTemplate:sourceName. -
OmniSupervisorConfig:botDefinition. -
Translations:fullNamewithin translation configuration.
These incoming references are distinct from the bot's own action dependencies. They do not imply that Bot owns or automatically deploys the referencing components.
Documentation Inconsistencies
-
Intent-set scope: the Bot definition explicitly says all versions share
botMlDomain, while theLocalMlDomainhelper description calls the set version-local. Treat the set as shared across the bot's versions. -
Variable visibility casing: Salesforce documents
internalandexternal, while the exposed schema listsInternalandExternal. Do not assume these spellings are interchangeable when serializing metadata. -
Planner container name: Salesforce documents the version-level element as
conversationPlanner, while the exposed schema names itconversationDefinitionPlanners. Both descriptions usegenAiPlannerNamefor the planner association. -
Configuration type enumeration: the exposed enumeration includes
AgentforceOrchestrator, which is not included in the Bot documentation's valid-value list. -
Directory wording: the Bot page specifies
bots. The BotVersion page says the child shares Bot's suffix and directory, but also calls the directorybot.
Reported Issues
- An unexpected transfer or chat termination after an Apex action can be an access problem rather than a navigation defect. In a February 2020 Chat-based report, Bot Builder Event Logs exposed an Apex-class access error. Granting access through a permission set resolved that case. This does not establish the cause of every unexpected transfer. Apex access diagnosis.
-
A planner deployment can fail because the selected BotVersions lack matching planner bundle versions. A November 2025 Agentforce report attributed
Required fields are missing: [PlannerId]to missing correspondingGenAiPlannerBundleversions, even though the BotVersion metadata contained a planner identifier. The reported approach was to include the matching bundle for every selected BotVersion, or exclude unwanted bot and planner versions together. The same report selected BotVersions in change sets by adding the Bot and using "View/Add Dependencies", rather than a standalone BotVersion selector. This is a version-level dependency report, not a documented top-levelPlannerIdelement on Bot. Planner dependency and change set report. -
Enhanced-bot queue routing can depend on configuration outside Bot. Respondents in an enhanced-bot discussion used Omni-Channel flows rather than direct queue selection. A June 2025 respondent reported dynamic routing by using an autolaunched flow to store a queue ID on
MessagingSession, then reading it in the routing flow. This is a conditional implementation pattern, not a universal requirement for an intermediate field. Enhanced-bot queue routing discussion. -
An empty context value does not by itself prove that the metadata mapping is wrong. A February 2026 WhatsApp discussion reported an empty
RoutableIdin the Welcome dialog when passing it to Apex. An unaccepted answer attributed the result toMessagingSessioninitialization timing and suggested usingEndUserIdfor aMessagingEndUserlookup instead. This remains a troubleshooting hypothesis requiring runtime confirmation, not a guaranteed initialization sequence for every channel. Empty RoutableId discussion.
Common Questions
Does retrieving Bot include its messaging channel assignments?
Do not treat the retrieval as complete channel configuration. Messaging channel providers deployed with a bot are not visible in Metadata API. Add, edit, or remove messaging channel assignments in the UI.
What is the difference between Bot and BotVersion?
Bot identifies the overall configuration and holds shared settings, including the intent set. BotVersion is a top-level child containing version-specific dialogs, steps, conversation variables, and planner associations. Only one version can be active.
Does botUser accept a Salesforce user ID?
No. botUser specifies the account's username, not its record ID or display name. This matters when the source and destination orgs use different usernames.
Why does my agent deployment report a missing PlannerId?
A reported cause is a mismatch between the selected BotVersions and the included GenAiPlannerBundle versions. The reported resolution was to include each selected version's matching bundle, or exclude unwanted bot and planner versions together. This is not evidence of a required top-level Bot PlannerId field.
Does includeInPrompt control conversation logging?
No. includeInPrompt controls variable inclusion in the Agentforce model prompt. logPrivateConversationData controls logging of customer inputs. Also, Id, EndUserId, and EndUserLanguage always appear in Included Fields regardless of their prompt flags.