Salesforce Scheduled Flows
An alarm clock does not wait for someone to press a button. It rings at a set time every day. A scheduled flow works like that alarm clock. The flow starts at a chosen date and time, finds the matching records, and performs actions on each one. Admins use scheduled flows for work that must happen on a calendar rather than after a user action.
When to Use a Scheduled Flow
Record-triggered flows react to a change. Scheduled flows react to time. Good candidates include:
- Remind owners about opportunities that closed more than 30 days ago without an update.
- Close cases that stayed in Waiting for Customer status for two weeks.
- Send contract renewal reminders 60 days before the end date.
- Update a status field on records that passed an expiry date.
- Create weekly summary tasks for managers.
Parts of a Scheduled Flow
| Part | Role |
|---|---|
| Start Date and Time | The first moment the flow runs |
| Frequency | Once, Daily, or Weekly |
| Object | The object whose records the flow processes |
| Filters | Conditions that select the records |
| Flow Elements | Actions that run for each selected record |
How the Flow Processes Records
At the scheduled time, Salesforce queries the chosen object with the filters. Each matching record starts its own flow interview. An interview is one run of the flow for one record. Salesforce handles the records in batches, so large volumes do not freeze the system.
Clock reaches 7:00 AM
|
v
Salesforce queries Contracts
(End Date = 60 days from today)
|
v
+--------+--------+--------+
|Record 1|Record 2|Record 3| ... each runs the flow
+--------+--------+--------+
|
v
Create Task: Renewal reminder for each owner
Build Example: Renewal Reminder
A software company wants account owners to receive a task two months before each contract ends.
- Open Setup, go to Flows, and click New Flow.
- Select Schedule-Triggered Flow.
- Set Start Date to tomorrow and Start Time to 7:00 AM.
- Set Frequency to Daily.
- Choose the Contract object.
- Add a filter: Status equals Activated.
- Add a second filter: End Date equals a formula value of today plus 60 days.
- Add a Create Records element for a Task.
- Map Subject to Renewal reminder, WhatId to the contract Id, and OwnerId to the contract owner.
- Save and activate.
Each morning, the flow checks for contracts that end in exactly 60 days. Owners see the task on their list.
Scheduled Paths Inside Record-Triggered Flows
A record-triggered flow can include a scheduled path. The path runs a set time after the trigger, relative to a date field on the record. A scheduled path suits a single reminder, such as three days before a Close Date. A schedule-triggered flow suits bulk sweeps across many records.
Schedule-Triggered Flow Scheduled Path ---------------------- ------------------ Runs on a calendar Runs after a record event Processes many records Processes one triggering record Needs filters Uses record date fields
Running User and Permissions
A scheduled flow runs in system context. It uses the Automated Process user, which means the flow ignores the sharing rules and field permissions of any one person. Design the flow carefully because it can read and change any record that matches the filters. Test with narrow filters before widening the scope.
Limits to Remember
Salesforce caps the number of scheduled flow interviews per day for each org. Large orgs with millions of records should narrow filters so the flow touches only the records that need attention. Flows that process too much data waste capacity that other automation needs.
Best Practices
- Choose off-peak hours so users feel no slowdown.
- Filter on indexed fields such as dates and Ids to speed up the query.
- Add a fault path that writes failures to a log object or emails an admin.
- Run the flow in a sandbox against a copy of production data first.
- Document the schedule, the purpose, and the owner in the flow description.
- Deactivate old scheduled flows that no longer serve a purpose.
