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

  • Manage Prompt Templates
  • Execute Prompt Templates

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.

  1. In Flow Builder, create a Template-Triggered Prompt Flow to work with your flex template.
    1. Click New Flow, and then select the Template-Triggered Prompt Flow card.
    2. Build a flow that gets information on new products and current product service campaigns. See Build a Flow.
    3. Save the flow with the label Get Products and Campaign.
    4. Click Activate.
      Note
      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.
  2. In Prompt Builder, create a flex prompt template.
    1. Select the Flex prompt template type.
    2. Enter Generate a Newsletter for the prompt template name.
    3. Leave the Description field blank.
    4. Define a resource. Select the Product object.
    5. Add a second resource. Click Add. Select the Product Service Campaign object.
    6. Click Create.
      You're redirected to the Prompt Template Workspace.
  3. In the Example Prompt Template Library, find the flex prompt template “Generate a Newsletter.” Copy and paste this template into the Prompt Template Workspace.
  4. Save your work.
  5. In Prompt Builder, edit your Generate a Newsletter prompt template to replace the flow placeholder with the flow you activated.
    1. In the Prompt Template Workspace, delete the {!$Flow:Get_Products_and_Campaigns.Prompt} placeholder.
    2. Click the Resource search bar and select Flows.
    3. To add this flow to your template, select Get Products and Campaigns.
  6. Run the prompt template and see the LLM-generated newsletter.
    1. Click the Preview Settings button.
    2. Under Inputs, search for and select a product name in the Product search bar.
    3. Enter a product service campaign name in the Product Service Campaign search bar, and then select it.
    4. 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.
    5. Click Save & Preview. Review the response.