Don’t Hate. Automate!
By: Annie Cohen
Tags: Salesforce, Automation, Workflow

I’ll say it once, and I’ll say it again: just go with the flow! When beginning your journey with process automation, trusting in Salesforce workflow rules is the perfect way to start. Workflows are just one of the robust process automation features that Salesforce offers to enhance the productivity of data entry — saving your employees time and effort. Once you get the hang of it, creating workflow rules is as easy as drifting down a lazy river. So don’t fight the current; just go with the flow.

(Image Credit: “Workflow Rule in Lightning Experience,” Salesforce, 21 January 2018

If you are an admin with a young org, workflows are the perfect go-to when you need a quick fix in automation. Before you get started, here are three tips:

Tip #1: Set goals for automation

Said perfectly by Jonathan Keel, founder and president of 6 Street Technologies and author of Lightning Process Builder and Visual Workflow: A Practical Guide to Model-Driven Development on the Force.com Platform: “One must wrap their mind around what the business process needs to be before building any workflow rules.” This, he says, occurs in four stages:

1. Understand: Understand the processes you are trying to automate, discussing all business processes and goals before you build anything.

2. Plan: Then, map out what this might look like, most likely using flow charts. Then, you have not only a clear visual, but also clear documentation.

3. Build: This stage is straightforward. Once there is an agreed-upon design, it’s time to build.

4. Test: Although testing is crucial to the entire process, it sometimes gets skipped over to save time. However, it is extremely important to ensure everything functions properly.

Here is a great example of why testing is so important. With Workflow rules, there’s a high risk that one workflow can overwrite another. A common mistake that new admins make is creating multiple actions with the same rules. Instead, create one workflow rule with multiple actions. This way, you avoid the risk of hitting your Salesforce limit.

Tip #2: Identify the best route to build out your criteria

What’s the best route to follow when you start building out your criteria? Well, it depends on the fields you need and the complexity of your criteria. Salesforce gives you two options:

The Criteria Builder will feel familiar to any admin because of the functionality being used in many other areas throughout Salesforce. This builder gives you the ability to use a field from any object that the rule object is related to via relationship fields (standard objects) and use fields from the object selected, the user object, and any object that is the master object in a master-detail relationship with the workflow object (custom objects).

The Formula Editor is also a familiar Salesforce function. However, it may push you out of your comfort zone as you start building your own formulas. If you’re willing to take a leap of faith, it does come with benefits. With the Formula Editor, you can gain access to additional fields. Unlike the Criteria Builder, the Formula Editor allows for lookup relationships from standard to custom objects and lookup relationships from custom objects to any other objects.

When deciding which tool to use, this chart may help:

(Image Credit: “The Elements of a Salesforce Workflow Rule,” Salesforce, 20 May 2016

Or look at it this way: Since formulas are such an integral part of Salesforce development without code, creating a workflow rule may be a good opportunity to explore the Formula Editor.

Tip #3: Name your workflow rule

This tip highlights the importance of the documentation that lies within the workflows themselves: “You can always tell a great workflow rule not so much by its steps but by when it’s self-documenting,” Johnathan Keel says. “The rule name, the description, and the rule criteria should have information that a Salesforce admin can read at a glance and understand the intent of the workflow rule.”

When naming the workflow rule, make sure the name explains the intent of the rule. This also applies to naming the actions and putting necessary information into the description field. Not only can this remind you of the necessary requirements, but it also lays out a sturdy foundation for any admins who may need to edit or update the rule later.

However, as human beings, we know it’s not always smart to go with the flow. When it comes to Salesforce automation, whenever possible, automate your if/than statement with process builders instead of workflow rules. Being new to Salesforce or just new to process builders in general can launch you into a whole new world of intimidation and confusion. From the outside, they appear simple: criteria, actions … okay, seems a lot like a workflow rule. But beware: if you jump in headfirst without any sort of plan, this more advanced workflow could easily turn into a full-on riptide — carrying you and your Salesforce org out to sea with it.

That may have been a bit dramatic, but I’m here to tell you process builders aren’t as scary as they seem. Simply state the problem, figure out how to solve it, and map out your steps to get there just like you did with workflow rules. Our goal is to supply you with a few best practices to remember when starting a new process builder that will instead have you riding those waves like a pro — and maybe catching some air if you’re lucky.

Here’s why using process builders is so important. As your org becomes more complex, an object will surely have more than one scenario where automation can happen. With process builder, actions are more flexible — you can create and update records, launch an entire flow, send an email, submit items for approval, call apex methods, and even post to chatter.

Luckily, Salesforce Help outlines the best practices when designing a process builder to show its benefits over workflow rules, which end up only adding extra work and the use of apex. (Reference: Best Practices for Designing Processes)

When migrating your workflow rules to a process builder, keep these two tips in mind:

● Tip #1: Deactivate the workflow rule before you activate the process to avoid unexpected results such as overwritten records or redundant email messages.

● Tip #2: Only have one record-change process per object. If you convert workflow rules to processes, don’t create a process for each workflow rule.

When beginning to build out a master process, Salesforce provides a few features that can pave the way:

ISNEW(): This formula function detects whether the evaluated record was just created — a crucial function because some automation will only apply to records that are created. Therefore, one process can invoke another. To achieve this, add the associated criteria to a formula along with && ISNEW().

Invocable processes: You might find yourself rebuilding the same actions for multiple action groups. That’s why Salesforce created invocable processes, which begin only when another process tells them to. But how and when should you build one? Salesforce recommends configuring actions once in an invocable process and then invoking that process from all relevant action groups.

And last but not least, avoid creating infinite loops. When you are dealing with more than one process, it’s possible that two independent processes might get into an infinite loop and trigger your org limits. For example: process A has an action that triggers process B, and process B has an action that triggers process A — creating a loop that can reach your org’s limit.

To learn more about workflow rules and process builders, visit these helpful links:

Workflow Rule Examples

Trailhead: Workflow Rule Migration

Salesforce.com Help Portal

Cervello, a Kearney company is a data and analytics consulting firm and part of Kearney, a leading management consulting firm. We help our leading clients win by offering unique expertise in data and analytics, and in the challenges associated with connecting data. We focus on performance management, customer and supplier relationships, and data monetization and products, serving functions from sales to finance. We are a Salesforce partner and help our clients implement, customize, and optimize the platform into the best solution for their needs.