4.1 When to Use Prompt Builder

Key Takeaways

  • Prompt Builder builds, customizes, and manages reusable prompt templates grounded in CRM data to power generative AI features and Agentforce agents.
  • Prompt templates contain instructions plus placeholders (merge fields) that are filled with current data at run time in a step called prompt resolution.
  • Choose Prompt Builder for repeatable generation such as summaries, drafts, field content, and classification text that must be consistent at scale.
  • Deterministic business rules belong in flows, Apex, or Agent Script logic, not in a generative prompt template.
  • Prompt templates can be run from record pages, email composers, flows, Apex, the Connect REST API, and agent actions.
Last updated: September 2026

4.1 When to Use Prompt Builder

Quick Answer: Use Prompt Builder when a business requirement calls for generated language that must be consistent, reusable, and grounded in Salesforce data, such as email drafts, record summaries, field descriptions, or custom content. A prompt template packages the instructions, constraints, and data placeholders once, so every user and process gets the same quality. Don't use Prompt Builder to enforce deterministic rules or run multi-step transactions. Those belong in flows, Apex, or agent logic.

What Prompt Builder Is

Salesforce defines Prompt Builder as the tool to build, customize, and manage AI prompt templates that incorporate your CRM data to power generative AI features and Agentforce agents. Four vocabulary terms appear throughout the exam:

TermDefinition
PromptThe instructions, context, data, and constraints sent to an LLM; the output is the response
Prompt templateA reusable, use-case-driven prompt with placeholders for information that changes, such as customer names and product prices
GroundingConnecting the prompt to relevant data (record fields, flows, Apex, retrievers, files) so the response is specific and accurate
Prompt resolutionReplacing placeholders with real data at run time. The result is the resolved prompt

Salesforce's reasoning: writing one great prompt by hand is slow, designing dozens of original prompts is harder, and prompts from different people produce inconsistent output. A template gives consistent, data-driven output at scale with a unified brand voice.

Signals That Prompt Builder Is the Right Tool

Requirement signalWhy Prompt Builder fits
"Every rep should get the same style of personalized follow-up email"A Sales Email template standardizes voice and grounding
"Populate the Account Summary field with a digest of open cases"A Field Generation template adds an AI-generated field on the record page
"Summarize a record for the agent to use"A Record Summary template powers Summarize Record
"Generate a product description from Product, Campaign, and Event records inside a flow"A Flex template accepts custom inputs and runs from Flow
"Customize how the agent answers questions from knowledge"A Knowledge Answers template customizes Answer Questions with Knowledge
"Give an agent a specialized writing skill with strict formatting"A template used as a prompt template agent action
"Run the same generation across many records"Prompt template batch processing

Signals That Something Else Fits Better

RequirementBetter toolReason
"Refunds are allowed only within 30 days"Flow, Apex, or Agent Script logicBusiness rules must run deterministically, not be interpreted by an LLM
"Update the case status and create a task"Flow or Apex (optionally exposed as an agent action)Transactions need predictable execution
"Hold a multi-turn conversation that looks up orders and processes returns"An Agentforce agent with subagents and actionsAgents orchestrate turns, tools, and routing
"Show a list of the customer's open cases"Query action or reportRetrieval without generation doesn't need an LLM
"Answer questions from 5,000 policy PDFs"Agentforce Data Library + retriever, often through a templateRetrieval-augmented generation needs a search index

Prompt Builder in the Agentforce Picture

Prompt templates and agents complement each other:

  • Agents decide what to do across a conversation (routing, tools, clarifying questions).
  • Prompt templates decide how a specific piece of content is generated (instructions, grounding, format).

An agent often calls a prompt template as an action. Summarize Record uses a Record Summary template, Answer Questions with Knowledge uses a Knowledge Answers template, and you can build custom prompt template actions for tasks such as drafting a warranty explanation. Keeping the generation logic in a template makes it reusable outside the agent too, for example on a record page or in a flow.

Where Prompt Templates Run

Invocation pointTypical template typeHuman review?
Lightning record page field (Dynamic Forms)Field GenerationYes. The user reviews the draft and clicks Use
Email composerSales EmailYes. The rep edits before sending
FlowFlex (or others)Not necessarily; a flow can write output directly to a field
Apex or Connect REST APIFlex and othersDepends on your code
Agent actionFlex, Record Summary, Knowledge Answers, and othersThe agent uses the output in its reasoning or reply
Another prompt template (prompt template action)Any active templateNo. The output is inserted into the calling template

Standard Templates First

Prompt Builder includes standard prompt templates for common use cases (for example, Case Summary, Work Summary, Sales Emails, and Contextual Service Replies). You can copy a standard template to customize it, and some standard templates can be overridden with your own version that runs in their place. The Example Prompt Template Library also provides sample instructions and writing-style language you can reuse.

Decision Walkthrough

A service manager asks for three things:

  1. "When a case closes, write a customer-friendly resolution summary into a field." → Flex template run from a record-triggered flow (no human review), or a Field Generation template if an agent or rep should review it first.
  2. "Only allow goodwill credits under USD 50 without approval." → Flow logic, not a prompt.
  3. "Let customers chat about case status and request a callback." → Service agent with subagents and actions, possibly calling a template to phrase the summary.

Exam Traps

  • "Consistent generated content at scale" points to Prompt Builder. "Must always enforce a rule" points to deterministic automation.
  • Prompt templates don't hold conversations. Multi-turn tool use is an agent's job.
  • Responses vary between runs. Each run is a new LLM call, so review output and design for variability.
  • Templates must be activated before users, flows, or agents can use them (section 4.4).
Test Your Knowledge

A sales director wants every rep to generate follow-up emails with the same brand voice, grounded in the opportunity's details. Which solution best fits?

A
B
C
D
Test Your Knowledge

A requirement states that discounts above 15% must always require manager approval. Where should this rule be implemented?

A
B
C
D
Test Your Knowledge

What is prompt resolution in Prompt Builder?

A
B
C
D
Test Your Knowledge

An agent needs a reusable, strictly formatted way to explain warranty coverage that the service team also wants to use on record pages. What design is most maintainable?

A
B
C
D