Create Your First Flow
- Updated On 09 Jul 2020
- 6 Minutes To Read
A Flow in Decisions is a Design Element that allows an administrator to create a workflow that moves and manipulates data, performs actions, and provides functionality to other Design Elements. These actions could include tasking a user, making an API call to update an external system, looking up data in a database, and more! These actions can be defined by adding and chaining Steps in a graphical way to automate the business processes and logic.
This example will help with understanding Flow fundamentals by guiding the reader to create a simple Flow with one step. The step that will be used in the Flow will take two values and add them together.
Creating the Flow
- Begin in a Designer Folder and click the 'CREATE FLOW' button located on the Action Bar at the bottom of the screen.
- The Create Flow window will appear with the Default Flow template selected, click 'CREATE' in the bottom right corner.
- A smaller window will appear, enter a Flow name in the text box provided. Click 'CREATE' once a name has been designated.
Adding Flow Input Data
Flow Input Data is preset data configured by the Designer that will be evaluated and passed to different Flow steps throughout the workflow. For this example, there will be two inputs values; Value1 and Value 2. These values will be passed through the Steps and used to calculate the results.
- In the Flow Designer, select the green Start step icon in the top left corner of the workspace, the properties for this step will appear on the right.
- Locate the Flow Data section of the Start step properties and select the 'Show Editor' button under the Flow Input Data box.
The Data Definitions window is where the Designer can define what data will be passed through this Flow. This window presents three fields per line that can be configured for each piece of data. Enter a name for the data, select the type of data it is, then define whether or not it is a list of data.
- On the first line, enter Value 1 in the name box. Expand the dropdown list for Type and select Decimal [Number]. Leave the 'Is List' option unchecked.
- Once the first line has been configured, click into blank space underneath to create a new line. Configure this line with a piece of data named Value 2 of type Decimal [Number], that is not a list. Click 'Close' in the Data Definitions window to set the Flow Input Data.
The first method is by clicking and dragging a step to the Flow Designer from the Steps Catalog located in the Steps tab. When a new Flow is created and the Designer is redirected to the Flow Designer, there is an available Steps tab just above the Properties tab.
The Step Catalog holds hundreds of Steps in Decisions for use in a Flow and is broken into different categories. At the top of this tab, there is a section for Favorite Steps where some Steps are pre-listed. Steps can be added to the Favorite Steps list by clicking the star icon that appears to the right of the Step name when hovering over it with the cursor.
Add After Step
Most steps have an outcome path that extends from their icon, this is used to connect the steps in the editor. The second method of adding a Step is using the Add After feature that is initiated by clicking the arrow on the end of an outcome path. Find the desired Step in the list and select it. When the text box next to the selected Step appears, enter a name for the Step as it should appear in the workspace.
The 'Done' outcome path from the Start Step will now be connected to whichever Step was added. The Properties for the recently added Step will now appear in a window, this can be closed and configured later in the Properties tab. The 'Add After' window also appears after hovering the cursor over the line that connects two steps together and selecting the plus icon.
Completing The Build
In the Step properties, all of the expected pieces of data that the Step needs to function will be listed in the Inputs section. Next to each input is a dropdown list that defaults to 'Uknown'. This dropdown represents the Mapping Type for an input value. For more detailed information on each Mapping Type, please visit our Mapping Type Overview article.
- Using the information in the previous section, insert an Add Step to the Flow after the Done outcome path of the Start Step. Once the Add Step has been inserted, connect the outcome path of it to the End Step.
- Select the Add Step icon to populate the properties for this Step in the Properties tab. Locate the Inputs section of the properties, where Value 1 and Value 2 are waiting to be defined with the Flow Input Data configured earlier.
- Use the Select From Flow Mapping Type option for both of these values. When the popup window appears, choose which piece of Flow Data will be used to define the input value for the Step. In this case, Value 1 and Value 2 were configured as Flow Input Data, thus they will be mapped to their corresponding value in the Add Step.
Debugging The Flow
A Debugger is a valuable tool within Decisions that allows the Designer to test the Flow and confirm that the logic is working as expected. It will show the number of times a step was reached, the path it took, and also inputs and outputs to see how the data is flowing from step to step.
- At the top of the Flow Designer is an Action Panel. Select the Debug button from this panel to enter the Flow Debugger. In the Debugging window, enter a number for Value 1 and Value 2 under the New Session panel on the right side. Select the Run Capturing All button once the Values have been defined.
- Select the Add Step icon, a small information box will appear that shows the number of times the Step executed in green, and the number of exceptions caught will be in red. In this case, the Add Step executed one time and saw zero exceptions.
- Select the Execution 1 00:00 button so that the small Action Menu appears, then select View Input/Output Data. This shows that the Flow calculated the results of the two values (that were defined in the New Session panel) added together. Exit out of the Debugger, then save and close the Flow.