Salesforce coding lessons for the 99%
Finally, Apex tutorials for point-and-click admins! Written by a self-taught Google engineer.
  • Beginner Tutorials
    • Apex
    • Certifications
    • Career Info
    • Technical Architect
    • Visualforce
    • Videos
  • Apex Academy
  • Success Stories
  • About Me
  • Misc
    • Mailbag
    • Challenges
    • Links
    • Login to my Org
Follow @dvdkliuor SUBSCRIBE!

Workflow, Process Builder, Flow, or Apex?

January 22, 2018

Ah, the toughest question of our generation! Which tool are you supposed to choose?

You’ve all heard the Golden Rule of Salesforce: “Use the simplest tool for the job!”
…but does that really apply in today’s era of Lightning?
…should every org follow the Golden Rule, or are there exceptions?

I argue that the Golden Rule is NOT so golden nowadays!
A strong Salesforce professional will recommend the best tool for each specific scenario.

For example:

  • Work for a stock trading company? You might prioritize speed!
  • Work for a medical devices company? You might prioritize testability!
  • Have high profile clients/executives logging in frequently? You might prioritize user experience!

To learn more, check out my latest talk: Clicks vs Code: Which Tool Should You Choose?

Sneak Preview:


Full Presentation:

(Unfortunately there is no video recording of this presentation!)

Hope you enjoy!
David

P.S. shoutout to Tahoe Dreamin’ for letting me present this! See ya’ll there next year!

30 Comments
Jarod
March 10, 2021 @ 7:16 am

With all of the updates to Flow over the last couple of years, I’m curious if you have any updated visuals. I’d be particularly interested to see your assessment of Flow vs Apex given all of the recent updates.

Reply
    David Liu
    March 10, 2021 @ 7:43 pm

    Flow is a lot better now! At the same time, orgs are getting more ambitious with what they want in Salesforce!

    Reply
      Martin
      April 28, 2021 @ 5:29 am

      So, David – would you say that flows also increased in Speed?
      They gained tons of functionality, but I have not been able to measure any increase in speed so far.

      Reply
Michal
October 23, 2020 @ 1:45 am

Hi David,
I went through your Apex Academy on Pluralsight and I think I got it there perfectly.
Due to some restrictions in our company, I won`t get to coding so Flowbuilder is maximum.
I am doing some Trail on this but everything is just a fog for me. I see the Apex behind, but it`s like behind the thick cloth

Could you, please, help me find some resource which would put me onto right track and understand the Flowbuilder with help of basic Apex knowledge. Everything I found is explained upwards , no coding required etc.

I know, I am a wierdo , but somehow, the coding is easier for me to understand than lots of fancy graphics , resources and connectors.

Reply
    David Liu
    October 23, 2020 @ 8:09 am

    Very interesting! Yes actually in many ways coding is easier to read as it’s all in front of you, rather than hidden in the flow UI. And yes coding is a universal language where flow is not. Personally don’t know too much about flow courses but I would recommend searching for Jen Lee’s and Automation Champion’s website

    Reply
      steven wilson
      November 23, 2020 @ 9:50 am

      any change of the 2020 version

      Reply
kyle
July 22, 2020 @ 12:05 pm

Would love to see the graphic updated to match recent releases! IE better flow debugging.

Reply
Nick Worth
July 20, 2020 @ 10:11 pm

Love the visuals so much! Curious if you will continue to update this as the products evolve. For example I see a bright future with Flows that would make it much more adoptable and yet still quite powerful.

Reply
Pete
June 15, 2020 @ 1:51 pm

Love the diagrams. One vector you may want to consider is “Rigidity”, i.e. how does each tool cope with re-naming or re-labelling fields. In this case Process Builder scores about minus 375…

Reply
Chris Uttley
May 12, 2020 @ 2:55 pm

Just wondering…..I want to prevent a user from saving a record under complex conditions that a validation rule cannot do. I could write a FLOW that would analyze the data and determine if the save can proceed or not….but as I understand FLOW, if triggered by a field update, the FLOW cannot interact with the user….in other words, the field update would be done by the user and then the FLOW would run.
Is there any way to have a FLOW prevent a record save?
All help appreciated!

Reply
    Eddie Zaragoza
    March 23, 2021 @ 7:24 am

    Hey Chris! I realize this is almost a year later but can you have the flow check a box if the decision criteria is met and just have a validation rule on that checkbox where it can’t be checked?

    Reply
Stephen Tangerman
September 13, 2019 @ 1:41 pm

Great article David, this is a great resource to show clients when they form the immediate opinion that Flow/ProcessBuilder is good, Apex is bad.
There’s a place and time for each.

Testability remains one of the major drawbacks of the declarative side of the house.

Reply
    Richard Clark
    September 15, 2019 @ 4:58 am

    Stephen – Agreed. For testability declarative test automation tools like Provar are there to fill the gap and bridge both. While not everyone can afford paid tools, it’s much cheaper than employing developers to create code.

    There are also free tools to undertake some UI testing which kinda work if you only want to run them in a single environment.

    Declaration: I am a Provar employee.

    Reply
Melissa Shook
June 25, 2019 @ 12:43 pm

Hey David-

This is a great presentation/powerpoint. This is one of the most important discussions of post-Lightning Salesforce. I especially love the radar charts at the end.

Reply
    David Liu
    June 25, 2019 @ 1:21 pm

    Thank you!

    Reply
Socio
June 25, 2019 @ 8:53 am

David, any easy way we can know which flow is invoking Apex ?

Reply
    David Liu
    June 25, 2019 @ 1:20 pm

    Not that I know of!

    Reply
Krishnakumar
April 28, 2019 @ 9:45 am

Good Presentation. Thanks David.

Process builder and Flow Builder have edge when we go for Large Volume data. We usually Deactivate all workflows and validation rules before Large Volume data insert or update to get better performance.

With Lightening , we can deactivating only limited number of Process builder or Flow builder for LVD . We don’t miss anything to deactivate.

Reply
Richard Clark
May 1, 2018 @ 1:32 am

Interesting read and a good summary, not sure I agree with some of your scoring however, for example Workflows often cause production errors, I’m sure we’ve all seen the dreaded ‘invalid cross reference id’ because a workflow is assigning a lookup a record value not visible to the running user!

I would also say Workflows are slower than PB too, in that when you have multiple workflows on the same object then a single PB process is much faster. I’ve seen benefits in live orgs where Opportunity Save has been reduced from 7 seconds down to 3 by optimising 25 workflows into 2 processes with multiple evaluation criteria. You’re clearly correct when it comes to a single criteria though, in both speed to implement and execute.

I’d also argue (as someone who works for Provar – the Salesforce Test Automation tool) that the declarative tools are just as testable as code, albeit requiring a product such as ours. As Provar is a no-code solution this levels the playing field for testing business logic irrespective of the solution used to implement it.

Reply
Jessica Murphy
January 23, 2018 @ 10:54 am

This is wonderful! Thank you :)

Reply
Vicky
January 23, 2018 @ 9:45 am

Hi David,

Thank you for sharing this great presentation. I do have a question about the limits category. Next to PB and flows, what do you mean when you say ‘Apex limits, without Apex control’?

I’m running into some errors with a new process builder and believe it might be related to a trigger. Could you further explain?

Thanks for all the support!

Reply
    David Liu
    January 23, 2018 @ 11:08 pm

    Thanks!

    PB and Flow run on the same engine as Apex, so they can hit the dreaded “101 SOQL query” error just as easily!

    Unlike Apex, you can’t really optimize your PB/Flow to get around this though unfortunately!

    Your error could very well be a combination of PB limitations and/or unoptimized code!

    Reply
      Vicky
      January 24, 2018 @ 10:25 am

      Perfect, that makes sense. Thanks for your help as always!

      Reply
      Edgar S
      November 22, 2018 @ 6:37 pm

      Hey David,
      I think with the flow updates that have been made, and the updated flow tool coming soon, this may be something to re-evaluate. For example, self-bulkification and the ‘debug’ function.
      And one quick thing to note, in the presentation you have for Flows UX: Good, but the chart shows as Bad.

      Thanks for all you do for the community!

      Reply
      Steven
      December 5, 2019 @ 5:59 am

      David,

      IMO to some extent you can get around limits using Flow, at least moreso than process builder. In PB, you have no choice but to query any time you a value, but in flow you can pull a whole collection of records down and loop through them with decisions to see if they are what you need. 1 query vs. n queries.

      Reply
Mh
January 23, 2018 @ 6:24 am

You are the best.

Reply
Rathnam
January 23, 2018 @ 1:25 am

Great Work # Well done Sir

Reply
Christian Tolu
January 23, 2018 @ 1:02 am

Great article, thank you.
I have found one thing that I would like to do with a process builder.
I wanted to have a process builder that controlled when all other process builders were called (for one object), however when I called a process builder from another I lost the previous values of that object. As far as I know it is working as designed, but it would have been really nice.

Reply
Sitanshu Tripathi
January 22, 2018 @ 10:04 pm

Well Done #David Sir

Reply
Shen
January 22, 2018 @ 10:02 pm

great!
Thanks so much for your continuous good lessons!

Reply

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *


*

*

Theme: Simple Style by Fimply