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:
- Add Flow Merge Fields Without Data 360 Objects to a Sales Email Prompt Template
- Add Flow Merge Fields Without Data Cloud Objects to a Field Generation Prompt Template
To use flows with Data 360 objects in Prompt Builder, see:
- Add Flow Merge Fields with Data 360 Objects to a Sales Email Prompt Template
- Add Flow Merge Fields with Data 360 Objects to a Field Generation Prompt Template
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.

