trailhead

Guide Users Through Your Business Processes with Cloud Flow Designer

Learning Objectives

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.

Get Started with Cloud Flow Designer

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, connectors, and resources in a flow
  • 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.

Screen
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 Upload.A flow screen that's built with out-of-the-box fields and components

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.A flow screen built with custom Lightning components.

Logic
Control the flow of... well, your flow. Create branches, update data, loop over sets of data, or wait for a particular time.
Actions
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.
Integrations
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.

Screenshot of the Cloud Flow Designer's user interface with numbers pointing at the button bar, left side panel, and canvas
  • 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.

Build a Flow

Depending on your page layouts, objects can have lots of fields, which can overwhelm users who just want to create a record quickly. Let’s build a flow to streamline account creation. Our flow gets user input about the new account, creates the account, and lets the user upload files to that account.
Tip

Tip

Plan out your business process before you try to automate it. Doing so makes it easier to configure when you use one of our automation tools.

From Setup, enter Flows in the Quick Find box, then select Flows, and then click New Flow.

Add the First Screen

  1. Drag a Screen element from the palette onto the canvas.
  2. Name it New Account.
  3. 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
    Screenshot of the screen element's Add a Field tab
  4. Click OK.

Create the Record

Use the values from New Account to create an account.
  1. From the Palette, drag a Record Create element to your canvas.
  2. Name it Create Account.
  3. For Create, select Standard | Account.
  4. Map the screen input fields to account fields.
    Field Value
    Standard | Name Screen Input Fields | Account_Name
    Standard | Phone Screen Input Fields | Phone
  5. Assign the created account’s ID to a variable, so we can use the ID in the next screen.
    1. For Variable, select CREATE NEW | Variable.
    2. Name the variable accountId, and click OK.
    Make sure your Record Create element looks like this.Screenshot of the Record Create element's Assignments section
  6. Click OK.

Create the Second Screen

The second screen lets users upload files for the account that they created.
  1. Drag another Screen element onto the canvas.
  2. On the General Info tab, configure these settings.
    1. Name the screen Upload Files.
    2. Under Navigation Actions, deselect Allow Previous.
      Otherwise, if users navigate back to the first screen, multiple accounts will be accidentally created.
  3. On the Add a Field tab, scroll down and double-click Lightning Component. Select [Lightning Component] in the preview pane and configure the field.
    1. For Unique Name, enter accountFiles.
    2. For Lightning Component, select forceContent:fileUpload.
    3. On the Inputs tab, configure the component’s attributes.
      1. For File Upload Label, enter Upload Related Files.
      2. For Related Record ID, select Variables | accountId.
      3. Click Add Row and select Allow Multiple Files. For the value, type true and select $GlobalConstant.True.
    4. On the Outputs tab, click the trash can icon to delete the attribute row.
    The field settings for the file upload component field
  4. Click OK.

As configured, the component lets users upload more than one file at a time to the created account.

Finish the Flow

  1. Connect the elements together.
    1. Click the node at the bottom of New Account and drag it to Create Account.
    2. Click the node at the bottom of Create Account and drag it to Upload Files.
    Connecting Create Account to Upload Files
  2. To set the start element, hover over the top right corner of New Account and click The Set Start Element button.
    The New Account element enabled to start the flow.
  3. 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

Salesforce offers two runtime experiences that determine the look and feel when someone runs a flow. To make your flows blend in with Lightning Experience, make sure that Lightning runtime is enabled in your org.
  1. From Setup, enter Automation in the Quick Find box, then select Process Automation Settings.
  2. Select Enable Lightning runtime for flows.
  3. Save your changes.
Note

Note

This setting only affects URL-based flows. That includes flows that are run from custom buttons or the Run button in the Cloud Flow Designer. For more details, see Flow Runtime Experiences.

Distribute Your Flow

Now distribute the flow to the right users. Let’s add our flow to the Home page.
To see more ways to distribute a flow, check out the Screen Flow Distribution module.

Activate Your Flow

Only active flows are available in the Lightning App Builder, so first activate the flow.
  1. From Setup, enter Flows in the Quick Find box, then select Flows.
  2. Click Quick Account.
  3. Activate the appropriate version of the flow.

Add Your Flow to the Home Page

  1. Create a home page.
    1. From Setup, enter Builder in the Quick Find box, and then select Lightning App Builder.
    2. Click New.
    3. Select Home Page, and click Next.
    4. Give the page a name, and click Next.
    5. Click Clone Salesforce Default Page, select Home Page Default, and click Finish.
  2. Drag a Flow component to the top of the right column.
    Dragging the Flow component onto a Home page
  3. For Flow, select Quick Account.
  4. Save your changes and activate the page. Mark this page as the default Home page, click Next, and click Activate.
  5. To see your flow in action, go to your Home page.
    1. Click Back to return to Setup.
    2. Click App Launcher icon, and under All Items click Home.
Resulting home page

Ensure Users Can Run the Flow

Finally, make sure that your users can run the flow. Add the Run Flows user permission to a permission set or profile, and assign it to the right users.
Note

Note

Only flow admins (users with the Manage Flow user permission) can run inactive flows.

Tell Me More...

  • 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.

Resources

The following videos show Salesforce Classic.

Lightning bolt icon used to indicate that the content is for Lightning Experience

Remember, this module is meant for Lightning Experience. When you launch your hands-on org, switch to Lightning Experience to complete this challenge.

retargeting