This article explains common deployment and metadata-related errors encountered when deploying Agentforce components. It describes the likely causes of each error and provides recommended resolution steps.
When deploying Agentforce metadata using Salesforce CLI, Metadata API, DevOps Center, or Change Sets, deployments may fail due to missing dependencies, metadata structure changes, API version mismatches, permission issues, or environment configuration differences.
This article covers common deployment and metadata errors, their causes, and recommended resolutions.
Before troubleshooting deployment failures:
Verify Agentforce is enabled in the target org.
Ensure the source and target orgs are on compatible Salesforce releases.
Deploy metadata dependencies before deploying Agentforce components when using changeset.
Use the latest supported Salesforce CLI version.
Salesforce CLI is recommended over other tools ANT Migration, Copado, gitbucket.
Metadata Type
GenAiPlannerBundle / GenAiPlanner
Error Message
GenAiPlannerBundle: <AgentName> — Function not found: null
Cause
The planner references a GenAiPlugin or GenAiFunction that does not exist in the target org or was not included in the deployment package.
Resolution
Deploy all dependencies before deploying the Agent metadata.
Recommended deployment order:
Flows
Apex Classes
Custom Objects and Fields
Prompt Templates
GenAiPlannerBundle
Bot and BotVersion
Beginning with Winter '26, GenAiPlugin and GenAiFunction are bundled within GenAiPlannerBundle and should not be deployed as standalone metadata.
Retrieve metadata using:
sf project retrieve start --metadata Agent:<AgentName>
Metadata Type
GenAiPlugin / GenAiPlanner
Error Message
GenAiPlugin: <Name> — Required fields are missing: [Function]
GenAiPlanner: <Name> — Function not found: null
Cause
The referenced function has not yet been deployed.
Resolution
Deploy all referenced actions and functions before deploying the planner.
Metadata Type
BotVersion
Error Message
BotVersion: <AgentName>.v1 — Required fields are missing: [PlannerId]
Cause
The BotVersion references a GenAiPlannerBundle that is missing from the deployment package.
Resolution
Always deploy GenAiPlannerBundle together with Bot and BotVersion.
Prefer deploying using sf project deploy start --source-dir.
Verify the deployment uses GenAiPlannerBundle instead of the legacy GenAiPlannerDefinition metadata type.
Metadata Type
GenAiPlanner
Error Message
GenAiPlanner: <AgentName> — Invalid variable or attribute reference: <VariableName>
Cause
Variable mappings referenced by the planner cannot be resolved during deployment.
Resolution
Temporarily remove variable mappings before deployment and recreate them after deployment.
Metadata Type
GenAiPlanner
Error Message
EmployeeCopilotPlanner of Type GenAiPlanner failed to deploy due to invalid cross reference id
Cause
Occurs when switching from Agentforce Default Agent to Employee Agent and deploying to a target org where the Default Agent has been disabled or the referenced BotVersion no longer exists.
Resolution
BotVersion records: SELECT Id FROM BotVersion WHERE Id = '<referenced_id>'Metadata Type
GenAiPlannerBundle
Error Message
InvocableTarget not found: <FlowName>
Cause
Local action (Flow or Apex) referenced in the GenAiPlannerBundle was not included in the deployment. Local actions must be deployed alongside or before the bundle.
Resolution
GenAiPlannerBundle
Verify the Flow API name in the bundle XML matches exactlyError Message
UNKNOWN_EXCEPTION: An unexpected error occurred.
Cause
Backend metadata corruption prevents metadata retrieval.
Resolution
Contact Salesforce Support and provide the Error ID for metadata cleanup.
Metadata Type
GenAiPlannerDefinition
Error Message
An unexpected error occurred. Please include this ErrorId if you contact support: <ErrorId>
Metadata API Name: Agentforce | Type: Generative AI Planner Definition
Cause
The source and target orgs are using incompatible Metadata API versions.
Resolution
Align the API versions across environments.
Use API version 64.0 or 65.0 when appropriate.
Metadata Types
GenAiFunction / GenAiPlugin
Error Message
Entity of type 'GenAiFunction' named '<Name>' cannot be found.
Cause
Beginning with Winter '26, these metadata types are no longer deployed separately.
Resolution
Remove GenAiFunction and GenAiPlugin from package.xml.
Deploy GenAiPlannerBundle instead.
Metadata Type
BotVersion
Error Message
Element isCompatibleAgent invalid at this location in type BotVersion
Cause
The target org is running an earlier Salesforce release that does not support this field.
Resolution
Wait for the target org to be upgraded to latest salesforce release.
Remove unsupported fields before deployment if necessary.
Metadata Type
Agentforce Employee Agent
Error Message
Duplicate key value violates unique constraint
Cause
Duplicate backend records exist after Winter '26 metadata structure changes.
Resolution
Metadata Type
Bot
Error Message
Required field is missing: entryDialog
Cause
entryDialog is a mandatory field for certain Bot metadata schemas in 2GP managed packaging. Manually adding it to XML causes schema validation errors due to format mismatch.
Resolution
Bot XML schema matches the target API version exactlyError Message
ValidationException.No_Data_Available
Cause
Agentforce metadata provisioning is incomplete in the target org.
Resolution
agentScript directory from GenAiPlannerBundle change set and deploy via SFDXError Message
DataKitDeployPolling job executed successfully, but component is in error state: ''
permissionErrors: [GenAiFunctionDefinition, GenAiPluginDefinition]
errorCode: SFDC_PERMISSION_ERRORFDC_PERMISSION_ERROR
Cause
Agentforce or Einstein setup is incomplete.
Resolution
Confirm Agentforce is enabled and and at least one agent exists in the org.
Verify the Salesforce CRM connection in Data Cloud.
Ensure Einstein/Generative AI settings are enabled.
Error Message
DataKitDeployPolling job executed successfully, but component is in error state: 'sfm_AgentOpt'
Cause
A Data Kit synchronization mismatch exists after sandbox refresh or metadata changes.
Resolution
AgentOpt-Tag, AgentOpt-Tag Def Association, AgentOpt-Tag Def, AgentOpt-Tag Association) transition from "Needs Activation" → ActiveError Message
Something went wrong. Refresh.
Cause
GenAiPluginDefinition and GenAiFunctionDefinition SObject records are NOT being created during metadata deployment. The UI reads from GenAiPlannerBundle metadata (topics/actions appear fine), but session creation reads from Core SObject records — which are missing.
Diagnostic Query:
SELECT Id, DeveloperName FROM GenAiPluginDefinition
SELECT Id, DeveloperName FROM GenAiFunctionDefinition
If 0 records returned post-deployment, this is the issue.
Resolution
GenAiPlannerBundle at API v65 via Workbench or CLIBotUserId is null in BotDefinition: redeploy the Bot record to repopulate the Agent User field| Component | Pre-Winter '26 | Post-Winter '26 |
| Agent (Planner) | GenAiPlannerDefinition | GenAiPlannerBundle |
| Topics | GenAiPlugin (standalone) | Bundled in GenAiPlannerBundle |
| Actions | GenAiFunction (standalone) | Bundled in GenAiPlannerBundle |
| Retrieve command | Separate types | sf project retrieve start --metadata Agent:<name> |
Recommended deployment order:
GenAiPlannerBundle (includes topics & actions post-Winter '26)Bot and BotVersionAgent Metadata — Agentforce DX
Troubleshoot Agentforce DX Issues
Agentforce SFDX Deployment Prerequisites
Agentforce Deployment with Change Set
005387734

We use three kinds of cookies on our websites: required, functional, and advertising. You can choose whether functional and advertising cookies apply. Click on the different cookie categories to find out more about each category and to change the default settings.
Privacy Statement
Required cookies are necessary for basic website functionality. Some examples include: session cookies needed to transmit the website, authentication cookies, and security cookies.
Functional cookies enhance functions, performance, and services on the website. Some examples include: cookies used to analyze site traffic, cookies used for market research, and cookies used to display advertising that is not directed to a particular individual.
Advertising cookies track activity across websites in order to understand a viewer’s interests, and direct them specific marketing. Some examples include: cookies used for remarketing, or interest-based advertising.