BotVersion defines the conversational configuration for a specific Einstein Bot version: dialogs, executable steps, customer-data variables, intent handling, and responses to system events. For agent configurations, it can also reference a planner service that uses a large language model (LLM) and a reasoning strategy to select and invoke actions.
BotVersion is a top-level child of Bot, represented in the parent's botVersions collection. It is not the parent bot definition, and its metadata identity, such as MyBot.v1, is different from the runtime BotVersion record ID used by activation APIs.
Key Elements
| Element | What the Element Controls |
|---|---|
entryDialog, mainMenuDialog
|
entryDialog is required and identifies the first dialog presented to the customer. mainMenuDialog identifies the main-menu dialog. |
botDialogs |
Contains the version's dialogs, their steps, intent associations, and dialog-group membership. Each dialog requires a developerName and label. |
botSteps.type |
Selects the step configuration to execute: GoalStep, Group, Invocation, Message, Navigation, RecordLookup, RichMessage, SystemMessage, VariableOperation, or Wait. |
botStepConditions, conditionLogicType
|
Define conditions for a Group step and combine them using And or Or. The group's botSteps contains its nested steps. |
conversationVariables |
Defines data used as dialog-action inputs and outputs. dataType supports Boolean, Currency, Date, DateTime, Id, Object, Number, and Text. collectionType=List designates a list variable. |
conversationVariables.visibility |
Controls assignment access. Salesforce documents internal for assignment only through action outputs and external for assignment through action outputs or the API. Capitalization differs in exposed tooling schemas; see Documentation Inconsistencies. |
conversationVariables.includeInPrompt |
Controls whether a variable is injected into the prompt sent to the Agentforce model. This affects model input, not just its display in Setup. |
botVariableOperation |
Configures variable operations. Its type can be Collect, CollectAttachment, Set, SetConversationLanguage, or Unset. Collection options separately control existing values, retries, and quick replies. |
botInvocation |
Connects a step or variable operation to an invocable action. invocationActionType determines how to interpret invocationActionName; invocationMappings binds action parameters. |
conversationSystemDialogs |
Maps system events to dialogs, including ErrorHandling, TransferFailed, KnowledgeAction, and KnowledgeFallback. |
knowledgeActionEnabled |
Separately enables knowledge actions. Its default is false; a system-dialog mapping is not the enablement flag. |
nlpProviders |
Selects a natural language service for a language. nlpProviderType defaults to EinsteinAi; Apex uses the class identified by nlpProviderName. |
intentThreshold |
Sets intent-match strictness from 1 through 5, where 1 is least strict and 5 is most strict. Enabling this feature requires Salesforce Customer Support. |
conversationPlanner |
Contains planner entries whose genAiPlannerName identifies an agent planner service. An alternate exposed collection name is described under Documentation Inconsistencies. |
conversationRecordLookup |
Configures a Lightning Knowledge lookup, not a general-purpose record query. Required maxLookupResults must be between 1 and 3. |
Behavior and Constraints
Access and variable exposure
BotVersion is available only when Chat and Einstein Bots are enabled. Bot metadata deployment and retrieval are not supported for Lead Nurturing and Sales Coach Agents.
Variable assignment access and prompt exposure are separate controls. External visibility permits API assignment; includeInPrompt determines whether the variable enters the model's prompt. A variable's description can also be used by the planner service, so changing that text can affect more than administrator documentation.
The default variables Id, EndUserId, and EndUserLanguage always appear in the UI's Included Fields section regardless of includeInPrompt. Salesforce recommends leaving their settings unchanged because changing them can prevent the agent from accessing important session data.
Within ConversationVariable, the documented values for SObjectType are BotDefinition and Queue. This restriction belongs to the variable definition. It does not apply to the separate SObjectType element inside a record lookup.
Dialog routing, conditions, and intent matching
A navigation step uses Call, Redirect, or TransferToAgent. Call and Redirect can contain links through targetBotDialog. In a Redirect to Dialog Rule Action, targetVariable is the ID of the target object variable, not its developer name.
BotStep.type determines which step configuration is meaningful. A Group contains nested botSteps and associated botStepConditions, combined using conditionLogicType. booleanFilter is reserved for future use. For Group-step conditions, IsSet and IsNotSet ignore rightOperandValue.
conversationSystemDialogs routes an event to the dialog named in dialog. ErrorHandling and TransferFailed provide explicit error and transfer-failure routes; KnowledgeAction and KnowledgeFallback provide knowledge-related routes. Disambiguation and DisambiguationFailed are reserved for future use. The separate knowledgeFallbackEnabled and intentDisambiguationEnabled flags are reserved for internal use.
At dialog scope, mlIntent associates the dialog with an intent. mlIntentTrainingEnabled=true enables Einstein training for that intent. The default, false, selects exact matching. These settings are distinct from language-provider selection and the support-enabled intentThreshold.
For nlpProviderType=EinsteinAi, nlpProviderName is blank. For Apex, it identifies the provider's Apex class.
A GoalStep can map to a goal through conversationStepGoalMappings.goalName. A goal can be associated with only one BotStep and one dialog at a time.
isPlaceholderDialog is meaningful for dialogs in bot blocks. In a bot template or a bot version not associated with a bot block, it is read-only and false.
Collection settings are separate controls
A Collect operation can preserve existing data, overwrite it, require valid input, or advance without successful collection. These options are not interchangeable ways to make a question optional.
-
askCollectIfSetdefaults tofalse: the bot skips variables that already have values and preserves those values. Withtrue, it asks again and overwrites the existing value with the customer's response. -
ignoreIntentRecognition=truerequires a response that satisfies the Question step's entity requirements. Messages that do not fit those requirements do not undergo intent recognition, and the bot repeats the question until the response fits. -
optionalCollect=truemakes the bot ask the repair attempts once and then advance to the next dialog step. Its default isfalse. -
quickReplyType=Dynamicobtains choices throughbotInvocation;StaticusesbotQuickReplyOptions. For a Dynamic Collect operation,autoSelectIfSingleChoice=trueautomatically selects the only available choice. Otherwise, the bot displays that choice and waits for a response; the default isfalse. -
invalidInputBotNavigationexecutes when the associated invocation returns no options. It is not a catch-all route for every invalid customer response.
Interpret these settings together with the actual step and variable values. Their definitions do not establish precedence between otherwise conflicting collection options.
Record lookup scope and ordering
ConversationRecordLookup currently works only with Lightning Knowledge. At lookup scope, SObjectType identifies the object; lookupFields.fieldName, conditions.leftOperand, and sortFieldName identify fields. Required targetVariableName identifies the variable receiving the results.
Although filterLogic and condition operatorType are strings, their documented values are constrained. filterLogic accepts And or Or. operatorType accepts Equals, NotEquals, IsSet, IsNotSet, GreaterThan, LessThan, GreaterThanOrEqualTo, or LessThanOrEqualTo. Lookup conditions ignore rightOperandValue for IsSet and IsNotSet.
The two lookup-related sortOrder elements serve different purposes. The lookup-level value, Asc or Desc, controls result display order. Each condition's numeric sortOrder controls the order in which conditions are applied.
Deployment and Retrieval
In the Metadata API representation, BotVersion shares its parent's .bot suffix and bot directory. The version is represented within Bot.botVersions. Its manifest member qualifies the version with the parent name using a dot, for example MyBot.v1. Explicitly enumerate members in package.xml: BotVersion does not support wildcard selection.
Dependencies can be nested below dialogs, Group steps, and variable operations. An invocation can appear directly in an Invocation step or inside a variable operation, including dynamic-choice collection. Inspecting only direct Invocation steps misses those action references.
For invocations, invocationActionType determines the target represented by invocationActionName: apex can reference an ApexClass, flow a Flow, and externalService an ExternalServiceRegistration. Input and Output invocationMappings bind named action parameters to literal values, variables, or records. The mapping's variableType identifies ContextVariable, ConversationVariable, or PageContextVariable; it is not the variable's data type.
Agent deployments can also require corresponding planner bundles for the selected versions. A recognized planner-name relationship does not automatically require both possible planner metadata destinations, and not every possible relationship belongs in every deployment. The actual references in the selected version determine which connections matter.
Community reports describe separate activation after deployment, edit restrictions when updating an active Einstein bot version, and change-set selection through the parent Bot's dependencies. The conditions and reported resolutions appear under Reported Issues.
Translation identifiers must remain stable
Translations can reference a BotVersion through fullName. Inside the version, stepIdentifier, messageIdentifier, variableOperationIdentifier, and quickReplyOptionIdentifier link translated labels to their corresponding records.
Each key identifies its record within a dialog and can contain letters, numbers, dashes, and underscores, up to 255 characters. The UI generates these identifiers automatically. API-created records must supply them, and translated labels require them. Changing a key changes translation linkage; these keys are not merely descriptive names.
Relationships
Most external dependencies come from actions, messaging components, variable operands, record lookups, and planners. A rich-message messageDefinitionName references a messaging component; its mappings provide static or variable-based inputs and can capture outputs in conversation variables. A Set variable operation can use outputs from that component.
For botVariableOperands.sourceName, use sourceType to interpret the name. Depending on that source configuration, it can identify a field, bot, flow, or queue; slot-class and variable sources are also supported. Where present, chatButtonName and defaultOutboundFlow identify a chat button and an outbound flow. The parent-child containment under Bot.botVersions is separate from these element references.
References
-
ApexClass:invocationActionNamefor Apex actions;nlpProviderNamefor an Apex language provider. -
Bot:sourceName, according to operand source configuration. -
ConversationMessageDefinition:messageDefinitionName. -
CustomField:fieldName,leftOperand,sortFieldName,sourceName. -
CustomObject:SObjectTypeat record-lookup scope. -
ExternalServiceRegistration:invocationActionNamefor external-service actions. -
Flow:invocationActionName,sourceName,defaultOutboundFlow. -
GenAiPacker:genAiPlannerName, as a recognized planner destination. -
GenAiPlanner:genAiPlannerName, as a recognized planner destination. -
LiveChatButton:chatButtonName. -
Queue:sourceName, according to operand source configuration.
Referenced By
-
Translations:fullName.
Documentation Inconsistencies
Three serialization differences matter when constructing or interpreting metadata:
- Salesforce documents variable visibility values as lowercase
internalandexternal, while an exposed tooling schema usesInternalandExternal. Preserve this distinction rather than assuming the capitalization is interchangeable. - The Salesforce API reference names the planner collection
conversationPlanner, while an exposed tooling schema names itconversationDefinitionPlanners. - The Salesforce API reference spells the primary-language element
copilotPrimaryLangauge, while an exposed tooling schema usescopilotPrimaryLanguage.
Reported Issues
-
Metadata deployment can leave an agent inactive. A 2026 cross-org Agentforce migration report describes agents arriving deactivated. The accepted answer reports activation with
sf agent activate -n AGENT_NAME -o TARGET_ORG, or withConnectApi.BotVersionActivation.updateVersionStatususing aBotVersionrecord ID andConnectApi.BotVersionActivationStatus.Active. That runtime record ID is not the metadatafullName. Activation automation discussion. - Updating an active Einstein bot version can encounter an edit restriction. An unanswered 2021 report associates the error "Can't edit an active bot version" with deployment over an active version. It does not establish the same restriction for every Agentforce configuration. Active-version deployment report.
-
A missing-planner error can reflect mismatched deployment coverage across versions. A November 2025 report attributes "Required fields are missing: [PlannerId]" to not including all selected BotVersions and their corresponding
GenAiPlannerBundleversions. The reported resolution was to include matching bundles for every selected version, or limit both sets to the desired version. The metadata planner-name element isgenAiPlannerName;PlannerIdis the term in the error. The same discussion reports adding the Bot to a change set, then selecting BotVersions through "View/Add Dependencies" rather than selecting them directly as components. Planner dependency and change-set discussion. -
An installed, active agent can still be absent from the Agent Script-based builder. A 2026 report about an org-dependent unlocked package containing
Bot,BotVersion, andGenAiPlannerBundledescribes agents visible as active in classic Setup but absent from Agentforce Studio whenAiAuthoringBundlewas missing. The author reports that separately deployingAiAuthoringBundlethrough Metadata API restored visibility, and that packaging that type was unsupported in their environment. Successful installation and active runtime status therefore did not establish builder visibility in that case. Package-installed agent visibility report.
Common Questions
How do I retrieve one BotVersion in package.xml?
Use an explicit BotVersion member qualified by its parent Bot, such as MyBot.v1. Wildcard selection is not supported. In the Metadata API representation, the version is contained in the parent's botVersions collection and shares its .bot file representation.
Why does my BotVersion deployment say PlannerId is missing?
A reported cause is deploying selected BotVersions without all corresponding GenAiPlannerBundle versions. The reported fix was to include the matching bundles for every selected version or restrict both sets to one desired version. The metadata planner-name element is genAiPlannerName, not PlannerId.
Does deploying BotVersion activate the agent?
Do not assume it does. A cross-org Agentforce report describes a separate activation step using sf agent activate -n AGENT_NAME -o TARGET_ORG or ConnectApi.BotVersionActivation.updateVersionStatus. The API method uses a runtime BotVersion record ID, not a metadata name such as MyBot.v1.
Does includeInPrompt only change the Included Fields display?
No. It controls whether the variable enters the prompt sent to the Agentforce model. Id, EndUserId, and EndUserLanguage always appear in Included Fields regardless of the flag, and Salesforce recommends leaving their settings unchanged to preserve access to session data.
Can ConversationRecordLookup query arbitrary Salesforce objects?
No. It currently works only with Lightning Knowledge, and maxLookupResults must be between 1 and 3. Its lookup-level SObjectType is separate from the variable-definition element whose documented values are BotDefinition and Queue.