4.3 Prompt Template Types: Field Generation, Flex & More

Key Takeaways

  • A Field Generation template is tied to one object and one field and runs from a generative AI-enabled field on a Dynamic Forms Lightning record page.
  • Field generation works on writable text, text area, text area (long), and text area (rich) fields, but not read-only fields or rich text areas on knowledge objects.
  • A Flex template covers use cases other types don't, with custom resources such as objects, free text, and files, and runs from flows, Apex, REST, or agent actions.
  • Flex templates don't support Save as a New Template, and Prompt Builder documents metadata import and export limitations for flex-related artifacts.
  • Other types include Sales Email, Record Summary (used by Summarize Record), Knowledge Answers, Case Summary, and Work Summary.
Last updated: September 2026

4.3 Prompt Template Types: Field Generation, Flex & More

Quick Answer: The template type decides where a template can run and what inputs it gets. Field Generation templates are bound to one object and one field. Users click a button on a Dynamic Forms Lightning record page, review the draft, and click Use. Flex templates are for any use case the other types don't cover. You define custom resources (for example up to five inputs such as objects, free text, or files) and call the template from flows, Apex, the REST API, or agent actions.

Common Template Types

TypeWhat it createsWhere it runs
Field GenerationContent for a specific record field (summaries, descriptions)Generative AI-enabled field on a Lightning record page
FlexContent for any business purpose, with resources you defineFlow, Apex, Connect REST API, agent actions, custom UI
Sales EmailPersonalized customer email from record dataLightning Experience email composer (Einstein Sales Emails)
Record SummarySummarized record dataSummarize Record invocable and agent action
Knowledge AnswersHow agents answer questions from knowledgeAnswer Questions with Knowledge agent action
Case Summary / Work SummarySummary, Issue, and Resolution for cases, voice calls, or messaging sessionsCase and wrap-up components
Record Prioritization, Record Research, and othersSpecialized outputs for specific standard actionsTheir related features

For the exam, focus on the objective's two named types: field generation and flex.

Field Generation Templates

How they're created

  1. Setup → Prompt BuilderNew Prompt Template → type Field Generation.
  2. Name the template and select the Object (for example Account).
  3. Select the Object Field that Einstein will populate (for example Account_Health_Summary__c).
  4. Write and ground the prompt in the Prompt Template Workspace, then preview it against a record.
  5. Activate the template.

How users get them

  • In Lightning App Builder, open the record page and use Dynamic Forms (Field Section components, or upgrade the Record Detail component).
  • Select the field and assign the template in the Einstein Generative AI section of the field properties.
  • Save and activate the page.

Considerations

ConsiderationDetail
Supported fieldsWritable text, text area, text area (long), and text area (rich) fields; not read-only fields
Dynamic FormsRequired. It supports most, but not all, LWC-enabled standard objects
MobileUsers need Dynamic Forms on Mobile enabled to use generative fields in the Salesforce mobile app
Knowledge rich textYou can't use Field Generation templates for rich text areas on knowledge entities (__kav). Use Flex, Flow, or Apex
User permissionPrompt Template User to run the template
Human in the loopThe draft appears in the Einstein panel. The user clicks Use, can ask Einstein to rewrite it (for example "make it shorter"), then saves the record
One field per templateThe template is bound to its selected object and field

Flex Templates

How they're created

  1. Setup → Prompt BuilderNew Prompt Template → type Flex.
  2. Name the template and optionally add a description.
  3. Define resources: click Add to create up to five resources, give each a unique name and API name, and mark it required if needed. Resources can be objects (for example Case as "Customer Case"), free text inputs, files, and other supported inputs.
  4. Write the prompt and use Insert Resource to replace placeholders with merge fields.
  5. In Preview Settings, choose values for each resource, then Save & Preview.
  6. Activate the template.

How flex templates run

Flex templates have no single built-in UI location, so you call them where the use case lives:

  • Flow: run the template as an action and write the output to a field or pass it downstream. Unlike field generation, no human reviews the output before it populates the field unless you design a review step.
  • Apex / invocable action / Connect REST API: developers call the template programmatically.
  • Agent action: create a custom agent action with Prompt Template as the reference type.
  • Prompt template action: call it from another template.

Flex considerations

ConsiderationDetail
FlexibilitySupports use cases that combine multiple objects, such as a newsletter from Product, Campaign, and Event records
Save as a New TemplateNot supported for flex templates (Save as a New Version still works)
Metadata limitationsPrompt Builder limitations list flex templates as not supporting import or export of flex-related metadata, including Apex classes and flows that reference them and change sets that move flex-related artifacts, so plan deployment carefully
DeletingRemove flows and Apex resources from all versions, delete the flows and Apex classes that reference the template, then delete the template
KnowledgeArticleVersionSupported as a resource only in Flex templates
PermissionsBuilders need Prompt Template Manager; runners (users or agent users) need Prompt Template User
Loading diagram...
Choosing between Field Generation and Flex

Scenario Practice

ScenarioBest type
Account managers want a "Relationship Health" summary field they can regenerate and edit before savingField Generation
When an order ships, automatically write a friendly status message into a custom fieldFlex template from a flow
An agent must generate a formatted quote explanation from Quote and Product records plus a free-text customer questionFlex template used as an agent action
Customize how an Agentforce agent answers from knowledge, including citation behaviorKnowledge Answers
Reps draft personalized prospecting emails in the email composerSales Email
Populate a rich text area on a Knowledge articleFlex template (or Flow/Apex), because Field Generation doesn't support __kav rich text areas

Exam Traps

  • Field Generation needs Dynamic Forms. No Dynamic Forms, no generative field.
  • Read-only fields can't host field generation.
  • Flex output from a flow can skip human review. Choose Field Generation when review is required.
  • Don't assume change sets move flex-related artifacts. Check Prompt Builder's documented limitations.
Test Your Knowledge

An admin wants reps to generate a draft Account summary in a text area field, review it, and click Use before saving. Which template type and setup is required?

A
B
C
D
Test Your Knowledge

Which field can't host a Field Generation prompt template?

A
B
C
D
Test Your Knowledge

A marketing team needs a newsletter generated from a Product record, a Campaign record, and a free-text theme entered by a user, invoked from a flow. Which template type fits?

A
B
C
D
Test Your Knowledge

A builder tries to use Save As on a flex prompt template to create a separate independent template, but the option isn't supported. What is still available?

A
B
C
D