You build an Autolaunched Flow in Flow Builder. The steps below create a pure autolaunched flow that you can call from a button, Apex, a subflow, or the REST API. For a triggered variant, you pick Record-Triggered, Schedule-Triggered, or Platform Event-Triggered at the start instead, then configure the trigger.
- Open Flow Builder and pick the type
From Setup, go to Flows and click New Flow. Choose Autolaunched Flow (No Trigger) for a flow you will call yourself, or choose a triggered type if you want it to fire on a record, schedule, or event.
- Define input and output variables
In the Manager, create resource variables and mark them Available for input or output as needed. These are how a button, Apex, or a parent flow passes data in and reads results back out.
- Build the logic on the canvas
Add Get Records, Decision, Loop, Assignment, and Create or Update Records elements to do the work. Keep DML out of loops by collecting records into a variable and committing once after the loop.
- Add fault handling
On every data and Apex element, drag a fault connector to a handler that logs the error or sends a notification. Silent failures are the hardest flow bugs to find later.
- Debug, save, and activate
Use the Debug button to run the flow with sample inputs and confirm each step. Save with a clear name and description, then click Activate so callers can run it.
Autolaunched Flow (No Trigger) for an on-demand flow, or a triggered type to fire automatically. This choice is set when you create the flow.
A readable label and a unique API name. Apex and the REST API reference the flow by its API name, so pick it carefully.
How the flow runs, in system context or in the running user context. This decides whether sharing and field permissions are enforced.
- A flow does nothing until you activate it. A saved but inactive flow will not run when called.
- Record-Triggered Flows run on the whole batch in one transaction, so build for bulk, not for a single test record.
- An after-save flow cannot run before a before-save flow or an Apex trigger, regardless of the trigger order value you set.
- Run context controls security. Running in system context skips the user sharing and field-level security, so confirm that is what you want.