Workflow Rules vs. Process Builder (Feat. APEX & Flow)
By Michael A. Grandel
March 01, 2021
Automating business processes for your users can take your applications from “nice” to legitimately useful. A savvy admin can save users time and clicks while creating consistency of processes and increasing data integrity, so mastering the tools available on the Salesforce platform can be very valuable to any organization.
In the evolution of Salesforce automation, Workflow Rules were the original automation tool. Then came the Salesforce Process Builder, with its visual interface for mapping automation. Now, all updates are being focused on Salesforce Flow – which we cover briefly in this guide. For a more in-depth look at Salesforce Flow, check out: Process Builder Vs Flow.
Workflow Rule
Workflow has been an admin’s friend for a long time. Workflows can:
Update a field
Send an email
Create a Task
Send an outbound message (communication with another system)
These can be initiated when a record is created, whenever it meets a certain condition, or whenever it is first set to meet a certain condition. The actions can be performed in any combination and can even have a time delay, rather than be performed immediately.
Salesforce Process Builder
SalesforceProcess Builder is a newer tool for admins which is even more powerful. In addition to everything a workflow can do (except for sending outbound messages), you can:
Create a record (not just Tasks!)
Update related records
Launch a Quick Action
Post to Chatter
Launch a Flow
Call Apex code
Submit for approval
Invoke another process
The Salesforce Process Builder also extends upon the things that workflow does. For updating related records, Process Builder can update any field on any related record, where Workflow can only update some fields on a parent record of a Master-Detail relationship. Process Builder can also update multiple related records in a situation when all of a record’s child records need the same update.
Also, Process Builder finally gives admins the ability to set the exact order of operations, whereas with Workflow we had no control. No more complex workarounds to be able to ensure things happen in a certain order!
Since Process Builder also has the ability to configure multiple if-then conditions in one Process rather than separate Workflow rules, it helps new admins and admins who inherit orgs visualize the business processes with its sleek visual interface.
Process Builder has versions, so you can retain deactivated Processes. This can be very helpful if you realize something isn’t working and want to look back to what was happening before.
The Future of Process Builder & Workflow Rules
Declarative tools such as Workflow & Process Builder have been an Admin’s best friend for many years, but this will now change…
While Process Builder has been the poster child of declarative automation for many years, Salesforce has now decided to focus on Flow. In fact, you can no longer create new Workflows and existing ones need to begin to be migrated to Flow before the full retirement at the end of 2022.
If you are unfamiliar with Flow, I highly recommend you check out this extremely powerful tool that is comparable to how Apex code works, but with a point-and-click interface. If you are looking to future proof your skills, it looks like Flow is the future.
Flow
Salesforce Flow is the most powerful automation tool that Admin’s have at their disposal. If a Salesforce automation tool reaches its limitations, you would usually turn to a Developer to implement Apex, but Flow’s comparably powerful. With Flow you can…
Display data to your users with screen elements (Think a wizard style interface)
Control logic by creating branches and looping over data sets.
Lookup, create, update, or delete Salesforce records.
With these features, Flow works in a very similar way to how Developers code Apex, which gives you the power to create similar functionality.
Salesforce has now turned to Flow as their favorite automation tool to keep updated in each release, so get ahead of the curve and learn flow today!
Apex
Finally, there’s always Apex to help you achieve “everything else” — whatever business requirements you have that can’t be accomplished through declarative configuration. If you have access to a developer, with Apex the sky is the limit. With Apex you could do the following:
Delete records
Update unrelated records
Share records with more complex criteria than Sharing Rules permits
Add/remove users in Chatter Groups and Public Groups
Create email templates that pulls info from multiple records and Objects (combined with Visualforce)
And more
Apex is powerful tool, but do your best to minimize its use. Don’t be afraid to employ it, but makes sure you think it through thoroughly to determine if there is a way you can accomplish what you need declaratively. Using Apex means that you’ll need to write test coverage and the more Apex you have, the longer it will take deployments from Sandboxes because the changes need to be validated against all of the code.
Summary
By knowing the tools available, what they can do (and their limitations), and when is best to use each, you’re in a position to give your users the best experience possible while also creating an environment for your organization to have the best data possible.
The Author
Michael A. Grandel
Michael is the Principal at Lot 48 Consulting. He is 15 x certified, a Salesforce MVP, and co-leader of the Baltimore, MD Administrators group.
Omnichannel vertical processes are incredibly valuable. Take a look here to learn how we approached this at Vlocity. https://vlocity.com/platform#omniscript.
The use of flow adds more options and flexibility often without the use of (apex) trigger development. However ... not all objects are exposed to workflow, flow and or process builder so it requires some exploring. From my experience ... the lack of support for auto-launched flow for community users and not being able to apply a template (id) for sending emails using from would really be a huge benefit.
Depending on your org and the complexity of existing workflows, triggers and the like you have to very careful deploying a Process Builder solution - It can easily hit system limits and also we have found it to impede existing processes in some cases and prefer to deploy a workflow rule instead of spending time to debug .... At the same time we do have some PB processes and they do work fine
Thanks for your comment Nersi and I do agree. David Liu has gone a great post on comparing all three in a detailed manner here - http://www.sfdc99.com/2018/01/22/workflow-process-builder-flow-apex/
Really good article. Completely agree. I would like to add that when you combine Workflows and Process builders in an object given, Workflows are executed first. In my opinion sometimes is a good combination use both. For example, I prefer Worfklows to create time depedent actions if it is possible (Process Builder doesn't allow search time actions very well), and when this actions are executed use Process Builders to bulkify business logic
Great article but, "using Apex means that you’ll need to write test coverage and the more Apex you have, the longer it will take deployments from Sandboxes because the changes need to be validated against all of the code" is not necessarily true because test cases just need to cover at least 75% of the code in order to deploy. Definitely agree with the main point of this article, even Salesforce states you should use the OOB tools (i,e. Workflows, Process Builder, Data Loader) about 70% of the time and Apex about 30%
Are there limits to the number of active processes? I need 95 active workflow rules and am limited to 50. So, I'm wondering if I can have 95 processes. Thanks!
Hi Tina,
You can find more information on process limits here: https://help.salesforce.com/articleView?id=process_limits.htm&type=5
Don't forget that with PB you use nodes to evaluate different criteria so you can combine rules and outcomes.
Christine
Hi Stephen,
Thanks for your feedback. We try to keep all articles up to date and remove those that are no longer relevant. Workflow Rules vs. Process Builder (Feat. APEX & Flow) has been updated in March 2021.
Christine
Comments: