Create Your First Flow

Follow these steps to build your first flow. This exercise aims to familiarize you with the core components of a flow and how they interact.

You must have the Flow Author account role to create a flow.

Create the Flow

Add a Trigger and Steps

Add the First Step

This code breaks down as follows: 

The square brackets denote that this is an array.  You can add other email addresses by enclosing them in straight single quotes and separating the values with a comma within the brackets.

Add the Second Step

The first icon is highlighted.

4. Enter return flow.step('map-variables').output[0].emailAddress;

The code breaks down as follows:

5. Skip the Attachment section.  You can include a single attachment on an email step, but you will not use it in the sample flow.

6. Enter return flow.step('map-variables').output[0].subject; in the Subject expression box.

enter return flow.step('map-variables').output[0].body; in the Body expression box.

7. Select Save at the bottom of the step window.

Save and Run the Flow

Review the Flow Run

When the flow status updates to Success, you will see the email in your inbox.

In App Xchange, select the successful flow run to see the Run Details page. You will see that one email was sent. 

Select 1 Email Sent to view the code version of the email.

Manage the Flow Configuration

When you hardcode email addresses in a flow step, it can be inconvenient for troubleshooting and updating the step.  Now you will set up a configuration to hold one or more email addresses and modify our flow step to use those values instead of using the hardcoded email address.

In this code we add the Key from our Configuration to flow.config.  Because we defined the Configuration type as Multiple Text Items, it will be interpreted as an array of strings which is what the Emails expression box expects.

Your flow is complete and deployed on the main branch. It can now be used within your workspace.