Important to note: Make sure to use at least API version 65 for the comparison to retrieve the Agent Script metadata type.
Introduction
An Agentforce agent is an AI-powered assistant built on Salesforce’s Agentforce platform that can help users by handling questions and tasks without needing constant guidance. It is designed to help teams work faster and more efficiently by combining generative AI with Salesforce data, automation, and decision-making capabilities.
Gearset's Agentforce metadata deployment solution simplifies the deployment of AI-powered configuration, such as Agent Scripts, in Salesforce.
ℹ️ An Agent Script is the instruction manual for your AI. It tells the agent who it is, what it’s allowed to do, and how to use Salesforce tools to help customers while maintaining brand voice and security compliance. Learn more about Agent Scripts here.
How to deploy an Agent with Gearset
These instructions specifically mention the deployment of Agents created with Agent Script, other format Agentforce agents can also be deployed through Gearset in the same way.
Prerequisites
In both source and target orgs, Agentforce / Einstein Generative AI must be enabled through Setup.
Your Metadata API version must be 60.0 or higher because the Agentforce (GenAI) metadata types (like GenAiPlanner, GenAiFunction, GenAiPlugin, etc.) were introduced starting in API version 60.
Ensure that you have the necessary permission set licenses to retrieve Agentforce metadata types;
Agentforce (Default)
Agentforce Service Agent Builder
Einstein Prompt Templates
Prompt Template Manager
What metadata do I need to include?
To move an Agentforce agent from one org to another, you need to deploy the metadata that covers the core agent definition and its version, the planning or reasoning configuration, and the associated topics, actions, and prompt templates that power the agent’s functionality.
Using the default Agentforce filter is a good starting point to make sure you've included all the relevant metadata in your comparison.
How to deploy your Agent (AiAuthoringBundle) metadata with Gearset
Agent Scripts can have multiple versions, in either a draft, committed, or active state.
During metadata comparisons, the latest version from the source is compared against the latest version in the target - you will be able to see if the version you are looking at is draft, committed and/or active.
If the Agent Script has multiple versions on the source side, you can use the Agent Script Visualizer to identify which version is the latest in the source org currently.
If you want to deploy a different version, select your desired version from the dropdown menu.
Note: For Git to org comparisons, the latest version will always be selected for the comparison and deployment so the changes from different developers to the same Agent can be reviewed and merged correctly in the pipeline.
Once you've selected your Agent Script, click Next. If the target Agent Script is committed, Salesforce will only allow deployment of a draft version, which will automatically create a new version in the target environment. A problem analyzer will appear to highlight this and allow you to convert the Agent Script to draft.
Use the post-deployment step to make sure that the Agent is automatically committed in the target.
To learn more about deploying Agentforce with Gearset check out our other documentation or get in touch with our customer support team via the in-app chat.
Check out these related documents on deploying Agentforce metadata types:




