Flow Builder
Salesforce Flow Builder is a declarative automation tool for building Record-Triggered, Screen, Scheduled, and Platform Event flows without code — now enhanced with AI Assist for natural-language flow generation.
Overview
- 1Flow Builder replaces Process Builder (deprecated) and Workflow Rules (deprecated) for all automation.
- 2Flow AI Assist (Spring '26): describe your automation in English and Flow Builder generates the elements.
- 3Record-Triggered Flows execute before or after DML and can roll back transactions on error.
- 4Screen Flows are Salesforce's declarative wizard builder — embedded in pages, communities, or standalone.
- 5Flows are now the recommended automation tool over Apex for most admin and developer use cases.
Key Features
Spring '26 Flow Updates
- Flow AI Assist: type "When an opportunity closes won, create a task for the account owner" → generates elements
- Screen Flow offline support: forms can be submitted without network, sync when reconnected
- Conditional Field Visibility: show/hide individual fields on Screen Flow pages based on conditions
- Flow Debugging improvements: runtime debug log shows variable values at each element execution
- External Service callouts: updated OpenAPI import for REST API integration in Flows
- Flow Orchestration: parallel stages and step assignments based on record-field conditions
Flow Types
- Record-Triggered: auto-starts on insert/update/delete; runs in transaction (can rollback)
- Screen Flow: user-facing wizard; embed with lightning-flow component or Flow Action in Console
- Scheduled Flow: runs for a batch of records at a scheduled time (e.g., daily at midnight)
- Auto-launched Flow: starts from Apex, Process Builder, or REST API; no user interaction
- Platform Event Flow: triggers when a Platform Event message is published
- Orchestration Flow: multi-user, multi-stage processes with human task assignments and SLAs
Core Elements
- Get Records: `[SELECT Id FROM Account WHERE Name = {!name}]` — retrieves records as variables
- Create/Update/Delete Records: DML operations on queried or manually set SObject variables
- Decision: branches flow path based on conditions (if/else if/else logic)
- Loop: iterate over a collection variable; add items to an output collection
- Assignment: set or update variable values; increment counters
- Subflow: call another flow as a reusable unit; pass in/out variables
- Action: call Apex @InvocableMethod, send email, post to Chatter, call External Service
Best Practices
- One trigger per object: use a single Record-Triggered Flow per object/trigger context to control order
- Use Before-Save flows for field updates — faster, cheaper than After-Save (no additional DML)
- Bulkification: Flow processes up to 200 records per transaction — avoid SOQL/DML inside loops
- Error handling: Fault Path on DML elements; use Rollback on uncaught exceptions for data integrity
- Naming conventions: prefix flow API name with object and type (Opportunity_RT_CloseWon)
- Version control: deploy flows as metadata via Salesforce CLI or DevOps Center with Git
Frequently Asked Questions
Should I use Flow or Apex for automation in Salesforce?
Use Flow for most automation — it is declarative, maintainable by admins, and fully supported by Salesforce. Use Apex when: the logic is too complex for Flow, you need asynchronous processing (Batch/Queueable), you need external callouts within a transaction, or you need precise performance control. Salesforce's stated direction is "Flow first, Apex when needed".
What is the difference between Before-Save and After-Save Record-Triggered Flows?
Before-Save flows run before the record is written to the database — you can update fields on the same record without a separate DML statement (faster, no governor limit consumption). After-Save flows run after the record is committed — required for creating or updating related records. Use Before-Save for field updates on the triggering record; After-Save for cross-object automation.
Can Flows replace all Process Builders and Workflow Rules?
Yes. Process Builder and Workflow Rules are both officially deprecated (as of Spring '23 and Summer '23 respectively) and will eventually be retired. Salesforce provides migration tools to convert them to Flows. Record-Triggered Flows replace both: they match Workflow Rules for simple field updates and surpass Process Builder capabilities with loops, subflows, and complex decision logic.