Configuring Flows for Motion Policies
The purpose of this article is to provide direction for configuring a Flow in Salesforce for a Fullcast policy. Configuring a flow in the Salesforce environment for each policy to trigger it when needed is one of the essential steps in the execution of any motion policy.
Configure Flow for Policies
Follow the below steps to set up a flow:
- Log into the Salesforce environment, click the Settings icon (gear), and select the Setup option from the drop-down menu.
- Search “Flows” and select Flows beneath Process Automation.
- Click the New Flow button and select how you would like to build your automation: from scratch, or a template.
Note: For this article, we selected the “start from scratch” option.
- Select the “Record-Triggered Flow” option for the Type and click Create.
- Select the object whose records trigger the flow when they’re created, updated, or deleted. This is the object you select when creating a record-triggered flow. When a record of this object is created, updated, or deleted, the flow will automatically initiate. For example, if you are configuring this flow for account routing policies, you would select the Account object from the dropdown menu.
- Configure Trigger. Identify what trigger should be used to initiate the flow:
Trigger | Description |
A record is created | When the record is created, the flow will execute. |
A record is updated | When the record is updated, the flow will execute. |
A record is created or updated | When the record is created or updated, the flow will trigger. |
A record is deleted | The flow only triggers when the record is deleted. |
- Set Entry Conditions. Specify the entry conditions to reduce the number of records that trigger the flow and the number of times the flow is executed. Figure 4 is an example condition where changing the value in the custom domain field will run the flow every time a record is updated and meets the condition requirements.
Note: When creating a flow triggered by record updates, it is best practice to first define entry criteria. Then, choose the “Only when a record is updated to meet the condition requirements” option to ensure the flow runs when the updated record meets specific conditions.
The example in Figure 5 illustrates a record-triggered flow that is triggered on the account object when a record is created or updated on the custom domain field. This flow will run every time a record is updated and meets the condition requirements.
- Click the plus sign between “Run Immediately” and “End” on the process flow.
- Select Action from the dropdown menu.
- Search Actions for “Policy Handler” and select Policy Handler.
Note: All the above steps are common for configuring a flow for all policies. Only the Apex input values change for each policy. Refer below sections to check the Apex variable input values to complete the flow configuration, for the policy that you want to execute.
- Click Save.
- Provide a Flow Label, Flow API, and Description, then click Save.
Note: An API name unique for each policy is automatically generated when you name the process.