Sub topic 1
Flow Builder in brief
Prerequisites
Assume you know Salesforce objects, fields, records, and the Setup menu. You should also understand that a flow is declarative automation: you configure steps instead of writing most of the code.
Flow Builder and flow types
Flow Builder is Salesforce’s visual editor for connecting a trigger, data operations, decisions, and actions. A flow runs from its start element and follows the connected path.
| Flow type | How it starts | Typical use |
|---|---|---|
| Record-triggered | A record is created or changed | Update related data immediately |
| Screen | A user opens a flow | Guide a user through a process |
| Autolaunched | Another automation, Apex, or an API starts it | Reuse background logic |
| Schedule-triggered | Salesforce reaches a configured time | Process matching records periodically |
A schedule-triggered flow selects an object and filter conditions, then runs on a schedule. An autolaunched flow has no trigger of its own. It waits for something else to call it.
Resources and common elements
Resources hold or calculate values during a run.
- A variable stores one value, such as an account ID or a number.
- A collection stores multiple values or records.
- A formula calculates a value from fields, variables, or functions.
- A constant stores a reusable fixed value.
The main data elements are Get Records, Create Records, Update Records, and Delete Records. Use Decision to choose a path, Assignment to set values, and Loop to process collection items.
Autolaunched flows and input/output variables
Build an autolaunched flow when the same business logic must be called from several places. Mark a variable as available for input when callers must provide its value. Mark a variable as available for output when callers need a result.
For example, a flow named Close_Stale_Cases could accept accountId, find qualifying cases, close them, and return closedCount. Another flow can call it with a Subflow element. Apex or the REST API can also start the active flow and pass its input values.
Exercise
Which flow type should you use for reusable logic that another flow or Apex must start?
Show answer
Use an autolaunched flow with input variables for required data and output variables for returned results.