Salesforce conceptsSalesforce Certified Agentforce SpecialistPrompt Builder
AI-201 prompt engineering: templates, versions, run time
What AI-201 asks about prompt templates: field generation versus flex, how versions are activated, and what happens when a template runs.
3 min read
Prompt templates are not available to users by default; you must activate them first. And once you activate a version, it can never be edited again.
01 What does AI-201 ask about prompt engineering?
You have probably met this kind of question: a template, a permission set and a version number, and you must say why users see nothing. Users get a template only once a version is active, and merge data follows the permissions of the user running it. Start with the type: field generation fills record fields, while flex covers needs other types do not.
The main objectives in this domain, and what each asks about
- Objective 1.3: template typesWhen field generation fits, and when flex with your own resources fits.
- Objective 1.4: groundingWhich merge data a template uses, and whose permissions govern it.
- Objective 1.5: create, activate, runHow versions become active, and what happens when a template runs.
Field generation fills record fields; flex covers what other types do not.
02 Field generation or flex: which fits?
A field generation template writes content into a record field when a user clicks a button. You add it to dynamic fields on pages built in Lightning App Builder.
A flex template is for business needs the other types do not cover, and you define its resources yourself. It can have up to 5 resources.
A flex template takes up to 5 resources you define.
03 How does a template go live?
So start with how versions work. When you first save a prompt, it becomes Version 1. Only one version can be active at a time, and with none active, users cannot use the template.
From a draft prompt to a live template
- Draft and saveThe first save becomes the first version
- ActivateOne active version at a time
- LockedStays immutable, even if deactivated
- EditSave it as a new version
Activating a version makes it immutable, so edits need a new version.
04 What happens when a template runs?
At run time, an agent, a flow, Apex or an app invokes the template. Access to merge data follows the permissions of the user running it. Pattern-based data masking applies automatically, but field-based masking only if enabled.
To test these details, MockCert's quiz questions are free with no account, each answer explained right away. MockCert is independent of Salesforce.
Merge data follows the running user's permissions.
Summary
- Templates must be activated before users can use them.
- Only one version is active at a time, and activated versions are immutable.
- Merge data access follows the executing user's permissions.
Sources
- Prompt Template Types | Salesforce Help (opens in a new tab)
- Activate and Deactivate Prompt Templates | Salesforce Help (opens in a new tab)
- Prompt Template Run-time Execution | Salesforce Help (opens in a new tab)
- How Users Work with a Prompt Template | Salesforce Help (opens in a new tab)
- Create a Flex Prompt Template | Salesforce Help (opens in a new tab)
- MockCert: free study guides, quizzes and mock exams