Let us continue with my Salesforce Flow, ‘Getting Started’, series. We discussed how different types of Flows enable you to minimize code usage. Until the Winter’20 release, Scheduling Autolaunched Flows was out-of-scope. No more!
As we all know, before the Winter’20 release, autolaunched Flows could only be launched using Process Builder or Apex. But, that was before! Let us open our present, shall we?
What are Scheduled flows?
Before we unwrap, let us understand what Scheduled Flows are. Scheduled Flows are not triggered by an Event on the data; they simply run when a scheduled time arrives.
Scheduled Flows run as follows:
- Once (On a particular date and time)
- Daily (On a particular date and time)
- Weekly (On a particular date and time)
The best part about Scheduled Flows is that it allows you to specify an Object and a filter to only run for a set of records.
Remember, when a Flow starts, a Flow interview runs for each record that matches the filter criteria – no looping is required. The matching record is stored in the $Record global variable, so you can reference the variable, or its fields, throughout your flow.
Why do we need Scheduled flows?
Do you have Flows that are launched from Process Builder every time a record is created or edited – even though you need them to run only once a day or once a week (like Scheduled Apex provides)? If you had such requirements before winter’20 release, you would have to write Apex code. Or, you would have messed-up your Salesforce org with many unwanted Processes or Flows.
Scheduled Flows provide you the flexibility to run auto-launched Flows on scheduled time (Like daily, weekly or once). Yes, now you have one more way to solve your business needs using clicks not code! Read the rest of this entry!