Before attempting to deploy an Agent using SFDX , your local / source environment and the target Salesforce Org must be strictly configured. Agentforce metadata is highly dependent on feature toggles and specific API versions. Skipping these checks is the primary cause of deployment failures.
Because Agentforce components are rapidly evolving, older versions cannot refer the new metadata types.
Update Salesforce CLI: Run sf update to ensure you have the latest CLI version.
Set API Version to 64.0+: Check your sfdx-project.json. You must target API version 64.0 or higher.
Critical Note: API v64.0+ introduced GenAiPlannerBundle, which replaces the older GenAiPlanner. For older API versions, some components may not get deployed.
Log in to your Target Org (the org you are deploying to) and verify these four feature toggles are enabled.
|
Feature Area |
Navigation Path |
Action |
|
Einstein |
Setup → Einstein Setup |
Toggle Turn on Einstein to "On". |
|
Bots |
Setup → Einstein Bots |
Toggle Einstein Bots to "On". |
|
Agents |
Setup → Agents |
Toggle Einstein Copilot for Salesforce to "On". |
|
Data Cloud |
Setup → Data Cloud Setup |
Click Get Started / Enable. |
Note: If your target is a Sandbox, Data Cloud must be enabled in your Production org first (Setup → Data Cloud Setup → Feature Manager → Data Cloud in Sandbox → Enable).
Agents like Service Agent and Lead Nurturing Agent run as a specific user. This user must exist in the Target Org before deployment.
Create the User: Create a new user in the Target Org.
Assign License: Select Einstein Agent.
Assign Profile: Select Einstein Agent User.
Permission Sets: If your Agent needs to access specific Objects, Flows, or Apex, create a Permission Set and assign it to this user.
Be aware of these specific metadata behaviors before you package your work:
Prompt Templates & Flows: If a Prompt Template references a Flow, it often fails validation.
Workaround: You may need to remove the Flow reference from the template XML before deploying, then manually re-add it in the Target Org’s Prompt Builder.
Spring '25 XML Error: If deploying GenAiPlugin or GenAiFunction, you may encounter an UNKNOWN_EXCEPTION. To fix this, remove or comment out these fields from your XML before deploying:
Data Cloud Objects: These cannot be deployed via Metadata API. They must be bundled into a Data Kit and installed in the target org separately.
005237033

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.