Salesforce · Prompt Builder · Generative AI

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.

Section 01 · Definition

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.

Salesforce Admins graphic titled Introducing Prompt Builder, showing the Prompt Builder workspace with a list of Account merge fields such as Account Name, Account Type and Annual Revenue
The Prompt Template Workspace: you write the instructions and insert merge fields from the Resources picker.

Every template follows the same life cycle:

  1. 1

    Choose a template type. The type decides which objects the template can read and where users can run it.

  2. 2

    Write the instructions. Set the role, the goal, the tone and the limits, such as "no more than 70 words".

  3. 3

    Ground it. Insert merge fields, related lists, a Flow or an Apex class so each run uses live data.

  4. 4

    Preview and refine. The workspace previews a real response using an actual record before anyone else sees it.

  5. 5

    Activate. Only an active template appears for users and in Flow, Apex and agent actions.

Section 02 · Clearing Up a Mix-Up

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 BuilderIn-App Guidance
What a "prompt" isInstructions sent to an LLMA message shown on screen to a user
OutputGenerated emails, summaries and field valuesTips, announcements and walkthroughs
Uses CRM dataYes, through merge fields, Flow and ApexNo, the content is written in advance
Main goalLess time spent writing and readingFaster user adoption and training
LicensingNeeds a generative AI entitlement (see Section 08)Standard Lightning Experience feature
Find it in SetupPrompt BuilderIn-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.

Section 03 · Template Types

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 typeWhat it generatesInputsWhere users run it
Sales EmailPersonalised emails to customers and prospectsA contact or lead, plus one other object if neededEmail Composer
Field GenerationText written into a field on a record, such as a case summary or product descriptionOne object of your choiceAn Einstein button on the record page
Record SummaryA rich-text summary of a recordOne object of your choiceAgent and assistant actions
FlexAnything else: comparisons, JSON for a component, change summaries, social postsUp to five objects or free-text inputsFlow, 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.

Section 04 · Grounding

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 code

Best 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 code

Best 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 code

Best 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 code

Best 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.

Section 05 · Entry Points

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.

Section 06 · Use Cases

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.

TeamTask todayPrompt Builder pattern
SalesWriting event invitations and follow-ups one by oneSales Email template grounded in the sender, the recipient and an Apex lookup of the nearest event
ServiceReading every comment before picking up a caseField Generation template plus a flow that collects case comments into a Case Summary field
Account managementChecking field history to see what changed on an accountFlex template that compares old and new values in a record-triggered flow and stores a plain-language change summary
MarketingWriting listing or product copy for each recordFlex template that returns structured JSON from a custom object for a Lightning web component
Field repsPreparing for a customer meetingFlex template that pulls open opportunities, recent activity and cases into a short briefing
Regulated teamsMaking sure outreach starts from approved wordingLegally 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.

Section 07 · Trust

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.

Step 1 · Resolve

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.

↓ through the Einstein Trust Layer ↓
Step 2 · Protect

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.

↓ response returns ↓
Step 3 · Check

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.

Section 08 · Requirements

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.

Licence. An edition or add-on that includes Prompt Builder. Salesforce restructured its editions in September 2026, so confirm with your account executive what your contract includes before you plan a rollout.
Setup. Einstein generative AI enabled, plus Einstein for Sales enabled for Sales Email templates.
Permissions. Builders need the Prompt Template Manager permission set. Users who run templates need access to the template, the record and every field it reads.
Page setup. Field Generation needs Dynamic Forms on the Lightning record page and a writable text, text area, long text area or rich text area field.
Usage costs. Each template run consumes credits, whether it starts from the UI, Flow, Apex or an MCP client. A record-triggered flow that runs a template on every update can use credits quickly.

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.

Section 09 · 2026 Updates

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.

CapabilityWhat it doesStatus
Conditional expressionsBranching logic inside a template, so one template handles several situationsBeta
Reference visibilityShows every flow and action that uses a template before you change itGA
Batch prompt testingRuns a template against many real inputs in one passBeta
Batch processingGenerates large numbers of responses asynchronously from Flow or ApexDocumented
Metadata APIMoves templates and their activation between sandbox and production as GenAiPromptTemplate metadataDocumented
Structured outputTemplate versions can set a response format (HTML, JSON or Markdown), an output schema and citationsDocumented

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.

Section 10 · Rollout

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.

1. Pick the task.
→ Choose a writing or reading task that happens often, has its facts in Salesforce, and has a clear owner. Time it today.
2. Check the data.
→ Look at the fields and related records the template will read. Fix duplicates, blanks and stale values first.
3. Write and ground.
→ Set the role, goal, tone and limits. Add merge fields first, then Flow or Apex only where you need them.
4. Test on real records.
→ Preview across easy and awkward records. Judge goal completion, tone, relevance, consistency and toxicity, as Salesforce recommends.
5. Deploy like code.
→ Build in a sandbox, move the template with the Metadata API, assign permissions, and tell users with an In-App Guidance prompt.
6. Measure, then expand.
→ Compare the time spent and the edit rate against your baseline, then pick the next task.

Avoid these common mistakes:

Hard-coded prompts. Names, dates or products typed into the instructions only work once. Use merge fields or a flow.
One template doing everything. A single Flex template for "all customer emails" is hard to test and harder to trust. Build narrow templates.
Automatic saving without review. Writing AI output straight into customer-facing fields skips the human check. Start with draft-and-review.
No ownership. Templates drift as fields, products and policies change. Give each one an owner and a review date.

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.

Section 11 · Bottom Line

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. 1

    Prompt Builder writes for an AI model. In-App Guidance writes for people. Use each for its own job.

  2. 2

    Pick the template type first: Sales Email, Field Generation, Record Summary or Flex.

  3. 3

    Ground with the simplest method that gets the right data, and fix that data before you build.

  4. 4

    Check licences, permissions and credit usage before you automate anything.

  5. 5

    Start with one high-volume task, measure it against a baseline, then expand.

Ready to Start

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 Call

FAQ

Frequently 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.

TC

Twopir Consulting

Salesforce Partner · HubSpot Partner

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.