The Ultimate Guide to Salesforce Flows

Home     /     Blog     /     The Ultimate Guide to Salesforce Flows

Have feedback or questions about this post? Submit them here


Lightning Flows (AKA Flows) can help you automate complex business processes and manual data entry. Flows let you work smarter, not harder, by saving your users’ time and making sure the required tasks are being done.

As a Salesforce admin, Flows can be one of the most powerful tools in your toolbelt. When setup properly, Flows can make you look like a rockstar to your sales team, but if your Flows aren't configured correctly they can also be difficult to manage or make a mess (kinda like a rockstar!)

This guide will teach you everything you need to know about Flows - let's dive in!

What is a Flow?

In Salesforce, Flow is an application inside Salesforce to automate complex business processes. Simply put, they collect data and then do something with that data.

Flow Builder is the declarative interface that we use to build individual flows. Flow Builder can be used to build code-like logic without the requirement of knowing a programming language.

Flows in Salesforce can be implemented in two ways:

  • Screen Flows
  • Auto Launched Flow

When/why do I use a Flow?

In most cases, the type of automation to use for a specific process can be determined by evaluating where the data for the processes originates from and where it needs to go.

  • Flows are able to create, edit, and delete any record passed into the flow. Records do not have to be related to pass data in a flow. Flows are also able to be scheduled to run on a set interval with a collection of records.
  • Workflow field update can write data to the same record that invoked the workflow rule or the master record of a master-detail relationship on the record that invoked the rule. Workflow rules are not able to create, edit or delete records.
  • Process builder can be used to write data to the same record that invoked the process or records related by either lookup or master-detail relationships. Processes can also create records but not delete.

Salesforce Automation Tools

When should I not use a Flow?

Generally, you should not use a flow in the following situations:

  • Simple Field, Email Alerts or record updates that can be better handled by a Process Builder or Workflow rule. Generally, flows are used for more complicated logic, similar to Apex, that can be accomplished in a declarative manner. For example, if you would like the Stage of an opportunity to be set to New when it is created, along with an email alert being sent to a Sales Manager, it is better to create this as a Workflow Rule or Process Builder.
Flow No No

  • Complicated logic that is better managed in Apex code. An example of this is the flow above that was shared in a well known Salesforce group. The logic in this flow is so complicated, that it makes debugging a pain, and also makes documenting and managing the flow difficult also. Complicated logic like this is better served through well built Apex code, which makes it easier to document the logic, changes and also debug issues with it.
  • Simple Record Creation. For example, if you would like to create an Order when an opportunity is moved to Closed Won, it is better to use a Process Builder to complete this action, as it is easier to setup and manage.
  • When your Edition limits how many flows you can create. Essentials and Professional editions have a limit of 5 Process Builders and Flows in each org. For most logic in these editions, it is easier to create a Process Builder to handle them.

How do I create a Flow in Salesforce?

Below are the steps to create flow:

  1. Open Flow Builder: From Setup, enter "Flows" in the Quick Find box, select Flows, and then click New Flow.
  2. Select the flow type, and click Create.
  3. Drag the elements you want to use onto the canvas. Each element represents an action that the flow can execute. Examples of such actions include reading or writing Salesforce data, displaying information and collecting data from flow users, executing business logic, or manipulating data.
  4. Connect the elements to determine the order in which they’re executed at run time. Don’t forget to connect the Start element to another element.
  5. Save your flow.

After you build a flow, make sure that it’s working as you expect it to by testing it thoroughly to make sure that it works as expected. Then activate the flow. You’re now ready to distribute the flow to users.

Pro tip: Flows can be executed in several ways, depending on who the flow is designed for. Internal users, external users, or systems can run a flow, or a flow can be deployed for another organization.

Flows vs Apex

Flows and Process Builders are similar. Here are some of the key differences and similarities between the two:

  • Apex requires a dev and Sandbox to deploy, meaning it can only really be built in organizations that are Professional and above. Flows can be built in all editions, as a sandbox is not required for deployment.
  • Apex is not available in Essentials, some Apex features are limited in Professional. Orgs with Enterprise and above have no Apex limitations. Flows features are not limited based on the edition.
  • Apex requires constant development and discipline with upkeep. Flows are less work to keep up to date.
  • Flows can be built by admins, Apex is typically built by devs only.
  • Apex is considered a tool of last resort, Flows are simpler and should be used before Apex.
  • However, to the point above as to when you should not use a flow, if the logic is too complex, Apex should be used. There is unlimited potential with Apex, Flow capabilities are catching up but are still behind Apex.
  • Renewal Generation, OLI creation and other pieces of automation that were traditionally built as Apex can now be built as flows, preserving code space for projects that require Apex.

Apex should be used in the following scenarios;

  • Complex Salesforce automation that requires multiple steps and actions, where a flow will become cumbersome.
  • Custom-built integrations with other systems (such as a connection to a SQL database that requires bi-directional syncs)
  • ERP integrations.

When should I use Flows vs Process Builder?

Flows and Process Builders are similar. Here are some of the key differences and similarities between the two:

  • Process Builder is more user-friendly in terms of its setup and management. Setting up a flow takes more time and significantly more complex.
  • Flows allow you to add screens where users can enter data
    • Process Builders do not have this capability.
  • Flows can be Auto-Launched or started by users.
    • Process Builders run automatically (either immediately or scheduled) when criteria is met.
  • Flows and Process Builders can have scheduled actions.
  • Flows can be paused by users, Process Builders run when the criteria is met and cannot be paused.
  • Flows and Process Builders both contribute to CPU limits and other automation limits in Salesforce.
  • Process Builder actions are executed in the order in which they appear in the process definition.
    • Flows can have different and more complex orders of operations.
  • Flows can be built to cycle through multiple un-related and related objects.
    • Process Builders are limited to the base object (i.e Opportunities) and related objects (Accounts).
  • The following actions are available in Process Builders only:
    • Quip Actions
    • Send Survey Invitation
    • Invoke a flow

Here are real-life examples where a Process Builder makes more sense:

  • Automatically submit an opportunity for approval when the value in the Amount field is greater than $200,000
  • When an account is deactivated, deactivate all the associated contacts.
  • After creating a new user or internal contact, create a case for background verification.
  • Invoke custom approval logic that is written in Apex code.


What's the difference between Flows and Workflow Rules?

Flows and Workflow Rules (WFRs) are similar. Here are some of the key differences and similarities between the two:

  • Flows are available in all Salesforce Editions, including Essentials. WFRs are not available in Essentials or Professional Edition.
  • WFRs are not actively being updated by Salesforce (but you can still use them for the time being).
    • Flows are constantly being updated in each release with new features and capabilities.
  • There are limitations with how many WFRs can be active at once, but they typically do not contribute to CPU limits UNLESS the WFR triggers a Process Builder or Flow through one of its updates (a field update for example).
  • Both Flows and WFRs can have scheduled actions.
    • WFRs are limited to 1000 time triggers per hour.
  • WFRs can only make one decision.
    • You can call other flows and Apex with a flow.

Here are some use cases where a WFR makes more sense than a flow.

  • Simple field updates, such as
    • Outbound Emails
    • Sending Email alerts when High Priority Cases are created.


Testing Flows

While the testing tools with flows are limited, you do have the capability to test a flow before activating it.

To test a flow, you can input variables and click Debug to run through it, to make sure it works properly. This is especially true with Screen Flows.

Which automation tool do I use?

Prior to the Spring '19 release, you built Flows in the Cloud Flow Designer tool. In Spring '19 Salesforce introduced Flow Builder, a faster, more intuitive front-end interface to build your Flows.

Common mistakes

  • Using the wrong Field or Variable
  • Too many SOQL queries
  • Object & Field Level Security for running user
  • No Access to Running Flows

What is the difference between a Screen Flow and Auto-Launched Flow?

Flows can be accessed in two ways

  • Screen Flows: These are flows that have a UI element and require input from users. These types of flows are either launched as an action or embedded as an element on a Lightning Page.
  • Autolaunched Flows: These flows are used to run automated tasks. Autolaunched Flows can be invoked with process builder or from within an apex class. Additionally, Autolaunched Flows can be scheduled to run on a specific interval.

Where can I find Salesforce documentation on Flows?

You can find the official documentation here.

We also recommend completing the Build Flows with Flow Builder trail on Trailhead

Read more about Flow Builder

Related Articles