Record-Triggered Flows

Record-Triggered Flows in Salesforce - A Short Guide

Auto-launched flows in record triggers make additional updates after they are saved to the triggering record or database. 

One of the many different types of Flows available in Salesforce that you can utilize to automate your business processes is the Record-Triggered Flow. 

You may be able to avoid creating triggers with record-triggered flows in some scenarios.  

You can now solve complicated business needs without writing a single line of code. 

The Record-Triggered flow can be started when: 

  • A record is created 
  • A record is updated 
  • A record is created or updated 
  • A record is deleted 

dont miss out iconDon't forget to check out: Assign Permission Set at the User Creation Made Simple: What You Need to Know | Salesforce Guide

And Run the Flow: 

  • Before the record is saved 
  • After the record is saved

You can now access a record's previous values in Salesforce Flow when an object's record is updated. 

The record's values from right before the Flow was executed are stored in the global variable "$Record_Prior." 

You can use these values to check for changes in fields and calculate differences in your flow.   

In Process Builder, this functions as an "ISCHANGED" condition, which we have previously utilized to the fullest. 

These things need to be taken into account for record-triggered flows that are designed for quick field updates (before-save):- 

  1. The flow can’t perform actions other than updating the triggering record’s field values. 
  2. Records that are connected to the triggering record cannot have their values updated by the flow. 
  3. Elements that are supported in this - Assignment, Decision, Get Records, and Loop.  
  4. An auto-launched flow with a trigger can only be activated if the user has View All Data access. 
  5. We cannot guarantee the sequence in which record-triggered flows are executed if an object has multiple active record-triggered flows that are set to run before the record is stored. 

dont miss out iconCheck out another amazing blog by Sejal here: Public Groups in Salesforce - The Complete Developer Guide

If you’re familiar with apex triggers, then you’ll understand the below context:

Similar to a before trigger is a flow that performs pre-save before-save updates.  

The record-change process is similar to an after-trigger. 

Before-save updates in flows are carried out just before Apex before triggers in a save procedure. 

We advise using before-save updates in flows to update fields on new or modified records because of their speed. 

But often, you'll need to use an Apex after trigger or a record-change procedure to: 

  • Access fields like the Last Modified Date or the ID of the new record are only set once the record is saved. 
  • Create or update related records. 
  • Perform actions other than changing the record that starts the flow. 


Popular Salesforce Blogs