Sub topic 2
Flow types and how each one starts
This chapter assumes you know the basic Salesforce data model (objects, fields, records), can find your way around Setup, and have built a simple flow in Flow Builder. You don't need Apex for most of it.
Why the start of a flow matters
Every flow has a start. The start decides who or what launches the flow, what data is available on the first element, which elements you can use, and which user's permissions apply. Most design mistakes in flow work begin with picking the wrong type. A common example is building a screen flow for a nightly cleanup job, which then needs a person to run it.
In Flow Builder you choose the type when you create the flow. You can change some settings later, but the type is fixed in practice. Plan to rebuild the flow if you picked the wrong one.
The main flow types
The types you will meet most often are these.
| Type | What starts it | Screens allowed | Typical use |
|---|---|---|---|
| Screen flow | A person, through a button, a Lightning page, a utility bar, or a link | Yes | Guided data entry, wizards |
| Record-triggered flow | A record being created, updated, or deleted | No | Field updates, related-record creation |
| Schedule-triggered flow | A clock: a start date, a time, and a frequency | No | Nightly cleanup, reminders, batch updates |
| Autolaunched flow (no trigger) | Another flow, Apex, or the REST API | No | Reusable logic called from elsewhere |
| Platform event-triggered flow | A platform event message being published | No | Reacting to events from other systems |
This tutorial focuses on the schedule-triggered and autolaunched types. You still need to tell all five apart, because the others appear in the same Flow Builder menu.
Screen flows
A screen flow is the only type that talks to a person. It contains Screen elements that display fields and collect input. Because it needs a user in front of it, a screen flow cannot run in the background. You start it from somewhere visible: a quick action, a button, a Lightning page component, or an Experience Cloud site.
Record-triggered flows
A record-triggered flow starts when a record changes. You choose an object, choose when the flow runs (create, update, create or update, or delete), and add entry conditions. A before-save flow runs before the record is written and is fast, but it can only change fields on the triggering record. An after-save flow runs once the record exists, so it can create or update other records. It can also run actions after the commit, using an asynchronous path.
Schedule-triggered flows
A schedule-triggered flow starts at a set time. You give it a start date, a time, and a frequency of Once, Daily, or Weekly. You can optionally give it an object and filter conditions. If you do, Salesforce finds the matching records at run time and runs one flow interview for each record. An interview is a single running instance of a flow. If you give no object, the flow runs once per scheduled run with no triggering record.
The start element of a scheduled flow shows all of these settings in the flow's metadata:
<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>This flow runs every day at 02:00 UTC, beginning on 1 January 2025. It processes every Opportunity whose stage is Prospecting. Later chapters cover the schedule and the record filters in detail.
Autolaunched flows (no trigger)
An autolaunched flow has no start condition of its own. It does nothing until something else calls it. The caller can be another flow through a Subflow element, an Apex class, or the REST API. Because nobody is watching, it can't contain screens. Its interface is a set of input and output variables, which you can think of as the parameters and return values of a function.
This makes the autolaunched flow the building block for reuse. You write the logic once, activate it, and call it from several places.
How the types relate in metadata
The type you pick in Flow Builder maps to two fields in the flow's metadata. processType gives the broad category and triggerType gives the start mechanism. A screen flow uses processType of Flow. Autolaunched, schedule-triggered, record-triggered, and event-triggered flows all use AutoLaunchedFlow. The triggerType then separates them.
| Flow type | processType | triggerType |
|---|---|---|
| Screen flow | Flow | none |
| Autolaunched (no trigger) | AutoLaunchedFlow | none |
| Schedule-triggered | AutoLaunchedFlow | Scheduled |
| Record-triggered, before save | AutoLaunchedFlow | RecordBeforeSave |
| Record-triggered, after save | AutoLaunchedFlow | RecordAfterSave |
| Platform event-triggered | AutoLaunchedFlow | PlatformEvent |
The table also explains a naming confusion. In the API, "autolaunched" covers every flow that runs without a screen. In the Flow Builder menu, "Autolaunched Flow (No Trigger)" means only the callable kind. This tutorial uses the second meaning unless it says otherwise.
Choosing by how you want it to start
The decision usually comes down to one question: what should cause this logic to run?
Two combinations are worth remembering because they are so common:
- A schedule-triggered flow can call an autolaunched flow as a subflow. The schedule decides when and for which records. The autolaunched flow holds the reusable logic.
- A screen flow or record-triggered flow can call the same autolaunched flow. This keeps one copy of a rule instead of three.
Common errors
- Expecting a screen in a background flow. Screen elements are not available in autolaunched, scheduled, or record-triggered flows. If a flow must ask a user something, it must be a screen flow, or a screen flow must call the autolaunched flow after collecting the answers.
- Looking for a Run button on an autolaunched flow. An autolaunched flow only runs when something calls it. To test one, use the Debug button in Flow Builder, or call it from a parent flow or Apex.
- Forgetting that a schedule runs without a user session. A scheduled flow runs in the background, not as the person who built it. Records that the run context can't reach are silently skipped. The run context chapter explains this.
- Assuming a schedule means exactly on time. Scheduled runs are queued and can start a little after the chosen time, especially when the org is busy. Don't build logic that depends on the exact minute.
- Putting long-running record work in an after-save flow. If the work is large or can wait, a schedule-triggered flow is often a better fit than a record-triggered one.
- Editing the wrong version. Only an active version starts from its trigger or schedule. A saved but inactive version never runs on its own. Activation is covered in a later chapter.
Summary of the two types in this tutorial
- An autolaunched flow has no trigger. It runs when a flow, Apex, or the REST API calls it, and it communicates through input and output variables.
- A schedule-triggered flow has a clock as its trigger. It runs at a set date, time, and frequency, optionally once for each record that matches a filter.
The next chapters build on this split: first the resources and elements that both types use, then each type in detail.
Exercise
Your team needs a rule that sets a Case's priority based on the account tier. The rule must run when a Case is created, when an agent clicks a button on a Case page, and every night for all open Cases. Which flow types would you use, and how would you avoid writing the rule three times?
Show answer
Put the priority rule in one autolaunched flow, with the Case ID (or Case record) as an input variable. Call it as a subflow from three starters. A record-triggered flow on Case create, a screen flow launched from the button, and a schedule-triggered flow that runs daily against open Cases. Each starter decides when the rule runs, and the autolaunched flow holds the single copy of the logic.
Exercise
A colleague built a flow with a Screen element and then tried to run it nightly with a schedule. Why can't this work, and what are two ways to fix it?
Show answer
A schedule-triggered flow runs in the background with no user, so it can't show a screen. One fix is to remove the Screen element and supply the data through filters, variables, or constants. The other is to move the non-screen logic into an autolaunched flow and keep the screen flow for the interactive part.