Cert EspressoLearn. Practise. Find your flow.

A LITTLE FOCUS.
A BIG NEXT STEP.

Your pace. Your space.
Salesforce · Agentforce Specialist

Deploying Agents and Templates to Production

Agentforce Specialist · Lesson 12 of 14 · 1:42:07

YouTube loads only after you press play. This chapter opens at its timestamp in the full course. Watch on YouTube ↗

Learning with these videos? Subscribe for new courses and exam-style questions.

In this lesson

Prepare for the Salesforce Agentforce Specialist exam. In this lesson: the agent lifecycle (draft, commit, activate), the agent metadata, retrieving and deploying with the Salesforce CLI, dependencies, what to do after deployment, and moving prompt templates (published versions, global Apex, data kits for retrievers, custom models, flows). Includes three original practice questions, with Sunmeadow Solar, a fictional solar installer, as the example.

Study notes

The text of this lesson, to read at your own pace. Information as of December 2026.

Passed in the sandbox

The portal agent passed its tests in Sunmeadow's sandbox. Now it must reach production, together with its flows, its prompt templates, and its data. This lesson shows what travels on its own, what does not, and what to do once it lands.

Agent versions

An agent goes through a simple cycle. You author a draft, in the builder or as Agent Script, and try it in the preview. Then you commit a version, which turns the script into the metadata that runs, and you activate it. A committed version cannot change, so any change means a new version.

Agent metadata

An agent is stored as metadata. Bot holds what all versions share, such as the agent type and its context variables, and Bot Version holds what belongs to one version. The planner bundle holds everything a committed version uses, while plugins are subagents, and functions are actions. The authoring bundle holds the script, and prompt templates have their own type.

Moving an agent

To move an agent, you retrieve its metadata from the sandbox with a manifest, using the Salesforce CLI, then deploy it to the target org. The flows, Apex classes, and prompt template actions that the agent uses come along. Other dependencies, such as custom objects or Data 360 elements, must be added yourself. And Einstein and Agentforce must be turned on in both orgs.

After the deployment

Once deployed, assign the target org's own agent user, because usernames differ from one org to another. Check that this user has the permissions the agent needs, such as read access to a custom field. Then activate the agent in the target org. And keep the versions aligned between the sandbox and production, so that you always know what runs where.

Moving prompt templates

Prompt templates have their own rules. Only published versions travel, and a published version is never overwritten: a new one is added. An Apex class used by a packaged template must be global. And a template that uses a custom model needs a model with the same name in the target org, where Einstein generative AI must also be on.

Retrievers and flows

Retrievers do not travel with the template. You move them with a Data 360 data kit, or the deployment fails because metadata is missing. Flows are not activated automatically, so activate them in the target, and check the active version of each template there. And test the installation in a sandbox before production.

Recap

Let's recap. You author a draft, commit a version, and activate it, and a committed version never changes. The agent is metadata, which you retrieve from the sandbox and deploy, adding the dependencies that do not come along. In the target, assign its own agent user, check permissions, activate, and keep versions aligned. For templates, only published versions travel, packaged Apex must be global, and custom models need the same name. Retrievers move with a data kit, flows need activating, and everything is tested in a sandbox first.

Quick checks for this lesson

The 3 questions of this lesson, as plain text. The button above runs them with shuffled choices and the reason behind every choice.

  1. The admin wants to change the instructions of the agent version that is committed and active. What should the admin do?

    • Edit the committed version directly
    • Deactivate it, then edit the same version
    • Create a new version, commit it, activate it
    • Deploy to production, then edit it there
    Show the answer

    Create a new version, commit it, activate it

    A committed version cannot change, so the admin creates a new version, commits it, and activates it. “Edit the committed version directly” is wrong, because the committed version cannot be edited directly. “Deactivate it, then edit the same version” is wrong, since deactivating it does not make a committed version editable. And “Deploy to production, then edit it there” is wrong, because changes belong in the sandbox first, and a committed version cannot change anywhere.

  2. After deployment, the service agent cannot run in production, because its agent user from the sandbox does not exist there. What should the admin do?

    • Assign a production agent user with the permissions
    • Reuse the sandbox username in production
    • Run the agent as the admin’s own user
    • Deploy the agent again from the sandbox
    Show the answer

    Assign a production agent user with the permissions

    Each org needs its own agent user, so the admin assigns one in production, and gives it the permissions it needs. “Reuse the sandbox username in production” is wrong, because a username belongs to one org, and cannot simply be reused in another. “Run the agent as the admin’s own user” is wrong, since running as an admin gives the agent far more access than it needs. And “Deploy the agent again from the sandbox” is wrong, because deploying again brings the same reference to a user who does not exist.

  3. A template grounded with a Data 360 retriever fails to deploy, because the retriever is missing in the target org. What should the admin do?

    • Include the retriever in the template’s package
    • Move the retriever with a Data 360 data kit
    • Remove the grounding from the template
    • Switch the template to the default model
    Show the answer

    Move the retriever with a Data 360 data kit

    Retrievers travel through a Data 360 data kit, so the admin moves the retriever that way, then deploys the template. “Include the retriever in the template’s package” is wrong, because a retriever does not travel inside the template's package. “Remove the grounding from the template” is wrong, since removing the grounding would change what the template does. And “Switch the template to the default model” is wrong, because the model has nothing to do with a missing retriever.