Learn three options for declaratively scheduling automation in Salesforce.
Now we’re switching gears to dive into scheduled automation, starting with scheduling declarative automation.
When Should I Use Scheduled Automation in Salesforce?
Over the past few weeks, we’ve established that you should only use real-time automation when absolutely necessary. Whenever it’s possible, you should schedule your automation.
There are many reasons to use scheduled automation over real-time automation. But primarily, scheduling your automation is a surefire way to avoid hitting user-facing errors. Here are three options for scheduling your automation declaratively.
With a steady stream of new features and improvements, flows are fast becoming the principle place to configure automation in Salesforce. Scheduled flows, a feature introduced in the Winter ’20 release, is one that we particularly love.
You can schedule your flow by selecting filter conditions from the Start element. There is a limit on the number of scheduled flow executions that can happen in a 24-hour period in any org. Check the debug logs, which will tell you the number of records the flow runs on, to make sure your flow will not exceed the limit. For more on limits and a full description of scheduled flows, go here.
Use a scheduled flow when you need to perform a scheduled action that you can’t do in process builder, such as when you’re doing a query, doing updates in loops, need a screen flow for the user to interact with, and more.
While this is a great feature, it’s important to note a couple of major limitations to scheduled flows. You can only schedule the flow to run once per day, and you are unable to control the number of records that are processed per batch. These two limitations mean that your scheduled flow may still cause volume and limit errors. A litmus test for this is if you hit volume errors on mass edits or imports to an object (for example, in data loader) your flow will likely have issues doing an import to that object, too.
Due to these limitations, there is still some automation that will need to happen via scheduled process builders instead of scheduled flows.
Schedule Process Builders via Mass Action Scheduler
Mass Action Scheduler is a community tool that allows you to declaratively schedule process builders and more. This is a good approach to scheduling functions with process builder that either can’t or shouldn’t be run in real time. Unlike with scheduled flows, Mass Action Scheduler will allow you to control your batch size, which can be critical for preventing errors (check out the documentation for a how-to). It’s also much easier to create filters in process builder than in flows.
In addition to controlling for batch size, there are a few other use cases that require a tool like this to schedule process builders. Since process builder can only be triggered by the creation of a record or a record change, there are some actions that it cannot perform in real time and therefore must be scheduled. For example, triggering an action on a date relative to a date field, such as sending a renewal email alert 60 days before the Contract End Date on an Opportunity. Another example is triggering an action based on reaching a certain value in a formula field, such as an account score. Since a change in the formula is not considered a record changing event, this action must be scheduled.
Declarative Lookup Rollup Summaries (DLRS)
We’re big fans of this tool, which allows you to build complicated rollup fields quickly and easily without code. It also lets you schedule them. DLRS allows you to summarize information on a parent record from associated child records at the click of a button. For example, you could create a “Last SDR Activity Date” on your lead or contact, calculate product commission, or count the number of products in a work order.
While this tool can run in real time, doing so can (you guessed it!) cause performance issues. So unless you need your rollup to happen in real time, go ahead and schedule it to roll up every hour, day, or week.