Important to note: Make sure to use at least API version 65 for the comparison to retrieve the Agent Script metadata type.
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.
This guide will explain how to successfully deploy the Agent Scripts (AiAuthoringBundle) metadata via Gearset.
What metadata is needed in the filter?
In your metadata filter, you will need to include Agent Script along with Einstein Bot metadata type.
How to deploy AiAuthoringBundle with Gearset
Agent Scripts utilize a specific versioning logic when handled via the Metadata API.
During metadata comparisons, the latest version from the source is compared against the latest version in the target.
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, click the Change button and 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.
The committed Agent Scripts cannot be deployed in isolation. They must be deployed alongside the Bot that the Agent Script is dependant on.
You will encounter a problem analyzer due to missing dependencies if you don't include them in the deployment.
When you deploy a draft Agent script to a target environment, if the latest version in target is already committed, the deployment process automatically triggers the creation of a new draft version in the target org to preserve history and prevent the accidental overwriting of active logic.
Note: In some cases, deploying committed Agent Scripts can result in unexpected Salesforce errors. We’ve seen customers resolve this by contacting Salesforce Support, who recommend deploying the scripts as drafts first and then re-deploying them as active.
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.






