Type of Flow in Salesforce?

Overview

Salesforce Flow is the declarative automation tool in Salesforce used to collect data, perform actions, and update records without code. Understanding the different types of Flows is essential for architects, admins, and developers to choose the right automation pattern for performance, maintainability, and platform limits.

Screen Flow

Screen Flows are interactive flows that present a UI to users. Use Screen Flows for guided data entry, multi-step wizards, or any scenario requiring user input. They can be launched from Lightning pages, buttons, quick actions, or the App Launcher.

Auto-launched Flow (No Trigger)

Auto-launched Flows run without a UI and are manually invoked by other Flows, Apex (Invocable methods), Process Builder (legacy), or from buttons/actions. They are ideal for reusable logic components and backend processing where no user interaction is needed.

Record-Triggered Flow

Record-Triggered Flows execute automatically when a record is created, updated, or deleted. There are two execution timing models:

Before-Save (Fast Field Updates)

Runs before the record is committed to the database. Use Before-Save flows to make fast, efficient field updates on the triggering record (replace lightweight triggers). They do not support actions that require the record to exist in the database (like creating related records).

After-Save

Runs after the record is saved. Use After-Save flows to perform actions that require the record ID or a committed record state — creating/updating related records, sending emails, calling Apex, or invoking external services.

Schedule-Triggered Flow

Schedule-Triggered Flows run on a defined schedule (hourly, daily, etc.) and process records that meet specified criteria at runtime. Use them for batch updates, cleanup tasks, or scheduled notifications without needing Apex scheduled jobs.

Platform Event-Triggered Flow

Platform Event-Triggered Flows listen for platform events and execute when an event message is received. Use them for event-driven integrations or asynchronous workflows that react to external systems publishing events.

When to Use Each Flow Type

Screen Flow: guided user processes, wizards, multi-step input.

Before-Save Record-Triggered Flow: fast field updates on the same record — very efficient.

After-Save Record-Triggered Flow: creating related records, complex logic, sending emails, calling Apex.

Auto-launched Flow: reusable backend logic callable from other components or code.

Schedule-Triggered Flow: recurring batch operations and scheduled housekeeping.

Platform Event-Triggered Flow: real-time event-driven integrations and asynchronous processing.

Best Practices

Keep logic modular: use Auto-launched Flows for reusable units and call them from Record-Triggered or Screen Flows.

Prefer Before-Save flows for simple field updates to improve performance and reduce CPU time.

Use After-Save flows for operations that need the record’s ID or to work with related records and callouts.

Monitor limits: bulkify flow logic (use collection operations), avoid heavy queries inside loops, and use scheduled flows for batch operations where appropriate.

Quick Apex Example (Invocable Method for Flow)

When calling Apex from Flow, implement an Invocable method. Example signature:

public with sharing class FlowHelpers {
@InvocableMethod(label='Process Records' description='Process record list from Flow')
public static void processRecords(List recordIds) {
// Apex logic here
}
}

Conclusion

Choosing the right Flow type depends on whether you need user interaction, immediate field updates, post-save actions, scheduled processing, or event-driven behavior. Mastering these Flow types helps build scalable, maintainable, and efficient declarative automations on the Salesforce platform.