Sub topic 9
Workflow Rules and Process Builder: what they were and why they are legacy
This chapter assumes you know the Salesforce data model, can find your way around Setup and the Object Manager, and have seen a record-triggered flow. You will learn what Workflow Rules and Process Builder did, why Salesforce moved away from them, and how to recognize them in an org you inherit.
Where these tools fit
Workflow Rules and Process Builder are the two declarative record automation tools that Flow replaced. Both still run in many orgs. Salesforce has stopped adding features to them and has announced an end-of-support schedule, so Flow is the tool for all new work.
| Tool | Introduced as | Triggered by | Main strength | Main limit |
|---|---|---|---|---|
| Workflow Rule | The first point-and-click record automation | Record create or edit | Simple and fast for four fixed actions | Cannot create records or call Apex (except through an outbound message to external systems) |
| Process Builder | A visual successor to Workflow Rules | Record create or edit, platform event, or another process | Multiple criteria, record creation, Apex calls | Slow, hard to debug, and one process per object is the only way to control order |
| Flow | The current strategy | Record changes, schedules, screens, events | One tool for all of the above | More concepts to learn |
Workflow Rules
A Workflow Rule has three parts: an object, criteria that decide when it fires, and actions. The criteria can be a formula or a set of field conditions. The rule can be evaluated when a record is created, or every time it is created or edited, with an optional "only when changed to meet criteria" variant.
A Workflow Rule can run five kinds of action:
- Field update, which changes a field on the same record or, through a master-detail relationship, the parent record.
- Email alert, which sends a template-based email.
- Task creation, which creates a task assigned to a user.
- Outbound message, which sends a SOAP message to an external endpoint.
- Time-dependent action, which queues one of the above to run some time after or before a date on the record.
The restrictions explain why people outgrew it. A Workflow Rule cannot create arbitrary records, cannot loop over related records, cannot read other objects, and cannot run Apex. Updates go to the triggering record or to a master record only. If the requirement is "when an opportunity closes, create a renewal opportunity", a Workflow Rule cannot do it.
A subtle behavior: the field update re-fire
A Workflow Rule field update can re-evaluate the object's triggers and rules once more. The setting "Re-evaluate Workflow Rules after Field Change" on a field update controls this. If you leave it enabled in the wrong place, you can create loops that stop only when Salesforce reaches its recursion limit. When you read an old rule, always check that checkbox.
Process Builder
Process Builder replaced the single-rule model with a canvas. A process starts from an object or an event, then runs ordered criteria nodes. Each node can run immediate actions, scheduled actions, or both.
Process Builder added what Workflow Rules lacked: create a record, update related records, post to Chatter, submit for approval, launch a flow, and invoke Apex. It could also call other processes.
Why it became a problem
Process Builder worked well for small cases and badly at scale. These are the recurring problems:
- Performance. A process runs after the record is saved. There is no equivalent of a before-save update, so every field change on the triggering record costs an extra update and re-triggers the save logic. Before-save record-triggered flows avoid that extra update.
- Versioning and maintenance. Each process has versions, and only one is active. Teams ended up with many processes per object, each with its own criteria and no way to see their combined behavior.
- Order. Multiple processes on one object have no guaranteed order. You cannot rely on process A finishing before process B.
- Bulk behavior. Process Builder bulkifies better than many early Apex triggers, but the criteria evaluation and each action still count against limits, and large data loads can hit them.
- Debugging. Error messages are generic ("An unhandled fault has occurred in this process"), and there is no step-through debug tool equivalent to the Flow debugger.
- Missing features. Process Builder has no loops, no collection handling, no screens, no fault paths, and no subflow reuse in the Flow sense.
What "legacy" means in practice
Salesforce has retired both tools in stages. You can no longer create new Workflow Rules or new Processes in new orgs by default. Existing ones keep running until the end-of-support date, which Salesforce announced as December 31, 2025. After that date, Salesforce does not provide support for them or fix issues, and the company has said that it may stop them from running at a later date. Check the current Salesforce release notes and help pages for the exact status in your org, since dates and behavior can change.
"Legacy" therefore means three things:
- No new features. Every new capability, such as fault paths, scheduled paths, entry conditions, and Flow Orchestrator, goes into Flow.
- No support commitment after the end-of-support date.
- A growing skills gap. New admins learn Flow and may not know the older tools.
Legacy does not mean broken today. A working Workflow Rule that sends one email alert is a low-risk item and can wait. The risk is in rules and processes that no one understands.
Recognizing legacy automation in an org
Look in these places before you change anything on an object:
- Setup, Workflow Rules, for rules, with the object filter.
- Setup, Process Automation Settings and Process Builder, for processes, including the inactive ones.
- Setup, Flows, where Process Builder processes appear with the process type "Process" and where Workflow-style flows appear with the type "Autolaunched" or "Record-Triggered".
- The object's Field Dependencies, Field Updates, and Email Alerts pages, which show reuse of field updates across rules.
- A field's Where is this used? report, which lists rules and processes that reference it.
Inventory with a metadata query
When you must catalog many items, query the metadata instead of clicking. This script uses the Salesforce CLI to list flows and their process type. It assumes you have authenticated an org with the alias myorg.
sf data query \
--use-tooling-api \
--target-org myorg \
--query "SELECT DeveloperName, ProcessType, Status FROM FlowDefinitionView WHERE ProcessType = 'Workflow'"In this query, ProcessType = 'Workflow' selects Process Builder processes, because Process Builder processes are stored as flows with the process type Workflow. Workflow Rules are a separate metadata type and do not show up here. Retrieve them with the metadata API type WorkflowRule.
Reading the old behavior correctly
Before you rebuild an automation, write down what it does, not what its name says. Use this short method for each rule or process:
- Note the object and the trigger: create only, or create and edit.
- Note the criteria and whether "only when changed" logic applies.
- List every action, immediate and scheduled.
- Mark which actions change the triggering record (candidates for before-save flows) and which touch other records or send messages (after-save).
- Find the dependencies: fields used in criteria, flows launched, Apex called, and other rules that fire because of the field updates.
The order trap
When Workflow Rules and Process Builder both exist on an object, Workflow Rules run first in the order of execution, and processes run later, as part of the flow-like phase. The field updates from the workflow can then trigger the process, and the process updates can re-fire triggers. The next chapters cover this in detail. For now, remember that the combined behavior of legacy tools depends on the order of execution, not on the order you see on the screen.
Rebuilding as Flow
A typical mapping looks like this.
| Legacy behavior | Flow equivalent |
|---|---|
| Workflow field update on the same record | Before-save record-triggered flow with an Assignment or an Update on `$Record` |
| Workflow email alert | After-save record-triggered flow with an Action element for the email alert |
| Workflow task | After-save flow with a Create Records element for Task |
| Time-dependent action | Scheduled path on a record-triggered flow |
| Process Builder criteria node | Decision element or entry condition |
| Process Builder immediate action to update related records | After-save flow with Get Records, a loop, and an Update Records on a collection |
Do not copy the old structure box for box. Merge the rules for one object into one or a few flows, put the cheap checks in the entry conditions, and use before-save wherever the change affects only the triggering record.
Salesforce also offers a Migrate to Flow tool in Setup for Workflow Rules and Process Builder processes. It converts supported items into flows. Treat its output as a draft: review each element, run the flow debugger, and test with bulk data. Items that the tool cannot convert, such as outbound messages or some Apex actions, need manual rebuilds.
Common mistakes
- Treating an inactive Process Builder process as deleted. An inactive version can be reactivated by another admin. Remove versions you replaced, after you have saved the metadata.
- Migrating by object name only. Time-dependent actions queued by a Workflow Rule stay in the queue after you deactivate the rule, in some cases. Check the Time-Based Workflow monitor for pending actions and clear them intentionally.
- Missing recursion. A migrated flow that updates the same record in an after-save flow can re-trigger itself. Use before-save for same-record changes or add entry conditions that prevent a second run.
- Moving everything at once. Migrate one object at a time, starting with the one that has the simplest rules, and keep a rollback plan.
Exercise
An org has a Workflow Rule that sets Rating to Hot when an account's annual revenue reaches 1,000,000, and a Process Builder process that creates a follow-up task for the account owner when Rating changes to Hot. Which Flow types would you use to replace them, and why? What risk do you need to avoid during the cutover?
Show answer
Use a before-save record-triggered flow on Account to set Rating, because the change only affects the triggering record and a before-save flow needs no extra update. Use an after-save record-triggered flow to create the task, with an entry condition that Rating is changed to Hot, because creating a Task involves another record. Alternatively, put both in one after-save flow, but then the Rating update causes an extra save. The cutover risk is running the legacy items and the new flows at the same time, which would create duplicate tasks. Deactivate the Workflow Rule and the process in the same release that activates the flows, and clear pending time-based actions if the rule had any.