Oz Lavee
CTO ForeSight
Salesforce
Flows
Architecture Rakesh Gupta
8x Salesforce MVP
Automation Champion
Best Practices
All lines are muted for
optimal sound quality
Submit your questions
in the Q&A Box
This session is
being recorded
How to get started with flows?
—
Flows vs code – when to choose what?
—
Working with flows – best practices
—
Migration to Flows- Done Right
The low code movement is growing significantly
—
More and more application will be based on low code
1. Flow is a very powerful tool that can replace many
code-based task
2. But with great power comes great responsibility
Flows will require similar considerations as code
1. architecture thinking
2. Maintainability
3. Extendibility
Flows and the low code revolution
By 2024 low-code
application development will
be responsible for more
than 65% of application
development activity.
“
Salesforce is a key player in this movement
and Flow is their key component
Poll Question
How many of
you used
flows?
7
What is Flow?
Flows is an automation tool used for collecting,
processing, and updating information depending
on business processes.
Flows are a ‘no-code’ tool but require
understanding of basic programming concepts
like variables and how logic works.
Getting Started with Flows
8
Flow Types
A flow or flow version’s type determines which
elements and resources are supported and the
ways that the flow can be distributed.
› Screen flow
› Autolaunched Flow with No Flow Trigger
› Autolaunched Flow with a Schedule Trigger
› Autolaunched Flow with a Record Trigger
› Field Service Mobile Flow
› Field Service Embedded Flow
› Contact Request Flow
› Checkout Flow
Getting Started with Flows
Screen
Flow
Auto-
Launched
Scheduled-
Triggered
Record
Triggered
Platform
event
Triggered
Auto-
Launched
(No trigger)
9
when to
choose
what
Flow Code
Easier to Builder and Maintain
Handle complex Business
Requirements
When you want to perform
Insert, Update, create or
Delete actions
When you want to perform
Upsert action
Easier for Admins to Plug and
use
Apex or LWC
Improve Transactional Efficiency
Hard to overcome the limits
without using Apex Code
Limits exist, but you have tools
to beat them
Flows vs. Code
10
Poll Question
What kind of
flows you use
the most?
Flows
Best
Practice
s
11
Plan out your flow before you start building
› planning / design is a critical phase
› Write or draw out all the details of your
business process
› Split as needed to building blocks
› Make sure for each building block :
› What information you need ( input)
› Where you’re getting that information
from
› What logic and actions to perform
› What is the output and side effect actions
1
Flows
Best
Practice
s
12
Document your flows!
› Usually, you read 10 times more that you
write
› Stick to naming conventions when creating
variables and elements in Flow
› Outline the flow’s purpose, and
considerations
Don’t build your flows in production
› Build your flows in a separate environment
(Sandbox or Developer Edition org)
› Prepare test data for the various permutations
of your flow
› Define a clear development process for future
changes
2
3
Flows
Best
Practice
s
The “One Record-Triggered Flow” Per
Object – Per Type
› Avoid multiple flows per object
› Encapsulate the different conditions within
the flow
› Salesforce best practice recommend one
automation per object
13
4
Flows
Best
Practice
s
14
Utilize subflows / invocable actions - Make
Your Flows Reusable Scalable!
Sub Flows and invocable actions are a secret power
of flow
Classic use-cases for considering subflows:
› When doing the same thing in your flow multiple
times, or with another flow, call a subflow to do it
for you.
› When task include a combination of simple and
heavy lifting business logic combine flows and
invocable actions
› When your flow involves multiple processes and
branching logic, create a
main flow that launches other secondary flows
› When you have a huge flow – split it to sub flows
each responsible for a specific logic
5
Flows
Best
Practice
s
15
Don’t hard-code IDs
› Hard coded ids are the root of many
bugs
› IDs will often change when shifting from
one environment to another
› Use the results of a Get element, a
Custom Label, or Custom Metadata
instead of hard coding IDs
6
Flows
Best
Practice
s
16
Be ready for errors
› Flow has a great error mechanism
› Identify failing points
› Consider how a failed flow behaves in each
point
› Customize your error messages when
unexpected actions occur
› Use language your users understands in your
error messages
Provide maximum value for easy problem
resolution.
7
Flows
Best
Practice
s
17
Loop with cautious
› Don’t Put DML Statements inside of a Loop
› Don’t loop the loop: Avoid 'Get Records' or
'Update Records' Elements in Flow Loops
› Don’t loop over large collections of records
that could trigger the Flow element limit
› When it comes to heavy lifting -> code is
better
8
Flows
Best
Practice
s
18
Plan for the future
› Be open when future changes are planned
› Define the modularity to represent the
business
› Avoid side effects
› The effect of the flows should be
exactly what it was defined for
› Avoid hidden/additional/small/”it was
easy to do it here” changes, you are
going to chase them in the future.
› Make it readable
9
Flows
Best
Practice
s
19
Test, test and then test again 
› Testing is an art – prepare your test
cases up front
› Define what is acceptable behavior
before pushing to production
› Use Flow Builder’s built-in debug to test
your Flows before activating them
› Automate you tests
› Test your full end-to-end process, even
after your Flow has passed your initial
debug tests, bugs usually hides in the
integration points
1
0
20
Workflow Rules and Process
Builder soon to be retired.
Go with the flow
Flows is the go-to
automation tool
21
Poll Question
How are you going to
handle the retirement
of workflows and PB?
22
Poll Question
When are you
going to start
the migration?
Usage of Salesforce
Automation
Components
Workflow
Rules
54%
13%
33%
Flows Process
Builders
24
Migration to flows - Done Right
1. Scroll – rely on the backwards compatibility of salesforce, they will not break it
any time soon.
2. Walk - Do the technical migration , every workflows will be converted to a new
flow
3. Run - find some duplication of workflows and remove them , remove unused
automation.ad hoc validations
4. Fly - plan the day after -
1. mapping all the automation components and the required business logic,
2. define the merging path.
3. Plan the expected beahavior
4. Define and build test cases for each use case
5. Will end up with an automation suite ready for the future.
?
THANK
YOU!
Panaya.com
Oz Lavee
CTO ForeSight
Rakesh Gupta
8x Salesforce MVP
Automation Champion

Salesforce Flows Architecture Best Practices

  • 2.
    Oz Lavee CTO ForeSight Salesforce Flows ArchitectureRakesh Gupta 8x Salesforce MVP Automation Champion Best Practices
  • 3.
    All lines aremuted for optimal sound quality Submit your questions in the Q&A Box This session is being recorded
  • 4.
    How to getstarted with flows? — Flows vs code – when to choose what? — Working with flows – best practices — Migration to Flows- Done Right
  • 5.
    The low codemovement is growing significantly — More and more application will be based on low code 1. Flow is a very powerful tool that can replace many code-based task 2. But with great power comes great responsibility Flows will require similar considerations as code 1. architecture thinking 2. Maintainability 3. Extendibility Flows and the low code revolution By 2024 low-code application development will be responsible for more than 65% of application development activity. “ Salesforce is a key player in this movement and Flow is their key component
  • 6.
    Poll Question How manyof you used flows?
  • 7.
    7 What is Flow? Flowsis an automation tool used for collecting, processing, and updating information depending on business processes. Flows are a ‘no-code’ tool but require understanding of basic programming concepts like variables and how logic works. Getting Started with Flows
  • 8.
    8 Flow Types A flowor flow version’s type determines which elements and resources are supported and the ways that the flow can be distributed. › Screen flow › Autolaunched Flow with No Flow Trigger › Autolaunched Flow with a Schedule Trigger › Autolaunched Flow with a Record Trigger › Field Service Mobile Flow › Field Service Embedded Flow › Contact Request Flow › Checkout Flow Getting Started with Flows Screen Flow Auto- Launched Scheduled- Triggered Record Triggered Platform event Triggered Auto- Launched (No trigger)
  • 9.
    9 when to choose what Flow Code Easierto Builder and Maintain Handle complex Business Requirements When you want to perform Insert, Update, create or Delete actions When you want to perform Upsert action Easier for Admins to Plug and use Apex or LWC Improve Transactional Efficiency Hard to overcome the limits without using Apex Code Limits exist, but you have tools to beat them Flows vs. Code
  • 10.
    10 Poll Question What kindof flows you use the most?
  • 11.
    Flows Best Practice s 11 Plan out yourflow before you start building › planning / design is a critical phase › Write or draw out all the details of your business process › Split as needed to building blocks › Make sure for each building block : › What information you need ( input) › Where you’re getting that information from › What logic and actions to perform › What is the output and side effect actions 1
  • 12.
    Flows Best Practice s 12 Document your flows! ›Usually, you read 10 times more that you write › Stick to naming conventions when creating variables and elements in Flow › Outline the flow’s purpose, and considerations Don’t build your flows in production › Build your flows in a separate environment (Sandbox or Developer Edition org) › Prepare test data for the various permutations of your flow › Define a clear development process for future changes 2 3
  • 13.
    Flows Best Practice s The “One Record-TriggeredFlow” Per Object – Per Type › Avoid multiple flows per object › Encapsulate the different conditions within the flow › Salesforce best practice recommend one automation per object 13 4
  • 14.
    Flows Best Practice s 14 Utilize subflows /invocable actions - Make Your Flows Reusable Scalable! Sub Flows and invocable actions are a secret power of flow Classic use-cases for considering subflows: › When doing the same thing in your flow multiple times, or with another flow, call a subflow to do it for you. › When task include a combination of simple and heavy lifting business logic combine flows and invocable actions › When your flow involves multiple processes and branching logic, create a main flow that launches other secondary flows › When you have a huge flow – split it to sub flows each responsible for a specific logic 5
  • 15.
    Flows Best Practice s 15 Don’t hard-code IDs ›Hard coded ids are the root of many bugs › IDs will often change when shifting from one environment to another › Use the results of a Get element, a Custom Label, or Custom Metadata instead of hard coding IDs 6
  • 16.
    Flows Best Practice s 16 Be ready forerrors › Flow has a great error mechanism › Identify failing points › Consider how a failed flow behaves in each point › Customize your error messages when unexpected actions occur › Use language your users understands in your error messages Provide maximum value for easy problem resolution. 7
  • 17.
    Flows Best Practice s 17 Loop with cautious ›Don’t Put DML Statements inside of a Loop › Don’t loop the loop: Avoid 'Get Records' or 'Update Records' Elements in Flow Loops › Don’t loop over large collections of records that could trigger the Flow element limit › When it comes to heavy lifting -> code is better 8
  • 18.
    Flows Best Practice s 18 Plan for thefuture › Be open when future changes are planned › Define the modularity to represent the business › Avoid side effects › The effect of the flows should be exactly what it was defined for › Avoid hidden/additional/small/”it was easy to do it here” changes, you are going to chase them in the future. › Make it readable 9
  • 19.
    Flows Best Practice s 19 Test, test andthen test again  › Testing is an art – prepare your test cases up front › Define what is acceptable behavior before pushing to production › Use Flow Builder’s built-in debug to test your Flows before activating them › Automate you tests › Test your full end-to-end process, even after your Flow has passed your initial debug tests, bugs usually hides in the integration points 1 0
  • 20.
    20 Workflow Rules andProcess Builder soon to be retired. Go with the flow Flows is the go-to automation tool
  • 21.
    21 Poll Question How areyou going to handle the retirement of workflows and PB?
  • 22.
    22 Poll Question When areyou going to start the migration?
  • 23.
  • 24.
    24 Migration to flows- Done Right 1. Scroll – rely on the backwards compatibility of salesforce, they will not break it any time soon. 2. Walk - Do the technical migration , every workflows will be converted to a new flow 3. Run - find some duplication of workflows and remove them , remove unused automation.ad hoc validations 4. Fly - plan the day after - 1. mapping all the automation components and the required business logic, 2. define the merging path. 3. Plan the expected beahavior 4. Define and build test cases for each use case 5. Will end up with an automation suite ready for the future.
  • 25.
  • 26.
    THANK YOU! Panaya.com Oz Lavee CTO ForeSight RakeshGupta 8x Salesforce MVP Automation Champion