Add Flow Merge Fields to a Flex Prompt Template
Build a flow that compiles information from multiple sources, and then add a flow merge field to your prompt template.
Required Editions
| Available in: Lightning Experience |
| Available in: Enterprise, Performance, and Unlimited Editions with the Einstein for Platform, or Einstein or Agentforce for Sales or Service add-on, or Agentforce Foundations |
| User Permissions Needed | |
|---|---|
| To create and manage prompt templates in Prompt Builder: | Prompt Template Manager permission set
OR Customize Application permission set |
Let’s create and preview an example flex prompt template. Say you want to generate a newsletter from Product records and Product Service Campaign records. Create a flex prompt template that integrates a flow that obtains record data for an LLM to summarize.
- In Flow Builder, create a Template-Triggered Prompt Flow to work with your flex template.
- Click New Flow, and then select the Template-Triggered Prompt Flow card.
- Build a flow that gets information on new products and current product service campaigns. See Build a Flow.
- Save the flow with the label Get Products and Campaign.
-
Click Activate.
Note Only activated flows appear in the flows list in Prompt Builder. To use a flow in Prompt Builder, its input variables must match the resources defined in the flex prompt template.
-
In Prompt Builder, create a flex prompt template.
- Select the Flex prompt template type.
- Enter Generate a Newsletter for the prompt template name.
- Leave the Description field blank.
- Define a resource. Select the Product object.
- Add a second resource. Click Add. Select the Product Service Campaign object.
- Click Create.You're redirected to the Prompt Template Workspace.
- In the Example Prompt Template Library, find the flex prompt template “Generate a Newsletter.” Copy and paste this template into the Prompt Template Workspace.
- Save your work.
-
In Prompt Builder, edit your Generate a Newsletter prompt template to replace the flow
placeholder with the flow you activated.
- In the Prompt Template Workspace, delete the {!$Flow:Get_Products_and_Campaigns.Prompt} placeholder.
- Click the Resource search bar and select Flows.
- To add this flow to your template, select Get Products and Campaigns.
-
Run the prompt template and see the LLM-generated newsletter.
- Click the Preview Settings button.
- Under Inputs, search for and select a product name in the Product search bar.
- Enter a product service campaign name in the Product Service Campaign search bar, and then select it.
- In the Configure Response and Display sections, verify that Generate Response, Display Prompt, and Display Resolution are selected or deselected based on what you want to test.
- Click Save & Preview. Review the response.
Did this article solve your issue?
Let us know so we can improve!

