Sub topic 1
Flow Types and What Triggers Them
Prerequisites
This chapter assumes you can create a flow in Flow Builder, add elements, and use variables. You should know basic Salesforce objects, fields, and records. You need a sandbox or Developer Edition org to try the examples.
Why the flow type matters for debugging
Every flow starts in a specific way, and that start determines how you debug and test it. A record-triggered flow runs inside the save of a record. A screen flow runs when a user opens it. If you pick the wrong debugging approach for the type, you will not see the behavior you are chasing.
Later chapters build on this one. Debug options, transactions, fault paths, and tests all depend on knowing what started the interview. An interview is one running instance of a flow.
The main flow types
| Flow type | What starts it | Typical debugging concern |
|---|---|---|
| Screen flow | A user, through a button, action, Lightning page, or utility bar | User input and screen navigation |
| Record-triggered flow | A record is created, updated, or deleted | Entry conditions, bulk saves, limits |
| Schedule-triggered flow | A set time and frequency | Batch size and failures at scale |
| Platform event-triggered flow | A platform event message is published | Event delivery and ordering |
| Autolaunched flow (no trigger) | Apex, another flow, REST API, or a process | Input and output variables |
Screen flows
A screen flow shows screens and collects input from a user. It is the only type that needs a person to interact with it. You can run it in the debugger and enter values on the screens yourself.
Record-triggered flows
A record-triggered flow starts when a record changes. You choose the object, the trigger (create, update, create or update, delete), and entry conditions. You also choose when it runs relative to the save.
- Before the save (fast field updates) changes fields on the triggering record without extra DML. DML means a database write such as insert or update.
- After the save (actions and related records) can create or update other records, send emails, and call actions. It uses the
$Recordvariable for the triggering record.
Most debugging problems you meet come from record-triggered flows. They run in the same transaction as the save, so they share governor limits with triggers and other automation.
Schedule-triggered and platform event-triggered flows
A schedule-triggered flow runs at a set time on a batch of records that match filters. A platform event-triggered flow runs when a matching event message is published. Neither has a user on screen, so you rely on debug logs and error emails to see what happened.
Autolaunched flows
An autolaunched flow has no trigger of its own. Something else starts it: Apex, another flow, or the REST API. It communicates through variables marked "Available for input" and "Available for output". This makes it easy to test with Apex, which a later chapter covers.
flowchart TDChoosing which type you are debugging
Before you debug, answer three questions.
- What started this interview? Check the flow's start element.
- Did a user, a record save, or a system process start it?
- Where does it share a transaction with other automation?
The answers tell you where to look. A flow that fails on a record save may not be the cause. Another flow, a trigger, or a validation rule on the same save may be.
A quick example
Suppose a record-triggered flow on Opportunity creates a follow-up task when the stage becomes Closed Won. You report that no task appears. Knowing the type helps you form hypotheses:
- The entry conditions might not match, for example if the flow only runs on create.
- The flow might run before the save, where creating related records is not allowed.
- Another automation in the same transaction might have raised an error.
Each hypothesis points to a different check. That is the habit this tutorial builds.
Exercise
A flow must create a task for each Opportunity that moves to Closed Won. Which flow type fits, and why is it harder to debug than a screen flow?
Show answer
A record-triggered flow on Opportunity, run after the save. It runs inside the save transaction with no user screens, so you cannot step through it by hand. You rely on the debugger, debug logs, and tests.
Exercise
Name two flow types that have no user interacting with them while they run, and one way to observe what they did.
Show answer
Schedule-triggered and platform event-triggered flows (autolaunched flows also qualify). You can observe them with debug logs or flow error emails.