A lot of people might think that Process Builder scheduled action is essentially a more powerful version of the Time-Based Workflow whereas actions can be triggered after certain amount of day or hour when the rule criteria is subsequently met. It seems like both should work the way we expected. Well, not so fast. Let me explain to you what's different. In fact, this is the main reason why I have to use Time-Based Workflow instead of Process Builder.
Here's my case scenario here.
I have a checkbox field called Fully Paid on Opportunity. This checkbox will be checked via Workflow or Process Builder when the full payment amount is set. Ideally, what I would want it to happen is that when an Opportunity is Closed Won and the Fully Paid checkbox is not set for the next 7 days after the initial closing date, I will fire up an email notification to the owner and related department. Very simple and straightforward.
So, my first choice was to go with Process Builder because it was claimed to be a better, more powerful tool than the regular workflows. So here's what I have setup in Process Builder.
The way how Process Builder handled the scheduled actions is by pausing and waiting interview in Flow.
To test it out, I manually set the Opportunity Fully Paid after the Opportunity is Closed Won and the paused flow is disappeared!
I guessed it should be working fine by now so I rolled that up into production environment. In order to make sure email got fired up correctly, I also cced myself in the email.
After 7 days since the Opportunity closing date, I started receiving email notification regarding to the incomplete payment due. I didn't think there's any issue for a second until a colleague told me one day that she's still receiving email even when the opportunity is fully paid! When I checked the email content (I have put some details like payment details and fully paid checkbox as well as the link to the Opportunity), I realized that emails got fired up regardless of the criteria that I defined in Process Builder (ideally it should get triggered only when Stage is Closed Won and Fully Paid is unchecked subsequently).
I took a deeper look at all the paused interview flows and found out that some paused interviews were still there even when the Fully Paid is checked!
After some time of testing, I just found out the reason why it didn't work. The reason is that when I was doing the testing, I was manually set the Fully Paid checkbox. In fact, this Fully Paid checkbox is checked via Workflow or Process Builder! The criteria did not get reevaluated when the update action is not done via user interface! (not through background process like Apex, Workflow, and etc.)
Now I know what's the real issue causing this. Anyway, I decided to give time-based workflow a try.
Searching through Time-Based Workflow, I saw a record is created after I closed won the Opportunity again without Fully Paid.
Now, I reconstruct the scene where the payment amount is all fully set which will then trigger the Workflow to update the Fully Paid checkbox to true. When I refresh the Time-Based Workflow page again, the record is gone.
See the difference?
To recap, Process Builder Scheduled Action does not reevaluate the criteria when the update action is not via user frontend interface (will not respect update via backend process like Apex, Workflow, and etc). Meanwhile, Time-Based Workflow respects and reevaluates any kind of update action.
Thanks for reading! I shall see you in next post!
Post was published on , last updated on .
Like the content? Support the author by paypal.me!