Boost Efficiency With Salesforce Prompt Builder: A Practical Guide to Prompt Templates
Salesforce Prompt Builder turns the emails, summaries and descriptions your team writes every day into reusable AI prompt templates, grounded in your CRM data. This guide covers what it does, the template types, how grounding works, where users run templates, what it costs, and how to roll it out without creating new problems.
Key Takeaways
- Salesforce Prompt Builder is the Setup tool for building reusable generative AI prompt templates that pull live CRM data into each prompt and send it to a large language model (LLM) through the Einstein Trust Layer.
- It is not In-App Guidance. Pop-up tips and walkthroughs for user adoption are a separate Salesforce feature.
- Pick a template type (Sales Email, Field Generation, Record Summary or Flex), ground it with merge fields, Flow or Apex, test it, then activate it.
- Users run templates from Email Composer, an Einstein button on a field, Flow, Apex, the REST API and Agentforce actions.
- The time savings come from high-volume, repetitive writing tasks with clean data behind them. Start with one and measure it.
Salesforce Prompt Builder is a generative AI tool in Salesforce Setup for creating reusable prompt templates. Each template fills itself with data from the record a user is working on and sends the resulting prompt to an LLM through the Einstein Trust Layer. The output is a drafted email, a record summary or a generated field value, ready to review. It became available in the Spring '24 release.
We first published this article in June 2024. That version described in-app tips and walkthroughs, which belong to a different Salesforce feature, In-App Guidance. We have rewritten it from the ground up to cover what Prompt Builder actually does, with sources from Salesforce documentation throughout. It is written for Salesforce admins, and for sales, service and operations leaders at growing and mid-market companies who want generative AI to save real time, not just appear in a demo.
What Is Salesforce Prompt Builder and How Does It Work?
Prompt Builder lets an admin write a prompt once, as a template with placeholders, and reuse it for every record. When a user runs the template, Salesforce fills the placeholders with that record's data. This step is called grounding. The finished prompt passes through the Einstein Trust Layer to the LLM, and the user gets a response to review and use.
A plain prompt such as "write a follow-up email" produces a generic answer. A grounded prompt names the contact, their company, the open opportunity and the product they asked about, so the answer is specific enough to send. Salesforce's Prompt Builder Basics module sums it up: specific prompts are effective prompts, and getting specific means adding business data to every prompt, for every customer, securely.

Every template follows the same life cycle:
- 1
Choose a template type. The type decides which objects the template can read and where users can run it.
- 2
Write the instructions. Set the role, the goal, the tone and the limits, such as "no more than 70 words".
- 3
Ground it. Insert merge fields, related lists, a Flow or an Apex class so each run uses live data.
- 4
Preview and refine. The workspace previews a real response using an actual record before anyone else sees it.
- 5
Activate. Only an active template appears for users and in Flow, Apex and agent actions.
Is Prompt Builder the Same as In-App Guidance?
No. They share the word "prompt" and nothing else. Prompt Builder writes prompts for an AI model to answer. In-App Guidance shows prompts to people: pop-up tips, docked panels and step-by-step walkthroughs that help users learn Salesforce. If your goal is user adoption and onboarding, you want In-App Guidance. If your goal is AI-generated content, you want Prompt Builder.
| Prompt Builder | In-App Guidance | |
|---|---|---|
| What a "prompt" is | Instructions sent to an LLM | A message shown on screen to a user |
| Output | Generated emails, summaries and field values | Tips, announcements and walkthroughs |
| Uses CRM data | Yes, through merge fields, Flow and Apex | No, the content is written in advance |
| Main goal | Less time spent writing and reading | Faster user adoption and training |
| Licensing | Needs a generative AI entitlement (see Section 08) | Standard Lightning Experience feature |
| Find it in Setup | Prompt Builder | In-App Guidance |
The two work well together. Many teams use an In-App Guidance prompt to tell users about a new Einstein button on the Case page, and Prompt Builder to power the button itself.
Which Prompt Template Types Does Prompt Builder Offer?
Salesforce documents four main prompt template types: Sales Email, Field Generation, Record Summary and Flex. The type you pick decides which objects the template can read and where users can run it, so choose it before you write a word. Flex is the catch-all for any business purpose the other three don't cover.
| Template type | What it generates | Inputs | Where users run it |
|---|---|---|---|
| Sales Email | Personalised emails to customers and prospects | A contact or lead, plus one other object if needed | Email Composer |
| Field Generation | Text written into a field on a record, such as a case summary or product description | One object of your choice | An Einstein button on the record page |
| Record Summary | A rich-text summary of a record | One object of your choice | Agent and assistant actions |
| Flex | Anything else: comparisons, JSON for a component, change summaries, social posts | Up to five objects or free-text inputs | Flow, Apex, the REST API, Agentforce actions |
Sources: Get to Know Prompt Builder and Salesforce's developer guide to grounding prompt templates. The Metadata API reference also lists a case email draft type for service replies. Salesforce has added types over time, so check the New Prompt Template list in your own org.
Use a specific type when the job matches it exactly: an email from Email Composer, a single field on a record page, or a record summary. You get the built-in entry point and less setup.
Use Flex when the output goes into automation, combines several objects, or feeds a custom component or an agent. Flex is the only type that Salesforce's hosted MCP servers can expose to external AI clients.
How Do You Ground Prompt Templates in Salesforce Data?
Grounding adds your own data to the prompt at run time, so the LLM answers about your customer rather than guessing. Prompt Builder offers four grounding methods, from no-code to pro-code. Use the simplest one that gets the right data: merge fields for fields on the record, Flow for related records and logic, Apex for queries, external APIs and strict formatting.
Merge Fields
No codeBest for: Fields on the input record and the sender, such as name, title, company and city.
Pick fields from the Resources list in the workspace. A Sales Email template, for example, can reference the Sender, the Recipient and the current organization. Merge fields turn a one-off prompt into a template that works for any sender and any recipient.
Related Lists
No codeBest for: Child records such as a contact's open cases or an account's opportunities.
Related list resources pull a set of child records into the prompt without any automation. They are the quickest way to give a summary template the history it needs.
Flow
Low codeBest for: Filtered, looped or conditional data, and data from Data 360.
Build a Template-Triggered Prompt Flow that matches the template type. It runs only when the template runs. Use Get Records, Decision and Loop elements, then send text into the prompt with the Add Prompt Instructions element. Salesforce's field generation unit walks through a flow that gathers every case comment and handles cases that have none.
Apex
Pro codeBest for: Complex SOQL, callouts to external APIs, programmatic filtering and well-formatted JSON.
Write an invocable method tagged with the capability type of the template, which takes the template's inputs and returns the text to insert. Once deployed, the class appears as a resource in the workspace. See Create and Ground Prompt Templates.
Grounding can reach beyond the CRM. Salesforce's Prompt Builder product page describes grounding with unstructured data from Data 360 (formerly Data Cloud), with external data through MuleSoft, and with retrieval-augmented generation (RAG). Grounding quality caps output quality: a template that reads a stale or duplicated record writes a confident, wrong email. That is why our data and knowledge grounding work starts with a retrieval test before anything is built.
Where Can Users Run a Prompt Template?
Every saved and activated template becomes an action that can run in many places. Users can trigger it on screen with one click, or automation can run it with no click at all. Salesforce's Prompt Builder developer guide lists the programmatic options.
Email Composer
Sales Email templates appear as drafting options when a rep emails a contact, lead or person account.
Einstein Button on a Field
Field Generation templates attach to writable text fields in Lightning App Builder. The page must use Dynamic Forms.
Flow
Call any active template from the Actions element, in screen flows or record-triggered flows, and save the output to a field.
Apex and LWC
Connect in Apex runs a template from code, with options such as the number of responses and temperature, and returns safety scores.
External Apps via API
The Connect REST API's Prompt Template Generations resource lets outside systems run a template and receive the response.
Agentforce Actions
Templates become agent actions that summarise records or generate descriptions and field values during a conversation.
There is one newer entry point. Flex templates can be published as MCP prompts on Salesforce's hosted MCP servers, so users can start an approved, data-filled prompt from an AI client such as Claude or Cursor. Salesforce notes that ChatGPT does not support MCP prompts, and that each run uses credits, just as it does in Salesforce.
Which Prompt Builder Use Cases Save the Most Time?
The best use cases are writing or reading tasks your team repeats many times a week, where the facts already sit in Salesforce. Prompt Builder saves the most time on the first draft and on reading long record histories, not on decisions. Each example below comes from Salesforce's own documentation, so you can see how it is built.
| Team | Task today | Prompt Builder pattern |
|---|---|---|
| Sales | Writing event invitations and follow-ups one by one | Sales Email template grounded in the sender, the recipient and an Apex lookup of the nearest event |
| Service | Reading every comment before picking up a case | Field Generation template plus a flow that collects case comments into a Case Summary field |
| Account management | Checking field history to see what changed on an account | Flex template that compares old and new values in a record-triggered flow and stores a plain-language change summary |
| Marketing | Writing listing or product copy for each record | Flex template that returns structured JSON from a custom object for a Lightning web component |
| Field reps | Preparing for a customer meeting | Flex template that pulls open opportunities, recent activity and cases into a short briefing |
| Regulated teams | Making sure outreach starts from approved wording | Legally reviewed Flex templates shared as the only starting point for AI-assisted messages |
Sources: sales email unit, field generation unit, record-change summary example, Flex with Apex example and the MCP prompts guide.
To size the benefit honestly, count how often the task happens and time it today, before you build anything. A template that saves three minutes on a task done 400 times a week is worth more than a clever one used twice a month.
Is Prompt Builder Secure for Customer Data?
Every Prompt Builder request passes through the Einstein Trust Layer. It masks sensitive data before the prompt leaves Salesforce and encrypts it in transit. Under Salesforce's zero data retention agreements, the model provider does not store your prompts or responses or use them for training. Generated output is also checked for toxicity before it reaches the user.
The Template Fills In Data the User Can See
Merge fields, flows and Apex run in the user's context. If the template asks for a field the user can't access, it comes back empty or the call fails.
Masking, Encryption and Zero Retention
Personal and sensitive values are replaced with tokens. The prompt is encrypted in transit, and the model provider keeps nothing.
Toxicity Scoring and Human Review
Responses carry safety scores from a toxicity detection model. A person reviews the draft before it is sent or saved.
Read Salesforce's Einstein Trust Layer documentation and its trusted AI overview for the full detail. The platform supplies the guardrails. Your team still decides who may build and run templates, which fields a template may read, and whether output is saved automatically or only after review. Our Agentforce governance and security services cover these decisions.
What Do You Need to Use Prompt Builder?
You need a generative AI entitlement, generative AI turned on in Setup, and the right permissions. Salesforce Trailhead states that creating a Sales Email template needs the Einstein for Sales, Einstein for Platform or Einstein for Service add-on. Some editions and AI bundles include it. Each run also consumes AI credits.
Not sure what your org already has? Our Agentforce readiness assessment reviews entitlements, data and security in two to four weeks and ends with a costed shortlist of use cases.
What Is New in Prompt Builder in 2026?
At Dreamforce 2026, Salesforce added branching logic, dependency tracking and batch testing to Prompt Builder. Together they make templates easier to manage once you have more than a handful. Combined with Metadata API support and structured output settings, Prompt Builder can now be run like any other part of your Salesforce release process.
| Capability | What it does | Status |
|---|---|---|
| Conditional expressions | Branching logic inside a template, so one template handles several situations | Beta |
| Reference visibility | Shows every flow and action that uses a template before you change it | GA |
| Batch prompt testing | Runs a template against many real inputs in one pass | Beta |
| Batch processing | Generates large numbers of responses asynchronously from Flow or Apex | Documented |
| Metadata API | Moves templates and their activation between sandbox and production as GenAiPromptTemplate metadata | Documented |
| Structured output | Template versions can set a response format (HTML, JSON or Markdown), an output schema and citations | Documented |
Sources: Salesforce's Dreamforce 2026 announcements, the developer guide and the GenAiPromptTemplate reference. Beta features change, so check their status in your org before you depend on them. For the wider picture, see our guide to AI tools in Salesforce.
How Should You Roll Out Prompt Builder?
Start with one high-volume task, build one grounded template, test it on real records, and measure it before you build the next. Most disappointing rollouts fail on data or scope, not on the AI. These six steps keep the first template small enough to finish and specific enough to measure.
Avoid these common mistakes:
Prompt Builder is one part of a larger design. In our AI in Salesforce practice we work in four stages, Audit, Architect, Activate and Govern, because the data model and governance underneath decide whether generated content is worth using. The pattern is the same one we used in a published project for a US legal tech platform: a custom generative AI pipeline that turns inbound emails and attachments into Salesforce case notes and removed more than 15 hours a week of manual case-note work. That build used OpenAI GPT and AWS Textract rather than Prompt Builder, so treat it as an example of the approach, not a Prompt Builder benchmark.
The Bottom Line
Salesforce Prompt Builder is the simplest way to put generative AI into everyday Salesforce work without writing a custom integration. It works best when a clear, repeated task meets clean data and a template that is narrow enough to test.
- 1
Prompt Builder writes for an AI model. In-App Guidance writes for people. Use each for its own job.
- 2
Pick the template type first: Sales Email, Field Generation, Record Summary or Flex.
- 3
Ground with the simplest method that gets the right data, and fix that data before you build.
- 4
Check licences, permissions and credit usage before you automate anything.
- 5
Start with one high-volume task, measure it against a baseline, then expand.
Find the First Prompt Template Worth Building
On a 30-minute discovery call, a Twopir Salesforce architect will review your highest-volume writing tasks, your data and your licences, and tell you which prompt template to build first and what to fix before you do.
Schedule a Discovery CallFrequently Asked Questions
Prompt Builder is used to create reusable generative AI prompt templates that pull live Salesforce data into each prompt. Teams use them to draft sales emails, summarise cases and records, fill text fields such as product descriptions, and power Flow, Apex and Agentforce actions.
No. Prompt Builder creates prompts that an AI model answers, grounded in your CRM data. In-App Guidance creates on-screen prompts and walkthroughs that help people learn Salesforce. They are separate features in Setup, and many teams use both.
Salesforce documents four main types: Sales Email for Email Composer, Field Generation for a field on a record page, Record Summary for agent and assistant actions, and Flex for anything else, with up to five inputs. The Metadata API also lists a case email draft type for service replies.
No. Admins can build and ground templates with merge fields, related lists and Template-Triggered Prompt Flows without code. Developers can add Apex for complex queries, external APIs or JSON output, and run templates from Apex or the REST API.
It depends on your edition and add-ons. Salesforce Trailhead states that Sales Email templates need the Einstein for Sales, Einstein for Platform or Einstein for Service add-on, and each run consumes credits. Confirm your entitlement with your account executive, especially after the September 2026 edition changes.
Prompts pass through the Einstein Trust Layer, which masks sensitive data, encrypts it in transit and applies zero data retention, so model providers don't store or train on it. Responses are scored for toxicity. Templates also respect each user's record and field access.
Deploy them as GenAiPromptTemplate metadata, with GenAiPromptTemplateActv for activation, using the Metadata API or your usual deployment tooling. Published template versions can't be edited, so make changes as a new version and deploy it the same way.
Twopir Consulting
Twopir Consulting helps growing and mid-market companies solve complex CRM, integration, and business system challenges. We implement, rescue, optimize, and integrate complex CRM and revenue systems, including generative AI, Agentforce and Data 360 on Salesforce, for 500+ clients over 12+ years.