Sub topic 1
Flow Builder in brief
Flow Builder is the visual tool in Salesforce for building flows. A flow is automation you design on a canvas instead of writing code. This chapter covers the parts of Flow Builder you need before building scheduled and autolaunched flows. Later chapters go deeper on the flow types, resources, and elements mentioned here.
Prerequisites
This chapter assumes you already have the following:
- A working idea of Salesforce objects, fields, and records.
- Access to Setup and permission to create flows. The usual permission is Manage Flow, which System Administrators have by default.
- A sandbox or Developer Edition org to experiment in. Do not practice in production.
- Optional: the ability to read simple Apex. Only the code-based sections of later chapters need it.
What a flow is
A flow is a set of steps that Salesforce runs in order. Each step does one job, such as reading records, making a decision, or updating a field. When a flow runs, Salesforce creates a flow interview. An interview is one running instance of a flow, with its own copy of the data. If a flow runs for 200 records in separate transactions, you get separate interviews, and they do not share variable values.
A flow has four building blocks:
- Start element. It defines how the flow begins. Its settings depend on the flow type.
- Elements. These are the steps, such as Get Records, Decision, Assignment, Loop, and Update Records.
- Connectors. These are the arrows that set the order of the steps.
- Resources. These are named values the flow can use, such as variables, collections, formulas, and constants.
Opening Flow Builder
In Setup, search for Flows. The Flows page lists every flow and version in the org. Select New Flow to start. Salesforce asks you to choose a starting point:
| Choice | How it starts | Typical use |
|---|---|---|
| Record-Triggered Flow | A record is created, updated, or deleted | Reacting to data changes |
| Schedule-Triggered Flow | A set date, time, and frequency | Batch work on a timer |
| Platform Event-Triggered Flow | A platform event message is published | Reacting to events |
| Screen Flow | A user opens it, and it shows screens | Guided user interaction |
| Autolaunched Flow (No Trigger) | Another flow, Apex, or the REST API calls it | Reusable logic |
This tutorial focuses on the Schedule-Triggered and Autolaunched types. The next chapter compares all of them in detail.
The Flow Builder workspace
The workspace has three main areas.
The toolbox
The toolbox is the left panel. It has two tabs that you will use constantly:
- Elements lists the steps you can add to the canvas.
- Manager lists every resource in the flow, including variables you created and system values such as
$Flow.CurrentDateTime. Use it to check names, data types, and whether a variable is available for input or output.
The canvas
The canvas is the large middle area where the flow is drawn. Flow Builder offers two layouts:
- Auto-Layout places elements for you and keeps connectors tidy. It is easier to read and is the default for new flows.
- Free-Form lets you drag elements anywhere. It gives more control, but large flows get messy quickly.
You can switch layouts from the canvas settings. Pick one and keep it for the whole flow. Auto-Layout is a good default for beginners and for flows that teammates will maintain.
The properties and toolbar
Selecting an element opens its editor. Each element needs a label and an API name. The API name is the unique identifier that other parts of the flow use. It can contain only letters, numbers, and underscores, and it must start with a letter. Choose clear names early, such as Get_Open_Cases instead of Get_Records_1, because formulas and later elements refer to these names.
The top toolbar holds the commands you will use most:
- Save stores your work.
- Activate makes a saved version the one that runs.
- Debug tests the flow inside Flow Builder.
- Run appears for flows that can run directly from the builder.
- View Properties shows the flow's label, API name, description, and API version.
Building a first flow: the working loop
Most flow work follows the same loop:
- Choose the flow type and set up the start element.
- Create the resources you need, such as a variable to hold a record.
- Add elements and connect them in order.
- Save, then debug with realistic data.
- Fix problems, save again, and then activate.
The most common source of confusion is that Save and Activate are separate. Saving does not make your changes live. Each save of an active flow's changes creates a new version, and the previously active version keeps running until you activate the new one. Chapter 15 covers versions in detail.
Common errors in the builder
New builders tend to run into the same few problems:
- Unconnected elements. An element with no connector leading into it never runs. Flow Builder warns about this on save or activation.
- Wrong data type. A Text variable cannot be assigned to a Number field. Match types when you create resources.
- Missing Start settings. A schedule-triggered flow needs an object, a start date, and a frequency. Without them, it will not activate.
- Vague names. Elements named
Assignment_1andAssignment_2make debugging harder. Name elements for what they do. - Testing in production. Debug runs can change real data. In the debug options, the rollback mode setting lets you test without keeping database changes. Use it, and also test in a sandbox first.
Where this chapter fits
Everything in later chapters happens inside the workspace described here. The next chapter explains how each flow type starts. After that, you will meet the resources and elements that fill the canvas, and then you will build autolaunched flows and schedule-triggered flows in detail.
Exercise
You edited an active flow and selected Save. Users still see the old behavior. What happened, and what should you do?
Show answer
Saving an edited active flow creates a new version but does not make it the running version. The previously active version keeps running. Test the new version with Debug, then select Activate on the new version so it replaces the old one.
Exercise
A teammate adds a Get Records element to the canvas but forgets to draw a connector into it. What happens when the flow runs, and how do you prevent this?
Show answer
The element never runs, because the flow follows only connectors from the start element. Flow Builder warns about unconnected elements when you save or activate. Prevent this by connecting each element as you add it, and by running Debug after every change.