Introduction to Salesforce Flow Builder

Flow Builder is Salesforce's most powerful declarative automation tool — and it is the future of all Salesforce automation. "Declarative" means you build automation visually, by pointing and clicking, without writing traditional code. Flow Builder replaces both Workflow Rules and Process Builder for new development and handles scenarios far more complex than either tool could manage.

What Is a Flow?

A Flow is a set of instructions that Salesforce follows automatically, step by step. You design those instructions on a visual canvas using boxes connected by arrows. Each box is an element — it might ask a user a question, look up a record, update a field, send an email, or make a decision.

The Train Track Analogy

  FLOW = A train journey with multiple stops and switches

  [START] → [Station A: Collect customer info]
                  |
                  ↓
             [Switch: Is revenue > ₹10 lakh?]
             /                          \
           YES                          NO
            ↓                            ↓
  [Send Enterprise email]    [Send SMB welcome email]
            |                            |
            └──────────┬─────────────────┘
                       ↓
              [Update Account Tier field]
                       |
                     [END]

The flow always starts at the top, moves through elements in order, makes decisions at branch points, and ends when all steps are done.

Types of Flows

Salesforce offers several flow types, each designed for a specific trigger and use case:

Screen Flow

A Screen Flow displays interactive screens to users — like a wizard or a guided form. Users fill in information, make choices, and navigate through multiple steps. Screen Flows are embedded on record pages, app pages, or Experience Cloud sites. Example: A new customer onboarding wizard that walks a service agent through collecting customer details step by step.

Record-Triggered Flow

This flow starts automatically when a Salesforce record is created, updated, or deleted — no user click required. It replaces Workflow Rules and Process Builder. Example: When an Opportunity is marked "Closed Won," the flow automatically creates an onboarding case, sends a congratulations email, and updates the Account's tier field.

Schedule-Triggered Flow

This flow runs on a schedule — daily, weekly, or at a specific time. It processes a batch of records that meet defined criteria. Example: Every morning at 6 AM, find all Opportunities closing this week and send reminder emails to their owners.

Platform Event-Triggered Flow

This flow starts when a Platform Event message is received. Platform Events are Salesforce's real-time messaging system. Example: An external payment system sends a Platform Event when a payment is confirmed, and the flow updates the related Opportunity to "Closed Won" automatically.

Autolaunched Flow (No UI)

This flow runs in the background — no screen, no user interaction. It is launched by another automation, by Apex code, or by a REST API call. Example: An Apex trigger calls an autolaunched flow to handle complex record creation logic.

Flow Builder Elements

Inside Flow Builder, you build logic using these elements:

ElementWhat It Does
ScreenDisplays a form or information to the user (Screen Flows only)
DecisionBranches the flow based on conditions (like an IF statement)
Get RecordsQueries Salesforce to retrieve one or more records
Create RecordsCreates one or more new Salesforce records
Update RecordsUpdates field values on existing records
Delete RecordsDeletes one or more records
AssignmentSets a variable to a specific value
LoopIterates through a collection of records one by one
SubflowCalls another flow from inside the current flow
ActionRuns a predefined action: send email, post to Chatter, call Apex

Flow Variables

A Variable in a flow stores data temporarily while the flow runs. Think of it as a sticky note the flow writes on, reads from, and passes to other steps.

  • Text variable — stores a word or phrase (e.g., "Priya")
  • Number variable — stores a number (e.g., 42)
  • Record variable — stores an entire Salesforce record
  • Collection variable — stores multiple records at once (used with loops)
  • Boolean variable — stores TRUE or FALSE

Before-Save vs. After-Save Flows

Record-Triggered Flows can run at two points in the save process:

  • Before Save — runs before the record is written to the database. You can update fields on the same record being saved without a separate DML operation. Faster and more efficient for simple field updates.
  • After Save — runs after the record is saved. Required when you need to create or update other records, send emails, or call external systems.

Flow Best Practices

  • Use Before-Save flows for updating fields on the triggering record — they are faster than After-Save.
  • Bulkify your flows — avoid putting SOQL queries or DML operations inside loops to prevent hitting governor limits.
  • Use descriptive names for all elements — future maintainers need to understand the flow without a guide.
  • Test every flow in a Sandbox before activating in Production.
  • Use the built-in Debug tool in Flow Builder to trace exactly how the flow runs step by step.

Key Points

  • Flow Builder is Salesforce's recommended tool for all new automation — it replaces Workflow Rules and Process Builder.
  • The main flow types are Screen Flow (user-guided), Record-Triggered (automatic on record changes), Schedule-Triggered (time-based), and Autolaunched (called by other tools).
  • Flow elements include Get Records, Create Records, Update Records, Decision, Loop, and Action.
  • Variables store data temporarily as the flow executes.
  • Before-Save flows are efficient for field updates on the same record; After-Save flows handle related record changes and external actions.

Leave a Comment