# Deploying prompt templates from sandbox to production

*Agentforce Specialist Study Guide · Testing, Deployment, and Maintenance · Last updated October 15, 2026 · https://www.certifyforce.com/study-guide/agentforce-specialist/testing-deployment-and-maintenance/deploying-prompt-templates-from-sandbox-to-production*

How prompt templates move between orgs with change sets, Salesforce CLI and packages: deploying referenced flows, what happens to versions and activation, the two Einstein Setup deployment settings, custom model names, and why templates can't be deleted by deployment.

- Certification: Salesforce Agentforce Specialist
- Exam section: Testing, Deployment, and Maintenance
- Study guide: https://www.certifyforce.com/study-guide/agentforce-specialist

**Official exam objective:**

> Identify the considerations for deploying a template from sandbox to production.

## What the exam expects

- Deploy a prompt template together with the flows and Apex it references, and recover when that deployment fails.
- Predict which versions arrive in the target org and whether any version is active afterwards.
- Configure the two Einstein Setup settings: auto-activation of deployed templates and deploying only the active version.
- Deploy or retrieve one template with Salesforce CLI using the GenAiPromptTemplate metadata type.
- Recognise what deployment can't do: delete templates, modify published versions, or bring a missing custom model.
- Key terms: **GenAiPromptTemplate** (the metadata type for a prompt template); **published version** (a version that was ever activated; immutable); **template-triggered flow** (a flow a template calls to fetch grounding data); **Deploy Prompt Templates** (the change set permission that auto-activates source-active templates); **Deploy Only the Active Template Version** (the setting that skips inactive versions).

## Key facts

| Fact | Detail | Source |
|---|---|---|
| Template-triggered flows | Build with manual inputs; deploy flow and template together | [Deployment Considerations for Prompt Templates](https://help.salesforce.com/s/articleView?id=ai.prompt_builder_considerations_deployment.htm&language=en_US&type=5) |
| Failed template-plus-flow deployment | Deploy the flow first, then the template separately | [Deployment Considerations for Prompt Templates](https://help.salesforce.com/s/articleView?id=ai.prompt_builder_considerations_deployment.htm&language=en_US&type=5) |
| Default activation after change set | All templates arrive inactive; activate manually | [Change Set Considerations for Prompt Templates](https://help.salesforce.com/s/articleView?id=ai.prompt_builder_considerations_changeset.htm&language=en_US&type=5) |
| Deploy Prompt Templates | Auto-activates source-active templates; change sets only | [Change Set Considerations for Prompt Templates](https://help.salesforce.com/s/articleView?id=ai.prompt_builder_considerations_changeset.htm&language=en_US&type=5) |
| Default versions in a change set | All versions, active or inactive | [Change Set Considerations for Prompt Templates](https://help.salesforce.com/s/articleView?id=ai.prompt_builder_considerations_changeset.htm&language=en_US&type=5) |
| Deploy Only Active Version, no active version | Deployment fails with an error | [Change Set Considerations for Prompt Templates](https://help.salesforce.com/s/articleView?id=ai.prompt_builder_considerations_changeset.htm&language=en_US&type=5) |
| Published versions | Immutable; skipped on redeploy | [Change Set Considerations for Prompt Templates](https://help.salesforce.com/s/articleView?id=ai.prompt_builder_considerations_changeset.htm&language=en_US&type=5) |
| Custom LLM in a template | Target org needs a model with the same name | [Change Set Considerations for Prompt Templates](https://help.salesforce.com/s/articleView?id=ai.prompt_builder_considerations_changeset.htm&language=en_US&type=5) |
| CLI metadata type | GenAiPromptTemplate:TemplateName | [Salesforce CLI Considerations for Prompt Templates](https://help.salesforce.com/s/articleView?language=en_US&id=ai.prompt_builder_considerations_cli.htm&type=5) |
| Deleting templates | Not by change set or CLI; CLI can delete versions | [Salesforce CLI Considerations for Prompt Templates](https://help.salesforce.com/s/articleView?language=en_US&id=ai.prompt_builder_considerations_cli.htm&type=5) |

## Check yourself

- Why must a template-triggered flow use manual inputs?
- In a change set deployment, when does a template arrive active in the target org?
- Which metadata type does the CLI deploy for one prompt template?
- Why can't a redeployment fix a typo in version 2 if version 2 was ever active?

## Sources

- [Change Set Considerations for Prompt Templates](https://help.salesforce.com/s/articleView?id=ai.prompt_builder_considerations_changeset.htm&language=en_US&type=5)
- [Deployment Considerations for Prompt Templates](https://help.salesforce.com/s/articleView?id=ai.prompt_builder_considerations_deployment.htm&language=en_US&type=5)
- [Salesforce CLI Considerations for Prompt Templates](https://help.salesforce.com/s/articleView?language=en_US&id=ai.prompt_builder_considerations_cli.htm&type=5)
- [Packaging Considerations for Prompt Templates](https://help.salesforce.com/s/articleView?id=ai.prompt_builder_considerations_packaging.htm&language=en_US&type=5)
- [Activate and Deactivate Prompt Templates](https://help.salesforce.com/s/articleView?id=ai.prompt_builder_activate_deactivate_templates.htm&language=en_US&type=5)
- [Use Multiple Versions of a Prompt Template](https://help.salesforce.com/s/articleView?id=ai.prompt_builder_use_multiple_versions.htm&language=en_US&type=5)
- [GenAiPromptTemplate](https://developer.salesforce.com/docs/atlas.en-us.api_meta.meta/api_meta/meta_genaiprompttemplate.htm)

## About the full unit

The "Core concepts", "Exam traps" and "Worked scenario" sections of this unit, its 8 linked practice questions, and unlimited timed mock exams are included with the Agentforce Specialist pack (USD $19): https://www.certifyforce.com/practice-exams
