Teneo Developers

Theory/Core Concepts

Sub-Flows are often used for re-usable pieces of logic. For example, you might have a solution in which multiple flows need to ask for a date of birth. In that case, one single Sub-Flow that asks for the date of birth can be used. This Sub-Flow can then be called by any flow that needs the user's date of birth.

Unlike regular flows, Sub-Flows are not triggered by a user input. In fact, Sub-Flows do not have triggers at all. Sub-Flows can only be activated when linked to from other flows.

Linking to a Sub-Flow

Once the Sub-Flow has finished processing, execution will be handed back to the parent flow. One flow can link to multiple Sub-Flows, which will behave as if they were part of the parent flow. Sub-Flows can also link to other Sub-Flows. When linking to a Sub-Flow you can specify which variables can be transferred back and forth. If an output in the Sub-Flow uses a revisitability limit and that limit is exceeded, the Sub-Flow and all calling flows are dropped.

linking subflow

Creating a Sub-Flow

Sub-Flows are created as easily as regular flows by clicking on the arrow below 'Flows' and selecting 'Sub-Flows'.

1-create sub flow

It is also possible to turn a regular flow into a Sub-Flow. To do that, simply click on the 'Sub-Flow' icon in the 'Flow Entry' group of the ribbon when editing a flow. This will remove the trigger and turn it into a Sub-Flow entry point.

2-turn into sub flow

Once a Sub-Flow has been created, it will look something like this:

3-sub flow entry point

Linking to a Sub-Flow

Sub-Flows are ideal for reusable logic. In this example, we have created a Sub-Flow to get the user's email address, which could be needed for various use cases:

4-get email address flow

We can then call this Sub-Flow from other flows to get the user's email whenever necessary. In the example below, we used this Sub-Flow in a Flow where we add the user to a mailing list.

5-call to sub flow

When calling a Sub-Flow, we can send and receive values to and from the Sub-Flow. In this case, we do not send any values, but we receive one (i.e. the email address).

Next page
Junctions
Was this page helpful?