Here is why flows are better than process builders, any day.
If you’re new to the Salesforce ecosystem and consider yourself a flow noob, this may be of interest to you. Also, because you’ll most likely be creating a lot of flows in the future, it’s critical that you understand what happens behind the scenes.
One would believe that Process Builder is made up of flows (Yes, PB is nothing but Flows dressed differently). So, what makes Before-save Flows unique?
Have you heard of the term “Order of Execution”?
Simply explained, anytime you do a DML (insert, update, upsert, etc.) on a record, the Order of Execution is a predetermined sequence of events.
The following is a general breakdown of the Order of Execution.
As you can see, Before-save Flows run before the record is saved to the database. And Process Builder runs after the record is saved to the database.
What goes on behind the scenes
This basically means that anytime a Process builder alters a field on the same record (on insertion or update). It is considered as a DML. As a result, the order of execution is called again, and the record is subjected to the second round of execution. Before-save Flows, on the other hand, make all field adjustments to the record before saving it to the database, therefore there is no DML.
Based on the automation setup in the org. The time consumed can dramatically rise due to the additional DML in Process Builder.
One of the most major reasons why Before-save Flows outperform Process Builder is because of this. Other causes (if any) would, I assume, be more specific to how the platform’s Before-save Flow runs in the background.
Refer this page to know more about Salesforce.