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.
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
| Type | What it creates | Where it runs |
|---|---|---|
| Field Generation | Content for a specific record field (summaries, descriptions) | Generative AI-enabled field on a Lightning record page |
| Flex | Content for any business purpose, with resources you define | Flow, Apex, Connect REST API, agent actions, custom UI |
| Sales Email | Personalized customer email from record data | Lightning Experience email composer (Einstein Sales Emails) |
| Record Summary | Summarized record data | Summarize Record invocable and agent action |
| Knowledge Answers | How agents answer questions from knowledge | Answer Questions with Knowledge agent action |
| Case Summary / Work Summary | Summary, Issue, and Resolution for cases, voice calls, or messaging sessions | Case and wrap-up components |
| Record Prioritization, Record Research, and others | Specialized outputs for specific standard actions | Their related features |
For the exam, focus on the objective's two named types: field generation and flex.
Field Generation Templates
How they're created
- Setup → Prompt Builder → New Prompt Template → type Field Generation.
- Name the template and select the Object (for example Account).
- Select the Object Field that Einstein will populate (for example
Account_Health_Summary__c). - Write and ground the prompt in the Prompt Template Workspace, then preview it against a record.
- 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
| Consideration | Detail |
|---|---|
| Supported fields | Writable text, text area, text area (long), and text area (rich) fields; not read-only fields |
| Dynamic Forms | Required. It supports most, but not all, LWC-enabled standard objects |
| Mobile | Users need Dynamic Forms on Mobile enabled to use generative fields in the Salesforce mobile app |
| Knowledge rich text | You can't use Field Generation templates for rich text areas on knowledge entities (__kav). Use Flex, Flow, or Apex |
| User permission | Prompt Template User to run the template |
| Human in the loop | The 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 template | The template is bound to its selected object and field |
Flex Templates
How they're created
- Setup → Prompt Builder → New Prompt Template → type Flex.
- Name the template and optionally add a description.
- 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.
- Write the prompt and use Insert Resource to replace placeholders with merge fields.
- In Preview Settings, choose values for each resource, then Save & Preview.
- 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
| Consideration | Detail |
|---|---|
| Flexibility | Supports use cases that combine multiple objects, such as a newsletter from Product, Campaign, and Event records |
| Save as a New Template | Not supported for flex templates (Save as a New Version still works) |
| Metadata limitations | Prompt 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 |
| Deleting | Remove flows and Apex resources from all versions, delete the flows and Apex classes that reference the template, then delete the template |
| KnowledgeArticleVersion | Supported as a resource only in Flex templates |
| Permissions | Builders need Prompt Template Manager; runners (users or agent users) need Prompt Template User |
Scenario Practice
| Scenario | Best type |
|---|---|
| Account managers want a "Relationship Health" summary field they can regenerate and edit before saving | Field Generation |
| When an order ships, automatically write a friendly status message into a custom field | Flex template from a flow |
| An agent must generate a formatted quote explanation from Quote and Product records plus a free-text customer question | Flex template used as an agent action |
| Customize how an Agentforce agent answers from knowledge, including citation behavior | Knowledge Answers |
| Reps draft personalized prospecting emails in the email composer | Sales Email |
| Populate a rich text area on a Knowledge article | Flex 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.
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?
Which field can't host a Field Generation prompt template?
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 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?