Sub topic 9
Schedule-Triggered Flows: Automation on a Timer
A schedule-triggered flow starts on its own at a set time and frequency. It needs no user action, no record change, and no caller. This chapter covers what the flow type is, how it runs, and the errors people hit most often. The next chapters cover the schedule settings and record selection in detail.
You should already know the Salesforce data model (objects, fields, records), where to find Flow Builder in Setup, and the basics of declarative automation. Apex is not required here.
What it is
A schedule-triggered flow is a flow whose Start element is set to Schedule. Salesforce runs it at the time you choose. Typical uses are nightly cleanup, reminder emails, and recurring field updates.
Compare it with the other types:
| Flow type | What starts it |
|---|---|
| Screen flow | A user opens it |
| Record-triggered flow | A record is created, updated, or deleted |
| Autolaunched flow (no trigger) | A caller: another flow, Apex, or REST |
| Schedule-triggered flow | The clock |
How a run works
In the Start element you choose an object and optional filter conditions. At the scheduled time, Salesforce finds the matching records and runs the flow once for each one. Each record is available to the flow as $Record. If you do not choose an object, the flow runs once per schedule, with no record context.
The Start element is stored in the flow's metadata. This example selects Opportunities in the Prospecting stage and runs daily at 02:00 UTC:
<start>
<filterLogic>and</filterLogic>
<filters>
<field>StageName</field>
<operator>EqualTo</operator>
<value>
<stringValue>Prospecting</stringValue>
</value>
</filters>
<object>Opportunity</object>
<schedule>
<frequency>Daily</frequency>
<startDate>2025-01-01</startDate>
<startTime>02:00:00.000Z</startTime>
</schedule>
<triggerType>Scheduled</triggerType>
</start>Key properties
- No user is present. The flow runs in system context, so it cannot show screens. It also cannot ask anyone for input.
- It must be active. A saved but inactive flow never runs. Activation is covered in a later chapter.
- It runs in batches. Salesforce processes the selected records in groups, so a flow that is correct for one record must also be correct for many.
- Timing is approximate. Runs start around the scheduled time. They are queued, so a busy org may start them later.
Common errors
- Forgetting to activate. The schedule is set but nothing runs. Check that the flow version is active.
- A filter that matches nothing, or too much. Test the same conditions in a list view or report first.
- Putting Get Records, DML, or Subflow elements inside a loop. This works for a few records and then hits governor limits at scale. Collect changes in a collection and update once, after the loop.
- Assuming local time. The start time is interpreted in the time zone of the user who saved the flow, and the metadata shows it as UTC. Confirm both.
- No fault path. An unhandled error fails the run for the affected records, and the notification goes to the person who last modified the flow.
Exercise
A schedule-triggered flow selects 5,000 Cases and has an Update Records element inside a Loop. Why is this a problem, and what is the fix?
Show answer
Each loop pass runs its own DML statement, so the flow can exceed the governor limit on DML statements. The fix is to add each changed record to a collection variable inside the loop, then run one Update Records element on the collection after the loop.
Exercise
Name two ways a schedule-triggered flow differs from an autolaunched flow with no trigger.
Show answer
A schedule-triggered flow starts by itself on a timer and can select records through its Start element. An autolaunched flow has no trigger and runs only when called by a flow, Apex, or the REST API.