Flow Builder
Salesforce Flow Builder is an inbuilt automation tool offered by Salesforce which is used to automate complex business processes such as sending an email, executing logic, interacting with the Salesforce database, call Apex classes and collect data from users, etc. Also, It can be used to build code-like logic but without using a programming language by just drag and dropping elements.
As an admin, Flows are going to be the user’s best friend because the user will be able to handle the majority of complex business requirements without the help of a Salesforce developer.
How Do You Call a Flow in Salesforce?
To call a Flow means starting the Flow Process in order to do something. This could be a Salesforce record change, schedule emails, execute apex class, and many more.
When a user creates a new Flow, a pop-up will come out to select the type of Flow that you want to create.
Flow is divided into five parts as Shown above image :
These types of flows have a user interface element (which can interact with the user) and allow users to put inputs.
Screen Flow can be called through a button or action and displayed in a Lightning Page or the Utility Bar, as a screen to the users that they can interact. This flow cannot able to automatically called.
Auto Launched Flows can be used to perform actions automatically behind the scenes. With this flow, users can run automated tasks that are invoked from the process builder, within an Apex class, in case of record changes and platform events.
Record-triggered Flows are used to perform actions in the background when a record is created, updated, or deleted.
Schedule-Triggered Flow launch at a specified time and they run in the background. This is useful for tasks that need to be performed daily on a set of records or take place at a scheduled time.
Platform Event-Triggered Flows are called when a platform event is received, this flows run in the background similar to an Auto-launched Flow.
Elements of Salesforce Flow builder
Here, we explain elements of Flow builder that are visible on the screen.
Whenever users opens Flow, On the left side of Flow, They will see a set of tools which is depending on the type of Flow that you are working on it.
Manager Tab
In the below image, You can see the Manager tab that contains the existing elements and New resources of the Flow (This is from an Auto-Launched Flow).
This is where your Resources like Variables, Collections, Constants, formulas, and Choices are stored.
Variables are where you can store data to use in the Flow. This can be text, number, record, dates, currency, boolean, and picklists.
Collections are a group or list of Variables that are stored together. Collections allow you to process multiple records at once in Flows.
Constants are values that you set once and never change. They are useful when you want to refer to a single value multiple times through your Flow. If you ever need to change that value, you just need to change it once and it is reflected throughout the Flow.
The formula displays a dynamic value depending on other values within your Flow. If you need to calculate a future date based on when the Flow was run then a Formula will be helpful.
Choices are used within Screen Elements to display an option to the user.
Elements Tab
Next, you have the Elements tab. In the below image, you can see Interaction, Logic, and Data Elements. These are showing dynamically depending on the type of your Flow.
A Screen element is only available in a Screen Flow that allows a user to present a screen to another user. This screen can display information and collect information from the user.
An Action element allows you to perform some standard or custom action such as Send Email, a Quick Create, or custom Apex action.
A Subflow element allows the user to call another Flow with the help of your current Flow. This means if you have another complex Flow then you don’t need to repeat the logic in your new Flow.
Decisions allow users to split their Flow into multiple if-else conditions depending on the data.
Assignments allow users to give a value to a variable.
Loops allow users to perform an iteration using collections.
If a user wants to perform data manipulation operations into the Salesforce database then user has to use one of those Data elements.
Flow Builder Actions
Salesforce provides various types of actions in Flow builder that include :
- Create, Update and Delete records
- Loop through records
- Submit for approval
- Adding in pause or ‘Wait’ elements
- Generating PDF and send as an email
- Sending email and custom notification
- Refresh decision table
- Post to Chatter, Log a call, Task, and Event, etc.
When & why should I use a flow?
Salesforce flows can be used when you need to automate complex business processes. If you need to perform mass updates or create complex logic these are some common examples for when you should use Flow.
Also, if you are not done something with workflow or process builder then you must use Flow builder for an automation. User can a lots of things Flow builder.
Key Benefits of Using Salesforce Flow
- Salesforce Flow is easy to maintain because anyone (assuming they know Flows) should be able to follow along with what you built.
- Flow support screen user interface, Thus Users can be interact with it.
- Flow allow to Query any object and also perform database operations such as Create, Update, Upsert and Delete.
- Flows can be run either before or after a record has been saved to the database but process builder trigger only after a record has been saved.
- Flow can design a logic scenario same as coding by just using drag and drop elements.
Limitations
- In case a flow exceeds a governor limit then the complete transaction or changes made by the transaction will be rolled back.
- Flows have usage-based entitlements that determine how many flow are allocated to user per month. User can find it atSetup -> Company Information.
Considerations
- Flow can access the data only if the running user has permission to access the fields. In case Flow tries to update a field and field is not editable by the user then flow will fail. This scenario can be avoided by using the setting Filter inaccessible fields from flow requests.
- Above setting can be found in Setup->Process Automation Setting.
- When a user session expires then in-progress flow will be interrupted and cannot resume again. If the flow executed actions such as record manipulations then those actions will not rolled back But run any other progress through the flow such as user data entered on the screen, will be lost.
To read more about flow limits and considerations Click here
Comparison Between Flow, Process Builder & Workflow
Originally published at arrify.com on July 2, 2022.