# How do Record-Triggered Flows replace legacy workflow rules and process builders for database automation?

**Topic:** Admin · **Difficulty:** Medium · **Tags:** Admin, Record-Triggered Flows, Process Automation

Read it on the site: https://www.forcechallenges.com/interview-questions/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:**
1. Setup > Flows > New Flow > Record-Triggered Flow.
2. Choose the object and trigger: created, updated, created or updated, or deleted.
3. 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.
4. 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).
5. Add Scheduled Paths (run later relative to a date) or an Asynchronous Path (after commit, for callouts).
6. 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.

**Code / config example:**
```
Flow: Opportunity_Before_Save_Defaults
  Trigger: Opportunity, Created or Updated, Fast Field Updates
  Entry condition: {!$Record.StageName} Is Changed True AND {!$Record.StageName} = "Closed Won"
  Assignment: {!$Record.Probability} = 100
              {!$Record.Closed_Date_Stamp__c} = {!$Flow.CurrentDate}
```

**Hidden gotchas & must-remember points:**
- Workflow Rules and Process Builder: not creatable for new work and unsupported after December 31, 2025; plan migration.
- Before-save flows cannot do DML on other records or send emails.
- Delete-triggered flows only support before-delete behavior and limited actions; verify current capabilities.
- "Every time criteria met" can create loops.
- Flows run in system context by default for record-triggered execution.
- Multiple flows on one object are not guaranteed to run in a particular order unless Trigger Order is set.

**Best practice:** Use before-save for same-record edits, after-save for related-record work, and keep entry criteria tight.

---
Source: ForceChallenges · last updated 2026-11-02
