BotBlock defines an Einstein Bot block's conversational configuration: dialogs, variables, goals, and a local intent and entity model. The deployable component is BotBlock; its botBlockVersions element contains nested BotBlockVersion definitions, not separately deployable components. The block's fullName identifies the metadata component, while masterLabel is its required user-facing label.
A block's compatibility setting, version publication status, and a consuming bot's activation are different things. richContentEnabled controls whether the block is available for enhanced bots. It does not publish the block or activate a bot.
Key Elements
| Element | What the Element Controls |
|---|---|
fullName |
Identifies the outer metadata component. It is inherited from Metadata and is distinct from the displayed label. |
masterLabel |
Required user-facing label for the block. |
richContentEnabled |
true makes the block available for enhanced bots. false, the default, restricts it to standard bots. |
botBlockVersions |
Contains nested version configurations, including botDialogs, conversationGoals, conversationVariables, and mlDomain. |
conversationLanguages |
Required on each nested version. Specifies the language of the block. |
status |
Required on each nested version. The only documented serialized value is Published. |
permissionSet |
Associates a PermissionSet with a particular block version, not with the outer block. |
botDialogs |
Defines the version's dialogs. Important nested fields include developerName, label, mlIntent, and isPlaceholderDialog. |
mlDomain |
Required local Einstein Intent Set. Groups intents, entities, and associated variables. Entity extraction uses extractionType values Pattern or Value. |
mlIntentTrainingEnabled |
On a dialog, true enables Einstein intent-model training. false, the default, uses exact matching. |
botSteps |
Defines dialog steps and can contain nested botSteps. Conditions use botStepConditions with conditionLogicType values And or Or. |
botVariableOperation |
Controls collection and variable changes. Operation type values include Collect, CollectAttachment, Set, SetConversationLanguage, and Unset. |
conversationVariables |
Defines values used as action inputs and outputs. dataType, collectionType, SObjectType, and visibility determine their shape and how they can be set. |
conversationRecordLookup |
Defines an object lookup, its conditions, returned fields, and result variable. Required maxLookupResults accepts values from 1 to 3. |
messageDefinition |
References a messaging component through messageDefinitionName. Supports parameter mappings and executionType values Async and Sync. |
Behavior and Constraints
Availability, compatibility, and publication
BotBlock is available only when both Chat and Einstein Bots are enabled in the org. Bot metadata deployment and retrieval are not supported for Lead Nurturing and Sales Coach Agents.
Each nested version requires conversationLanguages, mlDomain, and status. A version with status set to Published is not evidence that a consuming bot is active or receiving conversations. Likewise, setting richContentEnabled to true changes compatibility, not publication or activation.
The version-level permissionSet references permission-set metadata. That association alone does not establish which permissions the permission set grants or what access an executing action has.
Intents, entities, and dialog structure
A dialog's mlIntent connects it to an intent. mlIntentTrainingEnabled determines whether that intent uses model training or exact matching. Entity extraction is separate: mlSlotClasses.extractionType distinguishes Pattern from Value, and extractionRegex applies to Pattern extraction. Intent recognition and entity extraction are not interchangeable matching settings.
isPlaceholderDialog identifies a placeholder dialog and is read-only. Distinguish a placeholder from an ordinary dialog definition when interpreting a block's contents.
Steps are not limited to a flat sequence: botSteps can contain further botSteps. Conditional behavior uses botStepConditions and conditionLogicType. Navigation has a separate type with values Call, Redirect, and TransferToAgent; targetBotDialog identifies a navigation link's target dialog.
Collection settings work together
A question message alone does not establish whether the bot will collect, replace, validate, or skip a value. Inspect the variable-operation settings:
-
askCollectIfSetdefaults tofalse. A Collect operation skips a variable that already has a value and preserves that value. Withtrue, collection runs and overwrites the existing value. -
ignoreIntentRecognition=truekeeps asking until the response meets the entity requirements, rather than recognizing an intent from that response. -
optionalCollect=trueattempts repair once and then advances to the next step. The default,false, continues repairs. -
autoSelectIfSingleChoiceapplies to Collect operations withquickReplyType=Dynamic. Withtrue, a sole button choice is selected automatically. The default,false, waits for user input.
Variable shape and access
Conversation variables can supply action inputs and receive action outputs. Their dataType values are Boolean, Currency, Date, DateTime, Id, Number, Object, and Text. Optional collectionType=List marks a list variable, and SObjectType identifies an associated Salesforce object.
visibility accepts Internal and External. Internal variables can be set only by action outputs; external variables can also be set through the API.
When conversation variables are used with Agentforce, includeInPrompt controls whether a variable is included in the model prompt, and description can inform the planner. Those fields do not, by themselves, establish that an Einstein Bot block is running through Agentforce.
Actions, lookups, and messaging components
botInvocation selects an action using invocationActionName together with invocationActionType. Recognized destinations include ApexClass, Flow, and ExternalServiceRegistration, corresponding to action types such as apex, flow, and externalService. These are alternative target categories, not simultaneous dependencies for every invocation.
invocationMappings binds parameters using Input, Output, or Error mappings. Values can come from literals, records, or variables. Invocations can occur directly on steps or inside botVariableOperation.
A conversationRecordLookup identifies an object through SObjectType. It identifies fields through conditions.leftOperand, lookupFields.fieldName, and sortFieldName. sourceVariableName supplies the lookup input, and targetVariableName holds the results. The lookup-level sortOrder values Asc and Desc control result display order, not bot-step execution order. The separate integer sortOrder inside conditions specifies the order in which conditions are applied.
For variable operands, interpret sourceName together with sourceType. Recognized relationships include fields, bots, flows, and queues, while source types also cover variables, entities, and literal values. BotDefinition and FlowDefinition are source-type values; their corresponding metadata types are Bot and Flow.
messageDefinition can occur directly on a step or within a variable operation. Its messageDefinitionName references ConversationMessageDefinition, with parameter mappings and synchronous or asynchronous execution selected by executionType.
Deployment and Retrieval
BotBlock files use the .botBlock suffix and are stored in the botBlocks folder. In package.xml, use BotBlock as the type name and the component's fullName as the member. The type supports the wildcard * in the manifest.
Deploy and retrieve the outer block with its nested version definitions. Do not treat BotBlockVersion, dialogs, or steps as independently deployable components. The outer block requires masterLabel, and each nested version requires its language, local intent set, and status.
Dependencies can be several levels deep. Inspect dialogs, nested steps, variable operations, invocation mappings, record lookups, and messaging-component references. An object association can also appear on conversationVariables.SObjectType. The actual nested values determine the dependencies; the presence of an optional schema element does not prove that the block uses every supported destination type.
Preserve translation identity
Within dialogs, stepIdentifier, messageIdentifier, quickReplyOptionIdentifier, and variableOperationIdentifier are keys that link translated labels. They are not display labels.
-
messageIdentifieris required when creating a message through the API and when using translated message labels. -
quickReplyOptionIdentifieris required when creating a quick reply option through the API and when using translated option labels. - Step and variable-operation identifiers are generated by the UI or supplied through the API.
These identifiers allow letters, numbers, dashes, and underscores, up to 255 characters. Preserving them preserves the identity used for translation linkage, even when visible wording changes. Renaming or regenerating an identifier is therefore different from editing message text.
Relationships
Most outgoing dependencies occur inside nested versions, dialogs, and steps. Resolve action and variable-source names using their accompanying type fields. Translation linkage is incoming from Translations; it is not a field in BotBlock pointing to a translation component.
References
-
ApexClass:invocationActionName -
Bot:sourceName -
ConversationMessageDefinition:messageDefinitionName -
CustomField:fieldName,leftOperand,sortFieldName,sourceName -
CustomObject:SObjectType -
ExternalServiceRegistration:invocationActionName -
Flow:invocationActionName,sourceName -
PermissionSet:permissionSet -
Queue:sourceName
Referenced By
-
Translations:fullName
Documentation Inconsistencies
The status description says that a block version can be published or a draft, but its documented enumeration contains only Published. Draft is not a documented serialized value. Do not infer support for serializing Draft from the descriptive wording.
Common Questions
How do I retrieve or deploy a BotBlock?
Use the BotBlock type in package.xml, with the component's fullName or the supported * wildcard. Files belong in botBlocks with the .botBlock suffix. Versions remain nested in the block. Both Chat and Einstein Bots must be enabled.
Why is my BotBlock unavailable for enhanced bots?
Check the outer block's richContentEnabled value. The default, false, restricts the block to standard bots. Set it to true to make the block available for enhanced bots; this does not publish or activate anything.
Can I deploy a draft BotBlock version?
The only documented serialized status value is Published, despite the description mentioning drafts. A published block version also does not establish that a consuming bot is active.
Why does a Collect step skip a question or overwrite a variable?
With the default askCollectIfSet=false, collection skips a variable that already has a value. With true, it collects again and overwrites that value. Also inspect ignoreIntentRecognition, optionalCollect, and dynamic quick-reply settings to understand validation and advancement.
Which BotBlock identifiers matter for translations?
Preserve stepIdentifier, messageIdentifier, quickReplyOptionIdentifier, and variableOperationIdentifier. They link translated labels to dialog content. Changing visible text is different from renaming or regenerating these keys.