Salesforce Flow Builder – Complete Module
Flow Builder is Salesforce’s no-code automation tool that replaces Workflow Rules and Process Builder, used for automating complex business processes.
MENU (Flow Builder Topics)
- What is Flow Builder
- Types of Flows
- Flow Elements (Core Building Blocks)
- Record-Triggered Flows
- Scheduled Flows
- Screen Flows
- Subflows
- Flow Best Practices
- Flow Error Handling
- Flow Optimization & Limits
- Real-Time Automation Examples
1) What is Flow Builder
Title: Introduction to Flow Builder
Description:
Flow Builder is Salesforce’s no-code automation tool that replaces Workflow Rules and Process Builder, used for automating complex business processes.
Detailed Explanation:
- Flow Builder automates tasks such as record updates, emails, routing, approvals, calculations, screen interactions, etc.
- It works like a flow chart, with drag-and-drop elements.
- It is more powerful than Workflow and Process Builder because it supports:
- ✓ Loops
- ✓ Conditions
- ✓ Screen interactions
- ✓ CRUD operations
- ✓ Scheduled automation
- ✓ Apex-like functionality without coding
2) Types of Flows
Title: Flow Types
Description:
Salesforce provides different flow types for different automation needs.
Detailed Explanation with Examples:
| Flow TypeWhat It DoesWhen to UseExample | |||
| Record-Triggered Flow | Runs automatically when a record is created/updated/deleted | Automate business logic without user interaction | Auto-update Account when Opportunity is closed |
| Scheduled Flow | Runs at specified time intervals | Time-based automation | Send renewal reminders every month |
| Screen Flow | Shows UI screens to users | Guided forms, wizards | Employee onboarding form |
| Autolaunched Flow | Runs in background | Subflows, integrations | Reusable update logic |
| Subflows | A flow invoked from another flow | Modular automation | Common update logic called by multiple flows |
3) Flow Elements (Building Blocks)
Title: Flow Components
Description:
Flow Builder contains three major components: Elements, Resources, and Connectors.
Detailed Explanation:
A) Elements (Actions you perform)
- Assignment → Assign values to variables
- Decision → If/Else logic
- Get Records → Query Salesforce data
- Update Records → Update existing records
- Create Records → Create new Salesforce records
- Delete Records → Delete records
- Loop → Iterate over lists
- Screen → Display UI
- Action → Email Alerts, Apex, Quick Actions
B) Resources (Data Holders)
- Variables
- Text templates
- Formula resources
- Record variables
- Collections
C) Connectors (Flow Arrows)
Decide which path the flow moves based on conditions.
4) Record-Triggered Flows (Most Used)
Title: Record-Triggered Automations
Description:
These flows trigger automatically when a record is created, updated, or deleted.
Detailed Explanation:
You can configure:
- Trigger When: Before Save / After Save
- Entry Condition: e.g., Amount > 50,000
- Optimize for Fast Field Updates (Before Save)
- Optimize for Actions & Related Records (After Save)
Examples:
Example 1: Auto-populate Account Rating when Opportunity Amount > 1,00,000
Trigger → After Update on Opportunity
Logic → If Amount > 100000 → Set Account Rating = “Hot”
Example 2: Auto-assign Case to Queue
Trigger → Before Insert on Case
Logic → If Case Type = Technical → Assign to “Tech Support Queue”
5) Scheduled Flows
Title: Time-Based Automations
Description:
Scheduled flows run automatically at a specific date/time without user input.
Detailed Explanation:
- Runs daily, weekly, or monthly
- Queries records that meet criteria
- Performs actions automatically
Example:
Send an email reminder 7 days before contract expiry.
6) Screen Flows
Title: User-Interactive Flows
Description:
Screen Flows create guided UI forms used inside:
- Lightning pages
- Quick Actions
- Community pages
Detailed Explanation:
- Displays fields, choice lists, picklists
- Can prefill data
- Can route users based on input
Example:
Employee Onboarding Wizard
Screen 1 → Personal details
Screen 2 → Department selection
Screen 3 → Equipment request
Screen 4 → Summary + Submit
7) Subflows
Title: Reusable Flow Components
Description:
Subflows allow one flow to call another flow.
Detailed Explanation:
Useful for:
- Common logic (ex: update contact preferences)
- Multiple teams using same logic
- Modular and cleaner automation
Example:
A Subflow that updates the Customer Score.
Used by:
- Opportunity flow
- Case flow
- Payment flow
8) Flow Best Practices
Title: Best Practices for Clean Automation
Description:
Guidelines to keep flows optimized and readable.
Detailed Points:
- Name elements clearly: e.g., Get_Account_By_ID
- Avoid unnecessary loops or nested loops
- Use subflows for repeated logic
- Use fault paths (error-handling)
- Avoid hardcoding IDs
- Use formulas instead of multiple assignments
- Test thoroughly before deployment
9) Flow Error Handling
Title: Error Handling in Flows
Description:
Flows must handle errors gracefully and log them.
Detailed Explanation:
- Use Fault Connectors for all Get/Create/Update elements
- Capture errors in:
- Custom object “Flow Errors”
- Email alerts to admins
- Use Try-Catch pattern (using Decision + Fault connector)
Example:
If flow fails to update an Account:
→ Create a “Flow Error Log” record
→ Send email to Admin
10) Flow Optimization & Limits
Title: Optimizing Flow Performance
Description:
Flows must follow Salesforce governor limits.
Detailed Explanation:
- Before Save flows are 10x faster
- Avoid multiple Get Records inside loops
- Use collections instead of updating one-by-one
- Combine updates/creates in single element
- Use scheduled paths instead of delays
11) Real-Time Examples (Very Useful)
Title: Real-World Flow Use Cases
Description:
Common practical flow scenarios used in interviews & projects.
Examples:
- Auto-update Parent Account when child Opportunities change
- Auto-create Task when Case Priority = High
- Send email alert when Lead Status = Converted
- Auto-fill Contact fields from Account
- Auto-assign Sales Rep based on territory
- Daily scheduled flow to identify inactive customers
- Screen flow for Lead qualification
- Subflow to update Last Activity Date