Sub topic 15
Activating Flows and Managing Versions
This chapter assumes you can build a basic autolaunched or schedule-triggered flow in Flow Builder and open Setup. It covers how a flow becomes live, how versions work, and the mistakes that cause confusion.
Saving is not activating
A flow in Flow Builder is a set of versions. Saving creates a version. Activating makes one version the live one. Only one version of a flow can be active at a time.
What "active" means depends on the flow type:
| Flow type | What activation does |
|---|---|
| Autolaunched (no trigger) | Allows Subflow, Apex, and REST API callers to run it |
| Schedule-triggered | Registers the schedule so the flow starts at the set time |
An inactive autolaunched flow can still be run from the debugger. Callers in production cannot use it. The Apex and REST examples in this tutorial fail until the flow is active.
Version states
Each version has one of three states.
- Draft: Saved but never activated. You can still edit it.
- Active: The live version. Activated versions are read-only. To change one, open it and save as a new version.
- Obsolete (inactive): A version that was active before another version replaced it, or that you deactivated.
Replacing a live version
Follow these steps to release a change safely.
- Open the active version and save it as a new version.
- Edit the new version and test it with the debugger.
- Activate the new version. Salesforce deactivates the previous one automatically.
- Watch the first runs in Paused and Failed Flow Interviews and your fault notifications.
If the new version misbehaves, open Flow Details in Setup and activate the earlier version. Rolling back is only a new activation, so the old version is never lost until you delete it.
What happens to runs in progress
A version change affects only new runs. An interview already running continues on the version it started with. A paused interview resumes on its original version too. This is why you should not delete an old version while paused interviews may still depend on it.
A schedule-triggered flow keeps its schedule when you activate a new version. The schedule settings come from the version you activate, so confirm the start date, time, and frequency in the new version's Start element.
Common errors
- Forgetting to activate. A saved version has no effect. The flow looks finished but nothing runs.
- Activating with a past start date. A schedule-triggered flow with a start date in the past runs from the next scheduled time, not retroactively.
- Changing input variables. If you rename or remove an input variable, callers that pass it fail. Keep the variable names stable, or update every Subflow, Apex, and REST caller together.
- Deleting versions too early. You cannot delete the active version. Deactivate it first, and keep at least one known good version for rollback.
Exercise
You saved changes to an active schedule-triggered flow, but tonight's run still used the old logic. What did you most likely forget, and how would you roll back later if the fix misbehaves?
Show answer
You saved a new version but did not activate it, so the earlier version stayed live. Activate the new version to make it run. To roll back later, open the flow's versions in Setup and activate the earlier version, which deactivates the newer one.