Loading
Upcoming Mandatory Changes to Public Key Infrastructure (PKI)Read More
Salesforce Enforces New Security Requirements in Summer 2026Read More
Agentforce and Einstein Generative AI
Table of Contents
Select Filters

          No results
          No results
          Here are some search tips

          Check the spelling of your keywords.
          Use more general search terms.
          Select fewer filters to broaden your search.

          Search all of Salesforce Help
          Ground with Flow Merge Fields

          Ground with Flow Merge Fields

          Flows elevate your prompt templates beyond grounding with record fields. Use Flow Builder to add complex logic to a prompt template. With flows, you can also access unified Data 360 objects. By referencing Data 360 data, you can use real-time information that was consolidated across multiple data sources.

          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

          If you’re new to flows or Data 360, check out the Flow Builder Basics and Salesforce Data 360: Quick Look Trailhead modules. To learn about data consolidation with Data 360, see Salesforce Help: Unify Source Profiles.

          You can create a flow for use with a prompt template by selecting Template-Triggered Prompt Flow in Flow Builder. A prompt template flow launches from a prompt template, and then it adds prompt instructions to the associated prompt template. Other flow types aren’t available to prompt templates.

          To reference Data 360 data, use the Get Records element. In the Get Records element, select Data Cloud Object as your data source. Next, select the relevant data space or object, and specify filters to narrow your data. After that, use Data 360 record data as you do with any record variable in the flow.

          Then, use Create Prompt Instructions elements to write the prompt instructions that the flow returns to the associated prompt template. These prompt instructions can include merge fields for CRM and Data 360 data based on the outcome of a Decision element. Each merge field returns a value as a string of text in the prompt instructions. For example, an Input.Contact.MailingCity merge field in the Create Prompt Instructions element returns “San Francisco” in the prompt instructions.

          You can add a prompt template flow to your prompt template as a merge field with the format Flow:FlowName. The flow runs each time a user uses the associated prompt template. Within the flow, each Create Prompt Instructions element adds prompt instructions. When the flow completes, all the prompt instructions are sent to the prompt template and populate the merge field as a string of text.

          To use flows in Prompt Builder, see:

          To use flows with Data 360 objects in Prompt Builder, see:

          Because you can now use flows across different template types, including Flex templates, the Flex capability is no longer needed and will be retired in Spring ’25. It’s a good idea to migrate any ​​flows that use the Flex: * type. Change the start node type to use manual inputs, then add each of the variables as inputs. Save the flow, then verify that your prompt template continues to work as expected with the flow merge fields.

          Note
          Note If you change the inputs for a flow or Apex class that's used as a resource in a prompt template, the prompt template no longer works and you can’t save new versions of the prompt template. See this known issue.
           
          Loading
          Salesforce Help | Article