Subflows

Descope Subflows are a way of reusing a flow within another flow. Subflows can be used in scenarios where a user needs to create a custom flow utilizing multiple flows. Any flow can be used within a subflow. This means that any flow ('subflow') can be added to another flow ('main flow') and be a part of its logic.

This overview of Descope Subflows will cover creation, editing and managing subflows using our flow builder.

Further details about flow builder shortcuts, custom flows, disabling flows, and exporting/importing flows can be found under Managing Flows.

Managing Descope Subflows

View a Subflow

When subflows are used, they are referenced in the "Used In" column of the main flow using it.

Subflows view example

Create a Subflow

Subflows can be utilized in flows which are created from scratch as well as those derived from a flow template. Open the flow builder of the selected flow, click on the + button at the top right. You will then select Flow option from where you choose a flow from the library.

Subflows create example

All available flows from "Your Flows" appear in this list. The only flow that doesn't appear is the current flow itself.

Subflows dropdown selection

A new subflow step type is added, having aggregated multi-steps view. By default, it will appear in "collapse" mode. You click on each step to expand them.

Subflows component

In order to access the subflow, just double click on the subflow component, a new tab opens right next to the main flow in use.

Subflows tab

Once the subflow placement in the main flow is completed, save the flow and run it to test its working.

Subflows included in a flow

One thing to note is that you can add flows inside a subflow as well. All the flows will then appear as multiple tabs (as seen in the above image) in the flow builder for easy access.

Additionally, any output of the subflow which is not handled, as well as any end step, becomes an output of the subflow's step in the main flow. This will further require handling (linking) in the main flow.

Unlike a regular end that returns a jwt, when in subflow, the flow will just continue to the next step without generating a jwt token.

Just like in a regular flow, context such as form inputs, connector responses, and scriptlet outputs is still passed along to these subflows, where it can be further utilized.

Edit a Subflow

A subflow step can be modified by clicking onto the pencil icon to edit. Once clicked, a new tab opens in the flow builder of the selected subflow. The user will edit this subflow like any other regular flow.

Subflows editing

Additionally, when a flow has been edited, an asterisk appears right next to the subflow name on the tab. This indicates your unsaved work. Make sure to save your changes. Descoper can work on the main flow concurrently, even if the subflows are in progress.

Since Descoper is editing the subflow, they will be able to open it in the same flow builder. This option is not limited to one subflow per main flow, but any subflow the Descoper wishes to view/edit.

Save a Subflow

Saving operation is done per flow. While navigating outside the flow builder, all the flows will show an asterisk symbol as mentioned in the above section. These indicate all current open flows.

Delete a Subflow

Descoper gets an option to delete a flow being used in other flows. Simply click on the 3 dots and select Delete from the action menu. If this flow was reused in other flows, the Descoper sees a warning dialog box with list of flow names where the deleted flow is being used. Once confirmed by providing flow name, your selected flow is deleted.

Subflows delete

Subflows delete confirmation

Was this helpful?

On this page