91导航

How to deploy Salesforce Agent Script metadata

How to deploy Salesforce Agent Script metadata

Hazel Izzett on

Share with



91导航 fully supports Agent Script deployments 鈥 but the metadata model behind Agent Script is more involved than a typical Salesforce component, and getting it wrong leaves you with a broken deployment or an agent stuck in draft.

This post covers what Agent Script actually is, how Salesforce鈥檚 draft and committed lifecycle affects deployment, and how to move an Agent Script between orgs with 91导航.

What is Agent Script?

Agent Script, aka AIAuthoringBundle, is Salesforce鈥檚 way of defining how an Agentforce agent reasons, acts and communicates.

Think of it as the instruction manual for your AI agent, blending prompt engineering and business logic. An Agent Script file tells the agent who it is, what it鈥檚 allowed to do, and how to use Salesforce tools. Importantly, this component is easy to read and edit by humans and agents alike, as well as being the shared source of truth.

Agent Script is central to what Salesforce calls 鈥渉ybrid reasoning鈥. This is the idea that production-grade agents need more than just a capable LLM. They need deterministic rules, clear checkpoints, and tight control over what context the model sees at every step.

With Agent Script, you get:

  • One source of truth. Your agent鈥檚 full configuration lives in a single, versioned component, not spread across dozens of screens.
  • Human and AI collaboration. Because the format is clean, structured text, both builders and AI assistants can read, write, and reason about it natively.
  • Precision control. You can enforce deterministic logic for routing, validation, and permissions, while keeping model reasoning for the moments where it adds value.
  • Full portability. The file can move through code reviews, version control, and deployment pipelines just like any other piece of Salesforce metadata.

Excel London

Agentforce World Tour London

Find out more

What happens when you commit an Agent Script

When you build an agent with Agent Script, the logic lives in a Salesforce metadata type called AiAuthoringBundle. Each bundle has two parts: a standard XML registration file (.bundle-meta.xml), and the Agent Script file itself (.agent), where the actual logic sits. 91导航 labels it simply 鈥淎gent Script鈥 in the comparison view, to keep selection simple.

An Agent Script moves through two states. In draft, you can edit and test the agent in Agentforce Builder, but Salesforce hasn鈥檛 generated anything from it yet. When you commit a draft, Salesforce compiles and validates the script, then generates a versioned, numbered snapshot of the bundle (for example, My_Agent_1) along with three dependent components: a Bot, a BotVersion, and a GenAiPlannerBundle 鈥 the immutable execution plan that actually runs the agent. In a deployment, this means that if the Agent Script in the target org is already committed, the target org will only allow the deployment of a draft version to prevent the overwrite of active logic.

That鈥檚 the detail that matters for deployment. Although they will show up as dependencies, Bot, BotVersion, and GenAiPlannerBundle aren鈥檛 components you need to deploy alongside an Agent Script, because 91导航 will deploy your Agent Script as draft and automatically commit it to the target org. Salesforce generates the Bot, a BotVersion, and GenAiPlannerBundle automatically the moment the draft gets committed in the target org.

Committed versions are fixed. If the agent鈥檚 logic needs to change, that means committing a new version, which generates a new GenAiPlannerBundle. You can鈥檛 edit a committed version of the agent in place.

Deploying Agent Scripts with 91导航

91导航 makes it easy to deploy Agentforce metadata, and that includes Agent Script.

1. Compare source and target environments

First, select the environments you need to move the Agent Script between. In this example, the source environment is a developer org and the target is a Git branch. 91导航鈥檚 is a solid starting point. It picks up Agent Script along with the rest of the metadata you need. Hit Compare now.

Source and target environments along with the filter, for Agent Script deployment

In the comparison view, you can see what鈥檚 new, changed and deleted. This Agent Script sits under the Changed tab, meaning it exists in the source and target but in different states. Click any item to see how it compares between environments and to check its dependencies.

91导航 comparison view showing changed tab

A note on versioning: 91导航鈥檚 comparison shows the latest version of the agent from the source against the latest version in the target. If your source org has multiple versions, use the Agent Script Visualizer to confirm which one鈥檚 current, or pick a different version from the dropdown if you need something other than the latest. For Git-to-org comparisons, 91导航 always selects the latest version, so changes from different developers to the same agent merge correctly through your pipeline.

2. Select the changes to deploy

Deploying an Agent Script update means deploying the AiAuthoringBundle itself, nothing else. Skip Bot, BotVersion, and GenAiPlannerBundle: Salesforce generates all three automatically once the draft is committed in the target org, so they don鈥檛 belong in your deployment package.

If the Agent Script in the target org is already committed, Salesforce only allows a draft version to be deployed there, to stop active logic getting overwritten by accident. 91导航鈥檚 problem analysis checks for this and adjusts your deployment to a draft automatically, so you don鈥檛 hit a rejected deployment.

One error worth knowing: deploying a committed version against another committed version in the target gets rejected outright, with Salesforce returning a 鈥測ou cannot deploy to a published bundle鈥 error. 91导航鈥檚 automatic draft conversion is what keeps you from running into it.

91导航's problem analysis

3. Deploy 鈥 and commit automatically

The next screen shows a summary of your deployment. Give it a name and leave a note. That becomes your deployment history, and doubles as the commit name and message if you鈥檙e committing to Git.

Turn on Commit Agent Script after deployment here. Without it, your Agent Script lands as a draft in the target, and someone still needs to log into Agentforce Builder and commit it before Salesforce generates the Bot, BotVersion, and GenAiPlannerBundle that make the agent actually run. Skip that step and the agent just sits there, deployed but inert. With it on, 91导航 triggers the commit automatically once the draft deployment finishes, generating every dependent component with no manual step required. It鈥檚 currently available for org-to-org deployments, with pipeline support on the way.

Summary of deployment

If you鈥檝e integrated an issue-tracking solution such as Jira, attach the deployment here too. Deploying to a Salesforce org lets you kick off a Salesforce validation first, to confirm the deployment will succeed. When you鈥檙e ready, deploy or commit the changes, or schedule for later if a release window calls for it.

Once your Agent Script has deployed or committed successfully, 91导航鈥檚 results page surfaces the most likely next actions. Here, that鈥檚 probably opening a pull request. Full or partial rollback are options too, if you need them.

DevOps fundamentals for Agentforce success

To deliver success with Agentforce, your agents need to be built, tested, deployed and monitored like other Salesforce metadata. Deploying Agent Scripts with 91导航 is just the start. The wider 91导航 platform gives you an end-to-end process for the DevOps lifecycle, so you can innovate on the Salesforce platform with both speed and stability.

Get started with Agent Script

Don鈥檛 let deployment challenges hold you back from succeeding with Agent Script. to test out deploying your metadata in a few easy steps. And you can book a tailored demo with one of our DevOps experts to see how 91导航 will help get your Agentforce implementation on track.

Ready to get started with 91导航?