Overview
Salesforce Flow is the primary automation tool in Salesforce for building point-and-click business logic. Understanding the different types of flows — when to use each, their triggers, and their limitations — is essential for architects and developers designing scalable, maintainable automation.
Primary Flow Types
Screen Flow
Screen Flows are interactive flows that require user interaction through screens. Use cases include guided selling, multi-step forms, data entry wizards, and onboarding flows. Screen Flows are launched from Lightning pages, utility bars, quick actions, or custom buttons.
Autolaunched Flow (No Trigger)
Autolaunched Flows run in the background without user interaction. They can be invoked by other flows (subflows), Apex code, Process Builder (deprecated), REST API, or from buttons. Typical uses are complex calculations, batch-style processing, and reusable logic that multiple entry points call.
Record-Triggered Flow
Record-Triggered Flows run when a record is created, updated, or deleted. They replaced many use-cases previously handled by Workflow Rules and Process Builder. There are three execution types within record-triggered flows:
- Before-save (Fast Field Updates) — Optimized for fast field updates on the triggering record. Use when you only need to change the record that fired the flow.
- After-save — Use for actions that require the record to be committed to the database such as creating related records, sending email alerts, or calling external services.
- Delete — Trigger flows when a record is deleted (available depending on object and org settings).
Scheduled-Triggered Flow
Scheduled Flows run at a specified time or on a recurring schedule. They are useful for scheduled batch jobs like nightly data recalculations, sending recurring reports or reminders, and data archival tasks. Scheduled-triggered flows can be set to run on a schedule and act on records that match criteria.
Platform Event-Triggered Flow
These flows run in response to platform events. They are ideal for handling asynchronous events from internal or external systems, enabling event-driven architectures within Salesforce. Platform event flows can subscribe to standard or custom platform events and perform actions in response.
Flow Orchestration (Orchestrator)
Flow Orchestrations allow you to build multi-step, multi-user approval-like processes that coordinate several flows and human tasks. Use Orchestration for complex business processes that require staged assignments, SLA tracking, or parallel workstreams.
How Flows Compare by Trigger
Understanding triggers helps you pick the right flow type:
- User starts it → Screen Flow
- Record changes → Record-Triggered Flow (before/after)
- Scheduled run → Scheduled-Triggered Flow
- External event → Platform Event-Triggered Flow
- Background or reusable logic → Autolaunched Flow
Key Differences & Best Practices
Before-save vs After-save Record-Triggered Flows
Use before-save flows for simple, performance-sensitive field updates to avoid extra DML. Use after-save when your logic needs the record Id, related record operations, or work with external systems.
Use Subflows for Reuse
Extract common logic to autolaunched subflows to reduce duplication and ease maintenance.
Consider Limits and Performance
Record-triggered flows run synchronously and count against transaction limits. For large batch operations, use scheduled flows or Apex asynchronous options (Queueable, Batch Apex) where appropriate.
Error Handling and Testing
Always add fault paths, logging, and clear validation for user-facing Screen Flows. Test flows in a sandbox with realistic data to validate behavior and limits.
Example: Invoking an Autolaunched Flow from Apex
Below is a simple Apex example to start an autolaunched flow by API name and pass input variables:
Map
Flow.Interview.My_Autolaunched_Flow flow = new Flow.Interview.My_Autolaunched_Flow(inputs);
flow.start();
// Read outputs if any
Map
Typical Use-Cases Summary
- Screen Flow — Guided data entry, wizards, interactive UI
- Autolaunched Flow — Reusable background logic, batch operations
- Record-Triggered Flow — Automations on create/update/delete
- Scheduled-Triggered Flow — Recurring jobs, nightly processing
- Platform Event-Triggered Flow — Event-driven integrations
- Flow Orchestration — Complex multi-user processes and task orchestration
Conclusion
Salesforce Flows provide a rich set of automation options covering user-driven interactions, record-based triggers, scheduled jobs, and event-driven processing. Choosing the right flow type improves performance, maintainability, and user experience. When in doubt, favor modular design (subflows), keep performance in mind, and use before-save record-triggered flows for simple updates.








Leave a Reply