Sub topic 17
When to Use Which Flow Type, and When Not To
This chapter assumes you can build a basic flow in Flow Builder. You should also know what input and output variables are, and how a Subflow element calls another flow. The goal is a short decision method for picking between a schedule-triggered flow, an autolaunched flow, and alternatives such as scheduled Apex.
Start with what starts the work
Every choice begins with one question: what causes this automation to run?
- A clock or calendar starts it. Use a schedule-triggered flow.
- Another flow, Apex, or an API caller starts it. Use an autolaunched flow.
- A record change starts it. Use a record-triggered flow, which this chapter does not cover.
- A user clicking through pages starts it. Use a screen flow.
Comparing the options
| Option | Starts from | Best for | Main limit |
|---|---|---|---|
| Schedule-triggered flow | Start date, time, and frequency | Nightly or weekly updates to records that match filters | One object per run, filter conditions only |
| Autolaunched flow | Subflow, Apex, or REST call | Reusable logic with inputs and outputs | Does nothing until something calls it |
| Scheduled Apex | A scheduled class | Complex queries, large volumes, custom batching | Needs code, tests, and a deployment |
Combine the two types
The two flow types work well together. A schedule-triggered flow selects the records. For each record, it calls an autolaunched flow through a Subflow element. The autolaunched flow holds the business rule, so a button, an Apex class, or another flow can reuse it later.
Keep one thing in mind. Calling a Subflow inside a Loop element adds work for every record in the loop. Pass a collection into the autolaunched flow when you can, and do the work in one pass.
When not to use a flow
Choose another tool in these cases:
- The logic needs queries that filter conditions cannot express, such as joins across unrelated objects.
- The job must process very large record volumes with control over batch size.
- The automation needs complex error handling, retries, or unit tests that must run on every deployment.
- The work must run more often than the schedule settings allow. Scheduled flows run at most once per day in the standard configuration, so check your org's options before promising a shorter interval.
Common mistakes
- Building a schedule-triggered flow for work that a record change should trigger. A nightly sweep delays the update by up to a day.
- Putting the same logic in several scheduled flows instead of one autolaunched flow.
- Forgetting that an autolaunched flow has no trigger, then wondering why it never runs after activation.
Exercise
A team needs to close cases that have had no activity for 30 days. The same closing rule must also run when an agent clicks a button, and it must run every night. Which flow types would you use, and how would they connect?
Show answer
Build one autolaunched flow that holds the closing rule and accepts a case as an input variable. Build a schedule-triggered flow on Case, with a filter for cases that have had no activity for 30 days, running daily. That flow calls the autolaunched flow through a Subflow element. The button, built as a screen flow or Apex action, calls the same autolaunched flow, so the rule lives in one place.
Exercise
Name two situations where scheduled Apex is a better fit than a schedule-triggered flow.
Show answer
Examples include logic that needs queries across unrelated objects, which filter conditions cannot express, and jobs that must process very large volumes with a controlled batch size. Needing retries and automated unit tests for every deployment also points to Apex.