How do Record-Triggered Flows replace legacy workflow rules and process builders for database automation?
Answer
Basics: Workflow Rules (field updates, email alerts, tasks, outbound messages) and Process Builder (processes) were Salesforce's older declarative engines. You can no longer rely on them for new work. Record-triggered flows can do everything they did and more, using one tool and one execution model.
How it works:
- Setup > Flows > New Flow > Record-Triggered Flow.
- Choose the object and trigger: created, updated, created or updated, or deleted.
- Set entry conditions and, for updates, whether it runs every time the criteria are met or only when the record is updated to meet them.
- Choose optimization: Fast Field Updates (before-save, edits the triggering record only) or Actions and Related Records (after-save, can create/update other records, send emails, call Apex/subflows).
- Add Scheduled Paths (run later relative to a date) or an Asynchronous Path (after commit, for callouts).
- Activate; use the Migrate to Flow tool to convert existing workflow rules and processes.
Advanced / deep dive: Order of execution: system validation, before-save flows, before triggers, custom validation, duplicate rules, save, after triggers, assignment/auto-response/workflow rules, escalation, after-save flows, then roll-up and commit. Before-save flows run first and are the fastest option because they avoid a second DML, so use them for same-record field defaults. Flow shares limits with Apex (100 SOQL, 150 DML, 2,000 elements per interview) and cascades: an after-save flow updating a record re-runs triggers and flows on it, so entry conditions and $Record__Prior comparisons are essential to avoid recursion. Use the Trigger Order setting (1 to 2000) on the flow properties and Flow Trigger Explorer to control and view order across flows. Bulk safety is automatic in the engine, but not inside loops. Prefer one flow per object and context, or clearly named flows with non-overlapping criteria. Flows support fault paths, subflows and invocable Apex for hard problems, and Flow Orchestration for multi-step, multi-user work.