This post was last updated on 10/4/22.
Lightning flows (or just flows) help you automate complex business processes and manual data entry. With flows, you can work smarter, not harder, saving users time and ensuring that the necessary tasks are performed correctly.
As a Salesforce admin, flows are one of the most powerful tools in your tool belt: when set up correctly, flows make you look like a rock star to your sales team, but when not set up correctly, your flows can be difficult to to manage. or wreak havoc (like a rock star too).
In this guide, you'll learn everything you need to know about flows. Let's dive!
What is a flow in Salesforce?
In Salesforce, a flow is a tool that automates complex business processes. Simply put, you collect data and do something with that data.
Flow Builder is the declarative interface used to create individual flows. Flow Builder can be used to create code-like logic without using a programming language.
Streams are divided into five categories:
- These are flows that have a UI element and require input from users. These types of flows are initiated as an action or embedded as an element on a Lightning page.
- These automatically started flows start at a specific time and frequency for each record in a batch and run in the background.
Streams started automatically:
- Run automated tasks with this flow type. Autostarted flows can be invoked by other flows (subflow), Process Factory, within an Apex class, by a defined schedule, by registry changes, or by platform events.
Register triggered flows:
- These automatically started flows run in the background before a record is saved, or after a record is saved, when a record is created, updated, or deleted.
Flows triggered by platform events:
- When a platform event message is received, these automatically started flows run in the background.
Check out this example of a programmatically triggered flow taken from a popular Salesforce group:
When/why should I use a stream?
If you need to create a new automated business process or human-driven experience that doesn't meet the Apex Code complexity threshold, Flow is the tool for you. If you are modifying an existing process created with Process Builder or a workflow, consider several factors when deciding whether to modify the existing process or migrate to Flow.
Flows can create, edit, and delete records in Salesforce, send emails, display relevant data, and collect information from users and generate outbound messages.
when I have tonotuse a stream?
In general, you shouldn't use a stream in the following situations:
There is intricate logic that is best handled with Apex code. An example of this is the flow shown in the Overview section. The logic of this flow is so complicated that it becomes tedious to debug and difficult to document and maintain.
Your Salesforce edition limits the number of flows you can create. Note that developers can write Apex methods that can be called from within a stream (similar to calling a child stream). With this pattern, you can offload particularly complex processes to Apex, but your flow builder still keeps track of the overall process!
Essentials and Professional editions are limited to five processes (per process type) and flows (per flow type) in each organization. For more logic on these topics, it's easiest to use a process.
How do I create a flow in Salesforce?
Open the flow builder. From Setup, enter Flows in the Quick Find box, select Flows, then click New Flow. Select the flow type and click Create.
The type of stream you create affects your experience. For scheduled and record-triggered streams, you can access an automatically created global variable called $Record. This provides access to all fields in the record that triggered the flow (and its parent records!). If you create an autostarted flow, you must create the necessary input variables yourself.
After configuring your inputs, you can click the “+” button after the initial item: you have items to choose from to run your business processes. Each element represents an action that the flow can perform. Examples of these actions are reading or writing data from Salesforce, displaying information and collecting data from flow users, executing business logic, or manipulating data.
(For some more detailed flow building examples, sign up for our newsletter! Just scroll to the bottom of this page to find the signup link.)
Save your stream.
After creating a flow, verify that it works correctly by thoroughly testing it. After testing it, enable the flow. Now you can distribute the flow to users.
Pro Tip: Flows can run in different 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 to another organization. Remember, no matter how you drive...you have to go with the flow.
Fluxos vs. Apex
Deploying Apex code requires a developer and a sandbox, which means it can only really be created in organizations using a Professional edition or higher of Salesforce. Streams can be created in all editions. While a sandbox is not required to bring a flow into a production environment, it is recommended that flows that leverage the full power of the tool be sandboxed and tested before being deployed to production.
Apex is not available in Essentials and some Apex features are limited in Professional. Enterprise and higher organizations do not have Apex restrictions, but Flow features are not restricted by edition. Apex code requires constant development and discipline to maintain. Streams require less work to keep up to date.
Admins can create flows, whereas Apex code is typically only created by developers. Apex code is considered a last resort. Streams are simpler and should be used before Apex code.
If the logic is too complex, Apex code should be used. Each release brings new features that narrow down the use cases that Apex requires, but there are still some situations where Apex provides a performance boost and this should be considered. Update generation, opportunity product, and other automation pieces traditionally built as Apex code can now be built as flows, preserving code space for projects that require Apex.
Apex code should be used in the following scenarios:
- Your flow requirements require nested loops
- Your flow needs require loop elements
- You work with large amounts of data.
- You need custom integrations with other systems (for example, a connection to an SQL database that requires two-way syncs).
- ERP integrations are involved.
- You'll need to sign in or show a custom error message if the automation fails or doesn't find what you're looking for. (Although in some cases you can do this with Flow!)
Considerations for migrating from Process Builder to Flow:
With the Winter 23 release, admins can no longer create new workflow rules and Process Builder will be released soon. New automation must be built on top of Flow, and migrating existing workflows and processes must be an important consideration. Changing existing automations comes at your own risk. Consider the following when determining the right time to make the switch.
Situations that indicate you should migrate soon:
- Has more than one process generator per object
- Your existing processes often fail or cause errors
- Your existing processes are simple
- It introduces a significant number of new features
- You have well thought out acceptance criteria to compare your new automation against your existing processes
Situations that indicate you should postpone your migration:
- It has complex and stable processes that meet today's business needs
- You don't have clear testing requirements to confirm that your new flows will replace your migrated workflows and processes.
To test a flow, click the Debug button on the canvas, enter your variables and click Run. Then run the flow to make sure it's working correctly. This process is particularly useful for screen flows.
Please note that starting with the Salesforce Winter 2021 release, a beta feature called Debugging on Canvas is available. This feature makes it easy to debug flows by visually demonstrating the path your flow will take when executed. It also shows stream query limits in debug details. Also, debugging now offers two more options than before: running the flow as a different user and running the flow in rollback mode.
Where is Flow Builder located in Salesforce?
To find Flow Builder in Salesforce (Lightning), go to Setup > Process Tools > Flows.
What are the different types of flows in Salesforce?
Streams started automatically without stream activation
These flows don't require user interaction and don't support screens, local actions, options, or option sets. The available distribution methods are:
- Flow Actions
- Flash Pages
- Custom aura components
- Lightning Custom Web Components
- Custom buttons or custom links
- web guides
- Direct Stream URL
- Visualforce Pages
- flash off
- Integrated service deployments
Flows started automatically with a schedule trigger
These flows only run on a user-defined schedule. They do not support user interaction, screens, local actions, options or option sets. The available distribution methods are:
- Law Suit
- Custom Apex Classes
- web guides
- Custom buttons or custom links
- Visualforce Pages
Screen flows require user interaction because they contain screens, local actions, steps, options, or prompts. Screen flows do not support pause elements. A flow triggered by a schedule runs only at the scheduled time and frequency.
Streams started automatically with a record trigger
These flows are designed to quickly make simple changes to a record when the record is created, updated, or deleted. They can also be configured to make these changes before or after saving the record to the database. In a pre-save stream, supported elements are Assignment, Decision, Get Records, and Loop. Flows after saving have access to all flow resources, but cannot launch child flows.
User provisioning process
User provisioning flows provision users for third-party services. You can use this flow type to customize user provisioning settings for a connected app and associate Salesforce users with their Google Apps accounts. A user provisioning flow can only be implemented by associating it with a connected app by running the user provisioning wizard.
Field service mobile flow
These flows require user interaction because they have one or more screens.
Integrated field service flow
These flows require user interaction because they have one or more screens.
Contact request process
These flows require user interaction because they have one or more screens. Use one of the following Experience Builder components to add this flow:
- Contact request button and flow (Launch the flow in a popup window)
- Flow (flow embedded directly on the page)
For more information about flow types in Salesforce, seeofficial documentation.
What is a Flow Interview in Salesforce?
Whereas a flow is an app created by your admin that takes your input and does something in Salesforce based on that input, a flow interview is a running instance of a flow.
For example, a flow can provide a call script to call customer support using the provided information to create a case. What the flow does with the information you provide is entirely up to your admin.
When running a flow interview, whether from a link, button, or tab, you are running a single instance of a flow. If the terminology is confusing, consider the difference between a record and an object. You create an account record, which is a single instance of the account object that your administrator has customized.
It's a good idea to monitor the list of paused and failed flow interviews, available under Settings > Paused and Failed Flow Interviews. This pair of lists is very useful. With paused flow interviews, you can review flows with time-based actions or screen flows that users didn't complete. The list of failed flow interviews is even more useful as it shows the flow errors along with the debug log of the flow interview. This should be your first stop when troubleshooting a stream.
Read more about flow interviews atSalesforce documentation.
How do you name a one-button flow in Lightning?
As of Winter 2018, Salesforce provided an easy way to trigger a flow from a quick action button in Lightning.
Use:You can only initiate screen flows or mobile field operations from a quick action button.
Create a custom action for the record in question by navigating to Object Manager > (object name) > Buttons, Actions & Links. Select Flow as the custom action type, configure the custom action to point to the flow, and give it a name. Then add the custom action to the page layout of your choice.
Common mistakes when designing flows
We see a lot of streams here on Kicksaw and we're building even more of them. Here are some common and preventable mistakes we've identified:
- Using the wrong field or variable
- Don't look for null values
- Include Get, Create, Update, or Delete elements in a looping element
- Reference objects or fields that an end user may not have access to
- No access to running streams
- Use Get elements to retrieve data available through $Record or $RecordPrior in a scheduled record or trigger flow
- coded record id
More Salesforce Flow documentation
We hope you've learned a lot about the power of Salesforce flows in this article, but if you need more help, read theofficial documentation.
Better yet, get in touch with us by filling out the contact form below. We would love to help whenever we can.
From Setup, enter “Flows” into the Quick Find box, select Flows, and then click New Flow. Select the Flow Type, then click Create. The type of flow you create will impact your experience. For scheduled and record triggered flows, you can access an auto created global variable called $Record.Which tools are included with the Salesforce flow product answers? ›
What tools is Salesforce Flow comprised of? Process Builder which lets you build processes and Flow builder which lets you build flows. There is also a tool called Approvals that can be used to automate processes that is _not_ included in Salesforce Flow.How many flows should you have in Salesforce? ›
This means that, ultimately, the magic number of flows per object is three: Before create or update. After create or update. Before delete.How long does it take to learn Salesforce flows? ›
How Much Time Does It Take to Learn Salesforce? The average time to get Salesforce Certified is 6-8 weeks.What is the difference between flows and workflows in Salesforce? ›
Flow is more powerful than workflow rules and process builders. Workflow rules are always executed behind the scene, flows can provide screens to guide us through our business process. Flows aren't bound to any one object. Flow can create, update, and delete records for multiple objects.What are the two types of flows in Salesforce? ›
The Salesforce Flow can be classified into five subtypes- Screen flows, Schedule-triggered flows, Autolaunched flows, Record-triggered flows, and Platform Event-triggered flows.How many flows can I run per month Salesforce? ›
Unfortunately, for now, there is a limitation in Salesforce, you can schedule a Flow only once, daily or weekly. Often business needs are focused on the long-term perspective so the task to schedule Salesforce Flow monthly appears quite often.What are two key components of testing the flow in Salesforce? ›
- Run runs the most recent saved version of the flow that you have open.
- Debug does everything that Run does, but with some superpowers thrown in. It lets you enter values for the flow's input variables and display debug details while running the flow.
Difference Between Flows and Process Builder
Everything you can do in Process Builder can be done using Flows Builder, although Process Builder is a bit easier to use. In a nutshell, you can start with Process Builder for simple automation and switch to Flows once you need to work on complex ones.
Salesforce Flow empowers you to build complex business solutions using clicks, not code. Flow Builder is the most powerful tool that a Salesforce Admin has at their disposal, giving you similar powers that Salesforce developers have.
Flow templates are pre-designed flows that allow businesses to create customized processes for specific workflows. Salesforce flows also enable Salesforce administrators to have similar developing capabilities as Salesforce developers.How many flows can I run per day? ›
Number of Flows created by a user
There is a limit of 250 flows that a single user can create. After this you simply get the following error and you can't save any more flows.
600 is the limit on the number of flows. Hope this Helps!When should you build a flow answer? ›
When should you build a flow? When simpler tools don't fit your requirements.What is the easiest certification in Salesforce? ›
- Salesforce Certified Associate Certification. ...
- Administrator Certification. ...
- Salesforce Platform App Builder Certification. ...
- Advanced Administrator Certification. ...
- Service Cloud Consultant Certification.
Salesforce Lightning Developer salary in India ranges between ₹ 3.4 Lakhs to ₹ 13.1 Lakhs with an average annual salary of ₹ 6.5 Lakhs. Salary estimates are based on 328 latest salaries received from Salesforce Lightning Developers.Can I learn Salesforce in 6 months? ›
On average, it takes 6 weeks to get Salesforce Certified. But the time to prepare for a Salesforce certification depends on the experience of the individual. If you are completely new to Salesforce you have to spend a minimum of 10hrs/week and it takes 6 weeks to be ready for the Salesforce admin certification exam.Is workflow going away in Salesforce? ›
Salesforce announced in late 2021 that they intend to retire both Workflow Rules and Process Builder and encourage customers to move to Salesforce Flow. “We plan to begin blocking the ability to create new processes and workflows in Winter '23, pending successful migrations and community input.”Is flow replacing process builder in Salesforce? ›
At the end of 2022, Salesforce will be retiring Workflow Rules and Process Builder automation. While your current Workflow Rules and Process Builders will continue to run, you will not be able to create new automation using these tools. Instead, you'll have to create new automation using Flow.What are the two types of workflows? ›
Workflows can be divided into three primary types, based on their complexity. These are sequential, state machine, and rules-driven.
What is the difference between Screenflow and Autolaunched flow? Screen flow needs user interaction since it consists of screens, local actions, steps, choices, or dynamic options. Screen flows do not allow pause elements. Autolaunched Flow, on the other hand, does not require human interaction.What are the elements in flow Salesforce? ›
In Flow Builder, there are three groups of elements: Interaction, Logic, and Data. The Data Elements reach out from the flow instance and interact with Salesforce data, allowing the flow to retrieve information from or make changes to records in the database.What is the limitation of flows Salesforce? ›
Limits per flow interview
For each flow interview, you can only have a maximum of 2,000 elements being executed. Note that if you have a loop, the elements within the loop (including the loop element) will be multiplied by the number of iterations.
The 250,000 records are a daily limit, hence the need to run subsequent processes a day later.How long can flows run for? ›
In this article
For the latest release plans, see Dynamics 365 and Microsoft Power Platform release plans. Microsoft Flow makes it easy to automate workflows that request approvals and act on their responses. Currently, flow runs time out after 30 days, causing any pending steps (like approvals) to time out as well.
Invoke Apex From Flow.
After collecting the data or records you want to pass in, add an Apex Action to your flow. Select your invocable method: the label you created will appear as an option. Set the input parameters from what you collected in your flow. Set the output parameters as variables you defined.
Now you can let Salesforce test the Flow, ensure that the results are as per the expectation and highlight when they are not. You can now create & run tests within the Flow builder itself – declaratively without writing any code. If you are familiar with Apex test classes, the concept of testing the flows is similar.How do you troubleshoot a flow in Salesforce? ›
The debug screen is showing exactly what the end user would see but with Debug Details to the right.
- Enter the following data: Company Name. ...
- Click Next.
- Review the Debug Details to see the results.
There are three core process flows within your company: your cash cycle, your manufacturing (or fulfillment) cycle, and some have a design cycle.Do Flows run before process builder? ›
First Trigger will run then Process Builder. In a transaction, flow triggers are executed after all workflow field updates, including any Apex triggers and standard validations that are executed as a result of those workflow field updates. After executing flow triggers, the system executes escalation rules.
For instance, to call flow from apex class, create an instance of an Interview object by using 'Flow. Interview. flowName'. It uses start() method to execute your flow.How do you master a flow? ›
- Balance challenge and skill. You can achieve flow state when you're balanced between challenge and skill. ...
- Establish clear goals. Another key element of flow state is having clear goals. ...
- Reduce distraction. ...
- Stop multitasking. ...
- Don't force it. ...
- When in doubt, do something you like.
- From Flow Builder, click Debug. Make sure that the second checkbox is selected. ...
- Click Run.
- Validate the first test case. Enter a first and last name, and choose an account. ...
- Repeat for the other three test cases.
- From Setup, in the Quick Find box, enter Flows , then select Flows.
- Click New Flow. Select Screen Flow, then click Next. ...
- Click New Resource. ...
- For the API name, enter recordId . ...
- Add an element, then select Get Records.
- Enter a label that relates to the object you're selecting for your flow. ...
- Click Done.
How to Achieve Flow. It takes approximately 10 to 15 minutes of focused attention to reach a flow state. Once in flow, it may last from 30 minutes to a couple of hours. However, it is possible to achieve flow more than once a day, given the right conditions.How do you get good flows? ›
- Choose clear goals. Part of getting into a flow state means working on a task that has a specific, finite outcome. ...
- Make it challenging. ...
- Make it easy to focus. ...
- Take care of yourself. ...
- Turn your phone off. ...
- Create a pre-flow ritual. ...
- Get to know yourself.
Flow arises when one's skills are fully utilized yet equal to the demands of the task, intrinsic motivation is at a peak, one loses self-consciousness and temporal awareness, and one has a sense of total control, effortlessness, and complete concentration on the immediate situation (the here and now).What triggers a flow in Salesforce? ›
Because the flow is triggered when a record has been changed, that change is already on its way to the database. This is often called a transaction, and is referred to as the initial triggering transaction. During the record update that triggered the flow and before that update is saved.How do I validate inputs in Salesforce flow? ›
- Salesforce Flow Steps: Define flow properties.
- Add a screen to capture the user's input.
- Add a Text component to store the city. Add input validation to validate user input.
- Add a Phone component to store the Mobile Number. Add input validation to validate user input.
- Debug Record-Triggered Flows.
- Find Failed Flows Faster.
- Debug Flows After Pause Elements in Flow Builder.
- Debug a Flow to See When Transactions Are Committed.
- Debug Flows in Auto-Layout (Beta)
- Read Flow Error Emails More Easily.
- Debug Flows with One Button.
Yes, many elements of your flows that consume system resources will be automatically bulkified when processing multiple records at a time. Salesforce will wait until all flow interviews have reached the same flow element and then process just one request for all records at the same time.What are the different types of Salesforce flows that can be built with flow builder? ›
- Building Blocks.
- Flow Types.
- Triggers for Autolaunched Flows. Manage Record-Triggered Flows. Schedule Triggers for Flows That Run for Batches of Records. Record Triggers for Flows That Make Before-Save Updates. ...
- Flow vs. Workflow Rule.
- Advanced Flow Concepts. Running User of a Flow. API Version for Running a Flow.
- Step 1: Create a Process. From Setup, enter Builder in the Quick Find box, and select Process Builder. ...
- Step 2: Choose Object and Specify When to start the Process. Click Add Object. ...
- Step 3: Define Criteria. Click Add Criteria. ...
- Step 4: Define Immediate Actions. ...
- Step 5: Activate the Process.
Maps are a fundamental data structure in Apex and other programming languages. They allow us to store a series of key/value pairs, and then efficiently use a key to look up a value from the store. There is no built-in map construct in Flow, but it would be useful if there were.How do I pull a field from another object in Salesforce? ›
- Click on SetUp (Gear Icon) and then click on the Object Manager.
- Click on the object you will be adding the Look Up field to. ...
- Select Fields & Relationships and then click the New.
- Select Lookup Relationship from the Data Type list and click Next.