A Comprehensive Guide to Salesforce Flows
Introduction to Salesforce Flows
Salesforce Flow is a robust automation tool that enables admins and developers to streamline and optimize complex business processes without requiring code. It provides a visual drag-and-drop interface to design workflows that collect, update, and manipulate data across multiple objects, ensuring data consistency and operational efficiency. With Flow, users can create guided interactions, automate record updates based on predefined triggers, and schedule tasks to run at specific intervals. It supports different types of flows, including Screen Flows for user-driven processes, Record-Triggered Flows for automating actions based on record changes, Schedule-Triggered Flows for time-based execution, and Autolaunched Flows for backend automation. By leveraging Flow’s capabilities, businesses can enhance user experiences, minimize manual efforts, and ensure seamless execution of critical operations within Salesforce.
How to Create a Salesforce Flow?
Step 1: Navigate to Flow Builder
- Go to Setup → Process Automation → Flows.
- Click New Flow.
Step 2: Choose a Flow Type
- Select the type of Flow based on your requirement (Screen Flow, Record-Triggered, etc.).
Step 3: Define Flow Elements
- Drag and drop elements like Screen, Decision, or Data operations.
Step 4: Connect Flow Elements
- Use connectors to define the sequence of actions.
Step 5: Save & Activate
- Save your Flow, debug it for errors, and Activate it for execution.
Types of Salesforce Flows
Salesforce provides different types of Flows, each designed for a specific use case:
- Screen Flow
A Screen Flow is an interactive automation tool in Salesforce that requires user input and provides a guided experience through a sequence of screens. It is primarily used for user-driven processes where data needs to be collected, displayed, or modified before proceeding to the next step. Screen Flows are often embedded in Lightning pages, Experience Cloud sites, and the Salesforce Utility Bar to enhance user interactions.
Key Features of Screen Flow:
- User Interaction: Requires users to enter or review data before proceeding.
- Step-by-Step Guidance: Presents a structured, sequential experience.
- Customizable UI: Allows adding text, images, choices, picklists, file uploads, and dynamic visibility rules.
- Supports Conditional Logic: Can show or hide fields based on previous inputs.
- Integration with Salesforce Data: Can retrieve and update records from multiple objects.
How Screen Flow Works:
- Triggering the Flow: Users initiate it via a Lightning page, button, or quick action.
- Collecting Data: Screens prompt users to enter information in fields, dropdowns, or radio buttons.
- Processing Logic: Flow applies conditions, formulas, or decision elements to determine the next step.
- Record Updates: Data is stored in Salesforce objects or used to trigger further automation.
- Completion & Navigation: Users are shown a success message or redirected to a relevant page.
- Record-Triggered Flow
A Record-Triggered Flow is an automation tool in Salesforce that runs automatically when a record is created, updated, or deleted. Unlike Screen Flows, Record-Triggered Flows do not require user interaction and execute in the background whenever a specified change occurs in Salesforce data. This type of Flow is primarily used to replace most Workflow Rules and Process Builder automations, offering a more powerful and flexible solution for handling record updates efficiently.
Key Features of Record-Triggered Flow:
Automatic Execution: Runs without user intervention when a record changes.
Optimized for Performance: Can run before-save for efficient updates or after-save for additional actions like creating related records.
Supports Complex Logic: Allows conditional execution using Decision elements and custom formulas.
Can Replace Apex Triggers: In many cases, Record-Triggered Flows eliminate the need for simple Apex Triggers.
Bulk Processing Support: Works efficiently with bulk record operations, such as Data Loader imports.
How Record-Triggered Flow Works:
Trigger Event: The flow listens for a record change (Create, Update, or Delete).
Decision Element: It checks conditions to determine if an action is needed.
Data Manipulation: If conditions are met, the flow updates fields, creates records, or triggers related actions.
Completion: The flow executes the defined actions automatically.
- Schedule-Triggered Flow
A Schedule-Triggered Flow is an automation tool in Salesforce that runs at a specific time and frequency without requiring user interaction or record changes. It is primarily used for batch processing, scheduled data updates, and time-based automation tasks. Unlike Record-Triggered Flows, which execute when a record is created, updated, or deleted, Schedule-Triggered Flows run based on predefined schedules, making them ideal for recurring tasks such as sending reminders, performing mass updates, or cleaning up data.
Key Features of Schedule-Triggered Flow:
Automated Execution: Runs at a defined schedule without manual intervention.
Flexible Scheduling: Can be configured to run once, daily, or weekly.
Batch Processing: Processes multiple records in bulk efficiently.
Supports Complex Logic: Can apply conditions to filter records before performing actions.
No User Interaction Required: Runs entirely in the background.
System Resource Optimization: Runs asynchronously, preventing performance bottlenecks.
How Scheduled-Triggered Flow Works:
Flow Execution is Scheduled
- The admin sets a start date, time, and frequency (Once, Daily, or Weekly).
- The Flow runs automatically at the scheduled time.
Fetches Records Based on Criteria
- The Flow retrieves records using the Get Records element.
- Only records meeting specific conditions (e.g., “Tasks with Due Date = Today”) are processed.
Processes Each Record
- The Flow applies Decisions and Assignments (e.g., check if a task is overdue).
- Executes actions like updating records, sending notifications, or calling subflows.
Performs Bulk Updates
- Unlike Record-Triggered Flows, Scheduled Flows process multiple records at once.
- Uses loops and collection variables to handle batch updates efficiently.
Completes Execution & Repeats if Needed
- If the frequency is Daily or Weekly, the Flow runs again at the next scheduled time.
- Auto-Launched Flow
An Auto-Launched Flow is an automation tool in Salesforce that runs in the background without requiring user interaction. It is designed for system processes and can be triggered by Apex code, Process Builder, Record-Triggered Flows, REST API calls, or another Flow. Unlike Screen Flows, which require user input, Auto-Launched Flows execute actions such as record updates, email notifications, integrations, and complex business logic automatically.
Key Features of Auto-Launched Flow:
No User Interaction Required: Runs in the background without displaying a UI.
Can Be Triggered in Multiple Ways: Called by Apex, Process Builder, Another Flow, REST API, or a Button.
Supports Complex Logic: Can handle loops, decisions, assignments, formulas, and DML operations like Create, Update, Delete.
Efficient & Scalable: Runs asynchronously and supports bulk processing when handling multiple records.
Reusability: Can be used as a subflow within another flow to modularize automation.
Works with External Systems: Can send HTTP requests to integrate with third-party applications.
Use Cases of Auto-Launched Flow:
- Auto-Assigning Leads Based on Predefined Criteria
- When a new Lead is created, assign it to a sales representative based on territory, industry, or region.
- Triggered by Process Builder or Apex Trigger.
- Automated Case Escalation
- If a Case remains open for more than 48 hours, automatically escalate it to a higher-tier support team.
- Can be triggered by Record-Triggered Flow or Scheduled Flow.
- Updating Related Records
- When an Opportunity is marked as Closed Won, update all related Contacts with a “Customer” status.
- Auto-Launched Flow is called by a Record-Triggered Flow.
- Sending Notifications on Specific Events
- When a contract renewal date is approaching, send an email reminder to the account manager.
- Triggered by a Scheduled-Triggered Flow.
- Data Cleanup and Mass Updates
- Automatically deactivate old records based on predefined conditions, such as inactive users or expired contracts.
- Runs via Scheduled Flow or Process Builder.
- Platform Event-Triggered Flow
A Platform Event-Triggered Flow is an advanced automation tool in Salesforce that listens for Platform Events and executes automation when an event is received. It enables real-time data synchronization, making it ideal for event-driven architectures and integrations with external systems. This type of Flow runs asynchronously in the background, meaning it does not require user interaction and can process large volumes of events efficiently.
Key Features of Platform Event-Triggered Flow
Event-Driven Automation: Executes when a Platform Event message is published.
Real-Time Data Processing: Facilitates near-instant updates and actions in Salesforce.
External System Integration: Used to sync Salesforce with third-party applications (e.g., ERP, Payment Gateways).
Asynchronous Execution: Runs independently of user actions or record updates.
Scalable & High-Volume Processing: Can handle thousands of events per second without system slowdowns.
Error Handling & Retries: Supports event replay and recovery mechanisms.
Use Cases of Platform Event-Triggered Flow
- Syncing External System Data with Salesforce
- An ERP system publishes a Platform Event when an order is shipped.
- The Flow listens for the event and updates the Order Status in Salesforce.
- Real-Time Payment Processing Updates
- A payment gateway (e.g., Stripe, PayPal) sends a Platform Event when a transaction is successful.
- The Flow listens for the event and updates the related Opportunity or Invoice.
- Automated Case Creation from External Systems
- A third-party customer support system generates a Platform Event when a new complaint is logged.
- The Flow listens for the event and creates a Case in Salesforce.
- IoT (Internet of Things) Event Processing
- A smart device sends a Platform Event when a machine part needs maintenance.
- The Flow listens for the event and creates a Work Order in Salesforce.
- Order Fulfillment Notifications
- An eCommerce system generates a Platform Event when an order is dispatched.
- The Flow listens for the event and updates the Order record in Salesforce while notifying the customer
Conclusion
Salesforce Flows empower admins and developers to automate complex business processes without writing code, enhancing efficiency and reducing manual effort. With various types of Flows—Screen Flows for interactive user experiences, Record-Triggered Flows for automating actions based on record changes, Scheduled-Triggered Flows for batch processing, Auto-Launched Flows for background automation, and Platform Event-Triggered Flows for real-time integrations—organizations can streamline workflows across multiple objects. As Salesforce continuously enhances Flow capabilities, it remains the most powerful declarative automation tool, enabling businesses to optimize operations, improve user experiences, and drive productivity.