Image
Lightning flow

Everything you would like to understand about Lightning Flow

Shravya Martha
April 6, 2020

Over decades we’ve seen radical changes in technology and the changes continue over time and the main intention behind these changes is to AUTOMATE the system. It helps Business Organizations to increase their productivity and competence. Salesforce provides several automation tools. Here, we are going to discuss about the Product Lightning Flow, the tools Process Builder and Flow Builder in Salesforce.

Lightning Flow provides definite process automation for every Salesforce app, experience, and portal. Lightning Flow has two point-and-click automation tools:

  • Process Builder, which allows you to build processes
  • Flow Builder, which allows you to build flows

Lightning Flow:

It is a product that includes building, managing, and running flows and processes.

Process Builder:

Many of the tasks you assign, the emails you send, and different types of record updates are vital parts of your standard processes. Rather than doing this repetitive work manually, you can build processes to do it all automatically. Process Builder helps you automate business processes and provides graphical illustrations.

Use Process Builder when you need to start a back-end business process automatically. Processes can start on:

  • Creation of a record
  • Updating of a record
  • Triggering of a platform event

Flow Builder:

A point-and-click tool for building flows.

Use Flow Builder to:

  • Automate a guided visual experience
  • Add more back-end functionality than is available in Process Builder. Flow Builder is used to build more complex functionality. Then call the resulting flow from the process builder
  • Start a back-end business process when a user clicks something, like a button

syntax_image

  1. Button Bar: The button bar provides information and available options for the flow, such as whether the flow is active or not and if the flow has any warnings or errors and so on
  2. Canvas: The canvas is the workspace, where you build a flow by adding different elements
  3. Toolbox: Here you can see all the elements and resources you’ll use to build your flow
Flows:

Flow is a very powerful business automation application that can collect, create, update, edit, and delete Salesforce Data. It will execute logic, call Apex classes while interacting with the Salesforce database, and guiding users through screens for collecting and updating data as per business requirements.

Flows can be implemented in two ways in Salesforce

  • Screen Flows: In this flow, there will be a series of screens to collect data from the user and perform some operation, this means that this flow type requires a user interaction. Screen flows can be accessed from custom buttons, custom links, direct URL, etc
  • Auto-launched Flow: Auto-launched Flow runs in the background with no user interaction. In addition to everywhere that Screen Flows run, we can also run it from process builder and Apex

Flow Building Blocks:

Every flow is built using three building blocks

syntax_image

  1. Elements appear on the canvas. From the toolbox you can click or drag it to add an element to the canvas
  2. Connectors define the path of the flow during runtime. They define which element to execute next
  3. Resources are containers that represent a given value, such as field values, records or formulas. You can reference resources throughout the flow. For example, look up an contact’s ID, store that ID in a variable, and later reference that ID to update the contact

Below is a quick cheat sheet of the elements available in the Flow Builder:

syntax_image Connect the Elements to Finish the Flow:

Connecting the flow elements is the most important thing that tells the flow what order to follow or what element needs to be executed at runtime.

Make Sure Users Can Run the Flow:

Add Run Flows user permission to a permission set or profile and assign it to the users to able to run the flow.

Keyboard Shortcuts:

Below are the convenient shortcuts to quickly navigate on the canvas.

  • For Windows
    • Press CTRL = -> To zoom in
    • Press CTRL - -> To zoom out
    • Press CTRL 0 -> To zoom to fit
    • Press CTRL 1 -> To zoom to view
    • Press and hold Shift and click each element to multi-select elements on the canvas
  • For Mac
    • Press Command = -> To zoom in
    • Press Command - -> To zoom out
    • Press Command 0 -> To zoom to fit
    • Press Command 1 -> To zoom to view
    • Press and hold Shift and click each element to multi select elements on the canvas

Modes of Execution in Salesforce:

  • By default, runs in User Mode
  • If a flow is invoked from Process Builder, it runs in System Mode
  • If a flow is invoked from Workflow, it runs in System Mode
  • If a flow is invoked from Apex, it runs depends on With or With Out Sharing of apex class

Debugging:

  • Exception Email: When a process or flow fails, a detailed error email will be sent to the admin who last modified the process or flow. However, we can choose to send exception emails to the Apex exception email recipients from Process Automation Settings in Setup.
  • Debug a Flow in Flow Builder: “Debug” feature on the flow is a great way to begin testing. You need to set the debug options , input variables and when we run ‘Debug Details’ appear in a panel on the right.
    syntax_image
  • Debug Logs: Debug Logs provides a detailed view of what is going on in and out of a particular transaction. Below are the 2 big keys around Flow to remember:
    • WF_FLOW_ACTION_BEGIN- Informs you that you are starting the flow transactions
    • WF_FLOW_ACTION_END- Informs you that you have exited your flow transactions

The rest of your Events between those two will house what is happening on with your Flow/PB. Refer this blog to learn: Benefits of Lightning Web Components Over Aura Lightning Components

About the Author

Shravya Martha, Senior Technical Analyst (CRM)

Shravya Martha works with Jade Global as a Senior Technical Analyst in CRM. She is a self-motivated and cheerful employee with almost 6 years of experience. She is extremely skilled in implementing projects on Service Cloud, Communities, Lightning and others Salesforce. She is a dedicated team member with proven leadership and communication skills and a quick learner. She works with the business directly to analyze and develop solutions to the current Salesforce.com organization of Jade Global’s clients.

Add New Comment

Restricted HTML

  • Allowed HTML tags: <a href hreflang> <em> <strong> <cite> <blockquote cite> <code> <ul type> <ol start type> <li> <dl> <dt> <dd> <h2 id> <h3 id> <h4 id> <h5 id> <h6 id>
  • Lines and paragraphs break automatically.
  • Web page addresses and email addresses turn into links automatically.