Once a sales team starts using AI in Salesforce, a pattern appears. A few people get excellent answers because they know exactly what to ask and how to phrase it. Everyone else types something short, gets something generic, and gives up. Salesforce prompt templates close that gap: the good question is written once, by someone who knows the job, and every rep runs it with one click.
Below: how prompt templates work in AI Engine, how to give them your playbook and live CRM data, how to write them, and four example templates.
What a prompt template is
A prompt template is a saved prompt that appears as an entry in the ◈ Actions menu of the Sales Agent. Users click it instead of typing the same request every day, and the result appears in the chat like any other answer.
Each template has a label users see, an Action Key that identifies it, the prompt itself, and a scope:
| Record | Global | |
|---|---|---|
| Where it appears | Actions menu on record pages | Actions menu when the Sales Agent is opened without a record, for example in the utility bar or on an app page |
| What it works on | The current record, through {context} |
Your playbook and data sources, no record data |
| Typical use | Account review, deal risk check, follow-up email | Daily brief, pipeline review, overdue tasks |
A simple rule from the Help Center: if the template answers "what about this record?", use Record. If it answers "what about me or my team?", use Global.
An admin with the AI_Engine_Admin permission set creates templates in Ai Agent Admin Setup → Prompt Templates. It is configuration, not development. (Salesforce has its own prompt tool, Prompt Builder; this article covers the templates in AI Engine.)
Build your company playbook into every template
The playbook is the company context you write once in the Org Profile: company description, lead process, email guidelines, qualification questions and compliance guardrails. It makes answers sound like your company.
In your own templates, the playbook is included only where you write the {playbook} placeholder. Leave it out and the template runs without your company context, including the guardrails. For most sales templates, {playbook} belongs at the top. See Write the playbook for what each section is for.
Add real CRM data with data sources
The AI has no access to Salesforce of its own. It sees only what AI Engine puts into the prompt. On a Record template, {context} brings in the fields enabled in Agent Objects and related records from Child Objects. For anything else, and for every Global template, you add data sources.
A data source is a saved query that runs each time a user clicks the template. You describe the data in plain language, click ✨ Generate to get the query, check it with ▶ Preview, and insert it into the prompt as {data:name}. The points that matter:
- Up to 5 data sources per template, each with a row limit of 1 to 200 (default 50).
- One template for every user. The bind
:currentUserIdmeans "the user who clicks", and:recordIdmeans "this record". Each rep who runs "my pipeline" sees their own pipeline. - Relative dates. Use
TODAYorLAST_N_DAYS:30so the template does not go out of date. - The user's own access. Queries run with the permissions of the user who clicks, not the admin who wrote them. Sharing rules, field-level security and PII masking apply.
- Totals in the query. Use
COUNT()orSUM()for headline numbers rather than asking the AI to add up rows.
Full details and limits are in Add data sources to a prompt template.
How to write good AI prompts for sales teams
The content that makes a template useful comes from the person who makes that judgement today. Before writing anything, ask an experienced rep: what do you check first on this account, and what tells you a deal is in trouble? Their answers are the core of the template.
Then give the prompt a clear shape:
- Role and purpose. "You are preparing an account manager for a renewal call."
- The data, under clear headings:
{context},{data:name},{playbook}. - One task, stated specifically.
- Constraints, such as "do not offer discounts or promise delivery dates".
- Format, with limits per section: "up to three risks", "two sentences".
One template, one job. Say what to do when a section has no data, or the AI may guess. Write in the language your team works in. If answers stop mid-sentence, check Max Output Tokens in the Org Profile: templates use that value or 3,500 tokens, whichever is higher. More in Write effective prompts.
Four example templates you could build
These are examples of what an admin can set up, not built-in actions. Each uses only what templates can do.
1. Renewal call brief (Record, Account). {playbook}, the account through {context}, and a data source with the account's open cases filtered by :recordId. Output: account health in two sentences, up to three risks with evidence, three questions for the call.
2. Qualify this lead (Record, Lead). {playbook} brings in your Lead Process and Qualification Questions. The prompt asks which questions the record already answers, which are still open, and what to ask in the next call.
3. My weekly pipeline (Global). A data source grouping the user's open opportunities by stage with SUM(Amount) and OwnerId = :currentUserId, plus a second source listing opportunities past their close date. Output: a short brief and the three deals that need attention first.
4. My overdue tasks (Global). A data source of the user's open tasks with an activity date before TODAY. Output: the tasks grouped by account, with a suggested order to work through them.
Test each one on a record with plenty of data and on one with very little, and run it as an ordinary user, not only as an admin.
Where the ideas come from
After go-live, ask reps which questions they type into the chat again and again. The Activity Monitor shows usage by feature and user, not the questions themselves, so you have to ask. Each repeated question is a candidate for a template. See also asking Salesforce questions in plain English.
Summary
- Prompt templates turn a team's best questions into one-click entries in the ◈ Actions menu.
- Record templates work on the current record; Global templates work without one.
{playbook}adds your company context and guardrails, but only where you write it.- Data sources add live CRM data that runs with each user's own permissions.
- Good templates come from experienced reps, do one job, and state their format and limits.
Want to turn your team's best questions into one-click actions? AI Engine installs from a managed package and runs with your own AI provider.
See AI Engine on your own data
Native Salesforce package. Your own OpenAI, Claude or Azure key. 5-day free trial, no credit card.
Book a 30-min demo