- 26 Jan 2022
- 5 Minutes to read
Create a Flow
- Updated on 26 Jan 2022
- 5 Minutes to read
A Flow (or Workflow) is the Designer Element that visually represents logic that is used to execute a business process within Decisions. Flows can be used to move and manipulate data, perform various actions, and provide functionality to other Designer Elements throughout the product. Such actions may include tasking a user, making an API call to update an external system, looking up data in a database, etc...
These actions are defined by adding, chaining, and configuring functions that are referred to as Flow Steps. Steps are a graphical way to represent each individual point within a Flow. Steps can be added to Flows via the Flow Designer, from the step catalog known as the Toolbox.
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 Global Action Bar at the top of the screen.
- The Create Flow window will appear with several different options for choosing the template or function of the Flow. Categories on the left side of the window contain several different Flow options for certain behaviors or object references.
- A smaller window will appear, enter a Flow name in the text box provided. Click CREATE once a name has been designated.
Adding Input Data
Flow Input Data is data that is passed into the Flow for use with Flow steps. Input Data can be defined with values, but will otherwise expect an input from the end-user or another Flow (if referenced as a Sub Flow).
The Data Definitions window is where a user can define what data will be passed through the Flow. This window presents three fields per line that can be configured for each piece of data. Users are able to enter a Name for the data, select the Type of data it is, and define whether or not it Is a List of data.
- At the top of the Flow Designer, click EDIT INPUT DATA to display the Data Definitions window. Click DEFINE under Define Input Data.
- On the first line, enter "Value 1" in the Name field. Expand the dropdown list for Type and select Decimal [Number]. Leave the 'Is List' option unchecked.
- Once the first line has been configured, add another new line with the data name of "Value 2" with the Type Decimal [Number], which is not a list. Click Save and then close the Data Definitions window.Adding Input Data via Design PatternInput data for a Flow can also be set using a Data Designer/Design Pattern. To learn more, see Data Designer and Design Pattern Overview.
Flow Steps are used to perform a specific function. The Flow consists of a sequence of steps that run one after another with the configured properties. Flow Steps can be accessed with the Toolbox or the Add After window. Most steps have an outcome path that extends from their icon, this is used to connect it to other steps in the workspace.
The first method of adding a step is by clicking and dragging a step into the workspace of the Flow Designer from the Toolbox tab on the left. This tab is open by default when the Flow Designer is launched and it starts by showcasing the FAVORITE STEPS category.
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, dragging the arrow to white space on the workspace, after hovering the cursor over the line that connects two steps together and selecting the plus icon.
- Click the Done path of the Start step to open the Add After window.
- Navigate to All Steps [Catalog] > Data > Numbers and select the Add step. Click ADD.
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 category section. Next to each input is a dropdown list that defaults to Uknown. This dropdown represents the Mapping Type for an input value.
- Select the Add step icon to populate the properties for this step in the Properties panel and locate the INPUTS section.
- Click Unknown next to the Value1 field and select the Select From Flow mapping type option. A window will appear that displays the available input data in the Flow. Select Value 1 and click DONE. Do the same thing for the Value2 field and select Value 2 from the Flow.
- Connect the Done path to the End step. Click Save at the top to save changes to the Flow.Flow/Step ExceptionsIn the Flow Designer, whenever a new Flow is created or new steps are inserted that have not been configured yet, a red exclamation mark will appear. This is indicative of an Exception within the Flow that would need to be resolved before the Flow/Steps can function. This can usually be done by connecting steps together or by appropriately configuring each step with all of the required parameters. In the example below, the red exception icon clears once the step inputs have been defined.
Debugging The Flow
The Debugger is a tool within Decisions that allows the user 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 the action bar. Click Debug from this bar to enter the Flow Debugger. In the Debugging window, enter a number for Value 1 and Value 2. Click START DEBUGGING 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 was executed one time and saw zero exceptions.
- Click Execution 1 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 added together. Exit out of the Debugger, then save and close the Flow.