Workflow (1)

Declarative Automation Tools In Salesforce

suayanatekalkote Blog, CRM, Salesforce

It’s Thursday morning and I get an email from my Solution Architect asking me to create a flow to enable the functionality for a certain requirement.  Now, when I read the term ‘Flow’, Workflow Rule is what came to my mind. However, when I took a closer look at the requirement, I realized I would not be able to provide the needed functionality using a Workflow Rule, but would instead need to write up a Visual Flow. Now you must be wondering what the key differences are between Workflow Rules and Visual Flows, so that you know when to use which. Let me explain:

Overview:  Workflow Rules, Process Builder, Visual Flows

There are tools used in Salesforce which can help automate the process of creating and updating records.  It is important to know that each of them has its own features. The primary tools used for declarative automation in Salesforce are Workflow Rules, Process Builder and Visual Flow.

Workflow Rules

Workflow Rules help automate certain business processes but with a few limitations. Using workflows, we can assign tasks, send emails, update records and send outbound messages. Workflows are based on criteria you enter along with immediate actions to execute when specified criteria are met. They fire only when a record has been created and saved.

Process Builder

It is advisable that we start with a Process Builder when we have business processes which have simple if/then statements. Process builder has features that are similar to Workflow Rules, but with more flexibility and scalability, as a single Process Builder will accept multiple if/then statements.  When the number of conditions increases and/or when multiple process entry/exit points come into play, you should use Visual Flow for its advanced capabilities.

Visual Flows

Visual Flow is an Application that allows us to collect, update, edit and create Salesforce records and make them available to the right users and the right systems. Flows can automate different business processes, making it easy for the users and for the system to work on complex logic.  They usually require a user interaction for data entry, or they can run in the background on their own and automatically work on the processes.

Tool Features

Some of the following statements help to differentiate the automation tools and their capabilities:

  • If/Then Statements
    • Workflow Rules can handle single If/Then statements
    • Process Builder can handle multiple If/Then statements
    • Visual Flow handles complex If/Then statements
  • Field updates
    • Workflow Rules can update only the record that was the starting point or the parent of the record that triggered the Workflow Rule
    • Process Builder can update fields on any related record
    • Visual Flow can update fields on any record
  • Outbound Messages
    • Workflow Rules can send outbound messages without the need for additional code
    • Process Builder and a Visual Flow need an Apex class to be called by a process in order to send outbound messages
  • A record may be submitted for approval using Process Builder and Visual Workflow, but not when using Workflow Rules
  • A process may delete records using a Visual Flow, but not with Process Builder or with Workflow Rules
  • A process can create records using a Visual Flow or Process Builder, but not by using a Workflow Rule

 

If/Then Statements
Record Updates
Outbound Messages
Submit for Approvals
Record Deletion
Record Creation
Workflow

Single

Record/Parent Record

Without code

No

No

No

Process Builder

Multiple

Any Related Record

Apex Class

Yes

No

Yes

Visual Flow
Complex Any Record Apex Class Yes Yes

Yes

Visual Flow Tips and Tricks

  • You will not be able to activate the Flow if there is an invalid formula in the Flow.
  • There cannot be more than 3,000 characters in the formula when used in a Flow.
  • The formula expression must always return a Boolean value.
  • Global Variables are special variables that give us direct access to system objects that are in context.
  • Use of multiple assignments gives you the ability to read your Flow and know what is happening at each step.
  • If there is a loop with more than two elements, go around the loop in the same direction.
  • Grouping Flow elements is made easier for documentation purposes.

As always, any concept is a vast ocean of many features but we pick and choose a few of them based on our requirements. There are many articles on Visual Flows in Trailheads which help us deep dive into the subject more.

About the Author:

Sunayana Tekalkote is a certified Salesforce Admin, Platform Developer, and Apttus CLM Consultant. Su has a total of almost 3 years of experience in Salesforce consulting. Su is currently working on Salesforce projects with Apttus configuration, and enjoys debugging, triaging and fixing issues. When she is not at work, Su is an outdoor person and enjoys in sports. She loves to bike, hike, play volleyball and cook.