Guide Users Through Your Business Processes with Cloud Flow Designer
After completing this unit, you'll be able to:
- Define a flow and list its key components.
- Describe the types of flow elements.
- Build a flow that creates a record and uploads files.
You may have heard several terms used interchangeably when referring to flows. As a reminder, the official terms are:
- Lightning Flow—the product that encompasses building, managing, and running flows and processes.
- Cloud Flow Designer—a point-and-click tool for building flows.
- Flow—an application that automates a business process by collecting data and doing something in your Salesforce org or an external system.
In short, the Lightning Flow product includes a couple of tools. One of them, the Cloud Flow Designer, helps you create flows.
Beyond the Basics
You may also have heard the term Visual Workflow. That’s a retired product name for designing, managing, and running flows. Visual Workflow has been superseded by Lightning Flow.
Flow Building Blocks
Every flow is made up of three building blocks.
- Elements (1) appear on the canvas. To add an element to the canvas, drag it there from the palette.
- Connectors (2) define the path that the flow takes at runtime. They tell the flow which element to execute next.
- Resources (3) are containers that represent a given value, such as field values or formulas. You can reference resources throughout your flow. For example, look up an account’s ID, store that ID in a variable, and later reference that ID to update the account.
Flow elements fit into four different categories.
- Display data to your users or collect information from
them with Screen elements. You can add simple fields
to your screens, like input fields and radio buttons
and out-of-the-box Lightning components like File
If you need more out of your flow screens, like custom navigation or to display information in a data table, build or install custom Lightning components.
- Control the flow of... well, your flow. Create branches, update data, loop over sets of data, or wait for a particular time.
- Do something in Salesforce when you have the necessary information (perhaps collected from the user via a screen). Flows can look up, create, update, and delete Salesforce records. They can also create Chatter posts, submit records for approval, and send emails. If your action isn’t possible out of the box, call Apex code from the flow.
- Connect your flow to an external database by using local actions or Apex code. Local actions let you make requests without going through the Salesforce server. Cloud Flow Designer also has a couple of tie-ins to platform events. Publish platform event messages with a Record Create element. Subscribe to platform events with a Wait element.
Take a Tour
When you build flows, you work from the Cloud Flow Designer.
Manage the flow while you’re building it from the button bar (1). Test how the last-saved version of your flow works with Run.
- The diagram of your flow appears on the canvas (2).
The left-side panel (3) contains three tabs.
The Palette houses all the elements that you can add to your flow.
The Resources tab houses all the resources that you can add to your flow.
The Explorer shows all the elements and resources that you’ve already added to this flow.
From Setup, enter Flows in the Quick Find box, then select Flows, and then click New Flow.
- Drag a Screen element from the palette onto the canvas.
- Name it New Account.
On the Add a Field tab, double-click Textbox and then
double-click Number. Select each field in the preview pane and
enter a label for each field.
- Textbox: Account Name
- Number: Phone
- Click OK.
- From the Palette, drag a Record Create element to your canvas.
- Name it Create Account.
- For Create, select .
Map the screen input fields to account fields.
Field Value Standard | Name Screen Input Fields | Account_Name Standard | Phone Screen Input Fields | Phone
Assign the created account’s ID to a variable, so we can use the ID in the next
Make sure your Record Create element looks like this.
- For Variable, select .
- Name the variable accountId, and click OK.
- Click OK.
- Drag another Screen element onto the canvas.
On the General Info tab, configure these settings.
- Name the screen Upload Files.
Under Navigation Actions, deselect Allow Previous.
Otherwise, if users navigate back to the first screen, multiple accounts will be accidentally created.
On the Add a Field tab, scroll down and double-click Lightning
Component. Select [Lightning Component] in the
preview pane and configure the field.
- For Unique Name, enter accountFiles.
- For Lightning Component, select forceContent:fileUpload.
On the Inputs tab, configure the component’s attributes.
- For File Upload Label, enter Upload Related Files.
- For Related Record ID, select .
- Click Add Row and select Allow Multiple Files. For the value, type true and select $GlobalConstant.True.
- On the Outputs tab, click to delete the attribute row.
- Click OK.
As configured, the component lets users upload more than one file at a time to the created account.
Connect the elements together.
- Click the node at the bottom of New Account and drag it to Create Account.
- Click the node at the bottom of Create Account and drag it to Upload Files.
To set the start element, hover over the top right corner of New Account and click
Save the flow, and name it Quick Account.
Dismiss the warning that pops up. We talk about Lightning runtime next.
Make Your Flows Look Like Lightning
- From Setup, enter Automation in the Quick Find box, then select Process Automation Settings.
- Select Enable Lightning runtime for flows.
- Save your changes.
- From Setup, enter Flows in the Quick Find box, then select Flows.
- Click Quick Account.
- Activate the appropriate version of the flow.
Add Your Flow to the Home Page
Create a home page.
- From Setup, enter Builder in the Quick Find box, and then select Lightning App Builder.
- Click New.
- Select Home Page, and click Next.
- Give the page a name, and click Next.
- Click Clone Salesforce Default Page, select Home Page Default, and click Finish.
Drag a Flow component to the top of the right column.
- For Flow, select Quick Account.
- Save your changes and activate the page. Mark this page as the default Home page, click Next, and click Activate.
To see your flow in action, go to your Home page.
- Click Back to return to Setup.
- Click , and under All Items click Home.
- A flow interview is a running instance of a flow. When you distribute a flow, users interact with individual interviews of that flow.
- This unit walked you through a simple example of a flow. You can customize that flow to do much more. For example, enhance the Quick Account flow so that it provides values for more account fields, like the location or owner. Or use the same inputs to also create a contact and an opportunity.