Sub-Flows
With Sub-Flows, you can reuse pieces of logic in main Flows and, consequently, save time and memory in your solution. Unlike regular Flows, Sub-Flows are not triggered by user inputs nor script expressions; they are activated using Flow Links in a regular Flow.
The sections on this page provide information about the various aspects of Sub-Flows:
Concept
Sub-Flows are a type of Flow used for recurring topics in a solution, like asking for the user's date of birth. In that case, one single Sub-Flow for can be used and this Sub-Flow can then be called by any Flow that needs the user's date of birth. It should be noted that the Sub-Flow cannot be triggered by anything else except for Flow Links which are defined by the developer in a parent Flow.
Flow Links
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.

When a Flow Link points to a Sub-Flow, the currently active Flow will stay active after the Sub-Flow is executed. In other words, the regular Flow is executed up to the Flow Link, then the Sub-Flow runs and, when completed, the control returns to the regular Flow to continue execution.
You can link multiple Sub-Flows or regular Flows to any Sub-Flow or regular Flow.
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.
Sub-Flows and Variables
When linking to a Sub-Flow, you can specify which Flow Variables can be transferred back and forth. These variables are useful for storing Flow-specific information and can be reused in the main Flow and Sub-Flow. For example, you may want to get a user's email address in a Sub-Flow and then send it back to the parent Flow for further processing.
In the example below, a Flow Link connects a Sub-Flow to a parent Flow and gets a user's email. This can then be added to a mailing list in the parent Flow.

How To
Create a Sub-Flow
- Teneo Studio Desktop
- Teneo Studio Web
To create a Sub-Flow in Teneo Studio Desktop, follow the below steps:
- Open a solution in edit mode.
- In the top ribbon of the Home tab, click the lower part of the Flow button and select Sub-Flow in the dropdown menu.
- The Sub-Flow window opens the backstage view on the Properties tab; add the Name of the Sub-Flow. Optionally, add a Description.
- Click the green Play icon or the back arrow in the top left corner to go to the main Sub-Flow window.
- Select the Output node, give the Output node a Name and, optionally, add a Description and Hyperlink.
- Click the Answer text field and write the conversational AI application's response in the field.
- Remember to Save the flow to conserve the modifications.
- Now, in a parent flow, add a Flow Link node to the Sub-Flow.
To create a Sub-Flow in Studio Web, follow the below steps:
- Optionally, navigate to the folder where the Flow should be created.
- In the lower, right corner of the browser window, click the Create (New Document) button and select Create New Flow.
- The Create New Flow opens, click the Flow field and select Sub-Flow.
- Now, give the Sub-Flow a name and, optionally, add a description.
- Click Add Variable to add any Flow Variables if needed.
- Lastly, click Create.
The new Sub-Flow is automatically opened in edit mode and contains a Bot Output as a placeholder for development of the new Sub-Flow.
Change Flow to a Sub-Flow
This section currently only applies to Teneo Studio Desktop.

To change a regular Flow to a Sub-Flow, with the Flow open, simply click the Sub-Flow button in the top ribbon of the Flow; this will convert the Trigger node into a Sub-Flow node.
Link to a Sub-Flow
- Teneo Studio Desktop
- Teneo Studio Web
With the Flow open, add a Flow Link node by following the below steps:
- Click the Plus icon and, depending on the icon's location in the Flow graph and the desired behavior, select one of the following options:
- Continue With > a Flow Link to pass the dialogue to another flow
- Split Path > to a Flow Link to pass the dialogue to another flow
- Alternatively, select the node in the Flow editor after which the new node should be added. Click the Flow button in the Add Node section of the top ribbon.
- The Flow Link panel opens in the right side of the Flow window, add a Name and, optionally, a Description.
- Click Browse to browse to the location of the Flow to link to.
- Select the wanted Flow and click OK.
- If Flow Variables are declared in the main Flow:
- Select the variable's values to pass To the target Flow, and
- the variable's values to receive From the target Flow
- Remember to Save the Flow to preserve the changes.
In the open Flow, follow the below steps to add a Flow Link:
- Click the Plus icon, and depending on the icon's location in the Flow graph and the desired behavior, select one of the following options:
- Continue With > a Flow Link to pass the dialogue to another flow to add a Flow Link at this point in the Flow dialogue
- Split Path > to a Flow Link to pass the dialogue to another flow to create a new path in the Flow dialogue containing the Flow Link
- Lastly, remember to Save the Flow to preserve the changes.
Edit a Flow Link
- Teneo Studio Desktop
- Teneo Studio Web
With the Flow open, follow the below steps to edit the Flow Link:
- In the Flow editor, select the Flow Link node to open the Flow Link panel in the right side of the Flow window.
- Click Add name to give the Flow Link node a name. Optionally, Add description.
- Under Target, click Browse to browse to the location of the target Flow.
- Select the wanted Flow and click OK.
- If a Flow Link already exists, click Delete Link to remove the target Flow or Open to see the target Flow.
- If Flow Variables are declared in the main Flow:
- Select the variables values to pass To the target Flow.
- Select the variables values to receive From the target Flow.
- Optionally, Add Metadata to the Flow Link node.
- Remember to Save the Flow to preserve the changes.
With the Flow open, follow the below steps to edit the Flow Link:
- In the Call Flow Link node, start writing the Flow name of the Flow you wish to link to.
- If Flow Variables are defined, click add variable mapping to:
- Select the values to send To the target Flow.
- Select the values to return From the target Flow.
- Remember to Save the Flow to preserve the changes.
Delete a Flow Link
- Teneo Studio Desktop
- Teneo Studio Web
In the open Flow, follow the below steps to delete a Flow Link node:
- Select the Flow Link node in the Flow editor.
- In the top ribbon, click Delete.
- Remember to Save the Flow to preserve the changes.
In the open Flow, follow the below steps to delete a Call Flow Link:
- In the Call Flow Link node, click the Recycle Bin in the sidebar.
- Remember to Save the Flow to preserve the changes.
UI
- Teneo Studio Desktop
- Teneo Studio Web
| Icon | Description | Visualization | Related Pages |
|---|---|---|---|
| Shows Flow options. | Flows | ||
| Creates Sub-Flow. | Create a Sub-Flow | ||
| Opens window for creating a Sub-Flow. | ![]() | Resume prompts Flows | |
| Adds Flow Link in (Flow Editor). | Flow Links | ||
| Adds Flow Link (Flow Editor). | Flow Links | ||
| Adds Flow Link (Ribbon Bar). | Flow Links | ||
| Defines Flow Link properties. | Flow Links Metadata Flow Variables |
| Icon | Description | Visualization | Related Pages |
|---|---|---|---|
| Opens window for creating a Flow, Sub-Flow or Prompt Flow. | ![]() | Flows Flow Variables | |
| Adds Flow Link. | ![]() | Flow Links | |
| Adds Flow Link. | Flow Links | ||
![]() | Adds Flow Link properties. | ![]() | Flow Links Flow Variables |
A Flow Link is also called a call to a Flow in Teneo Studio Web.
Practical Examples
Linking to a Sub-Flow
Requesting someone's email address is a great example of a Sub-Flow, as it can be useful in various types of main Flows.
This is how a conversation should look:
User: I'd like to subscribe to your newsletter
Bot: I'm happy to add you as a recipient of our free newsletter. Please enter your email address.
User: teneo@example.com
Bot: I have your email as teneo@example.com. Is that correct?
User: no
Bot: Please enter your email address.
User: teneo@example.com
Bot: Is your email address teneo@example.com correct? Please confirm.
User: yes
Bot: OK, thank you! I'm adding your address teneo@example.com to our mailing list. You will receive a confirmation mail shortly.
We will implement the conversation in two steps:
- Build the Sub-Flow.
- Build the main Flow.
Build the Sub-Flow
- Teneo Studio Desktop
- Teneo Studio Web
Our Sub-Flow that gets the user's email will ask the user to enter an email address, confirm with the user that the email was correct, and if correct, return the email. If not correct, the user will be re-prompted. This continues until a correct email is entered. The final Sub-Flow will look as follows:

- You can create a new Sub-Flow by clicking on the dropdown menu below 'Flow' and calling it
Get email address. - In the 'Flow' tab, go to 'Variables', add a Flow Variable called
emailand initialize it to empty string" ". - Click the arrow to return to the 'Home' tab.
Our Sub-Flow to retrieve the user's email will ask the user to enter an email address, confirm with the user that the email was correct, and if correct, return the email. If not correct, the user will be re-prompted. This continues until a correct email was entered. The final Sub-Flow will look as follows:

First we will create a new Sub-Flow.
- You can create a new Sub-Flow by clicking on the Create button and selecting 'Sub Flow' from the dropdown menu.
- Name the Sub-Flow
Get email address. - Add a variable and name it email. Initialize it to empty string " " and click on 'Add'.
- Click on 'Create' to create your flow.
Add a Prompt for E-mail
- Teneo Studio Desktop
- Teneo Studio Web
- Select the output node and name it
Prompt for email. - Give it the output
Please enter your email address. - Add a new output node to follow it by clicking the Plus icon followed by 'Continue with' and 'Transaction'.
- Select the new transition and call it
Email entered. Make sure it is set to 'Get input before continuing'. - With the transition in the Flow still marked, navigate to the Match section and a Match for 'TLML Syntax'.
- Add the Syntax Condition
%EMAIL_ADDRESS.SCRIPT^{email=_USED_WORDS}.
- Select the output node and name it
Prompt for email. - Give it the output
Please enter your email address. - Add a new output node to follow it by clicking the Plus icon followed by 'Continue with' and 'Transaction'.
- Name the new transition
Email entered. - Click the Plus icon underneath the transition, followed by 'Match' and 'TLML Syntax'.
- Add the Syntax Condition
%EMAIL_ADDRESS.SCRIPT^{email=_USED_WORDS}.
Set Up the Sub-Flow to Re-prompt
- Teneo Studio Desktop
- Teneo Studio Web
- Name the output node
Confirm emailand give it an answerI have your email as ${email}, is that correct?. - Select the 'Confirm email' output node and using the mousekey, drag and drop a transition back to the output 'Prompt for email'.
- Make sure the transition is set to 'Get input before continuing'.
- Call the transition
Re-tryand add the following example inputs:
1 no
2 nope
3 nah
4
- Finally, add a Match by clicking on the 'Generate' button to automatically generate a Match requirement based on the Intent examples specification. In this case the language object
NO.PHR. This will send your flow back to the beginning if the email stored is wrong.
- Locate the Output node. Name it
Confirm emailand give it the answerI have your email as ${userEmail}, is that correct?. - Navigate to the bottom of the 'Confirm email' output node and using the mousekey, drag and drop a transition back to the output 'Prompt for email'.
- Click on the Plus icon on the newly created transition between 'Confirm email' and 'Prompt for email'. Select 'Continue with' and 'transaction element' followed by 'Response'.
- Now click on the same Plus icon again, this time selecting 'Match' and 'Language object'.
- Paste in the following:
NO.PHR. This will cover various versions of the word "no".
Set Up a Positive Confirmation of the Email
- Teneo Studio Desktop
- Teneo Studio Web
-
Click on the Plus icon above the 'Re-Try' Transition, followed up with 'Split Path' and 'Transaction'.
-
Select the Output node and name it
Email confirmed. -
Add the following answer:
Ok, thank you! -
Select the new transition and make sure it is set to 'Gets input before continuing'.
-
Call the transition
Confirmedand add the following example inputs:1 yeah
2 yup
3 yes
4 -
Finally, generate a Match. Click on the 'Generate' button under the 'Match' section to automatically generate a Match requirment based on the Intent example specification. In this case the language object
YES.PHR. This will let you proceed if the email stored is correct. -
Click 'Save'.
This Sub-Flow can now be reused in other Flows to get the user's email.
- Click on the Plus icon above the Match containing the
NO.PHRlanguage object. Select 'Split Path' and 'Transaction'. - Select the Output node at the end of this path and name it
Email confirmed. - Add the following answer:
OK, thank you! I'm adding your address ${userEmail}. You will receive a confirmation mail shortly. - Name the User Intent above this output node
Confirmedand add the following example inputs:
yeah
yup
yes
- Finally, generate a Match. Click on the Plus icon above the output node (the Plus icon will have a yellow 'TODO' message next to it) and select 'Match' and 'Generate' to automatically generate a Match requirement based on the Intent example specification. In this case we will generate language object
YES.PHR. This will let you proceed if the email stored is correct. - Save the Flow.
That's it! We can now use this Sub-Flow that requests the user's email address in as many other flows as we want. In the next section, we will show you how exactly to do that.
Build the Main Flow
At this point, we have a Sub-Flow that is not being used anywhere. Since it does not have a trigger, Teneo will never select it. In this section, we will build a Flow to trigger if users request to be added to a mailing list. Later this Flow will make use of the Sub-Flow 'Get email address' that we created above. But for now, we will just build the question and answer. We will add the Sub-Flow link later.
- Teneo Studio Desktop
- Teneo Studio Web
-
Create a Flow and name it
User wants to subscribe to the mailing list. -
In the 'Flow' tab under 'Variables', add a Flow Variable called
emailand initialize it to empty string"". -
Click the arrow to return to the home page.
-
Select the trigger, call it
Subscribe to the mailing listand add the following positive Intent example inputs:1 Can i get your newsletter?
2 How can i subscribe to the newsletter?
3 How to get on your mailing list?
4 I want to subscribe to your mailing list
5 I'd like to subscribe to the newsletter
6 Please add me to your mailing list
7 Please put me on the mailing list
8 -
Click on the 'Generate' button in the Match section to automatically generate the best Match based on the example specification.
-
Call the output node
Happy to add you to our mailing list. -
Select the output node and add an answer
I would be happy to add you to our mailing list to receive our free newsletter.
-
Create a Flow and name it
User wants to subscribe to the mailing list. -
Add a Flow Variable called
emailand initialize it to empty string"". Click 'Add' to add the variable. -
Click on 'Create' to create the Flow.
-
Name the trigger
Subscribe to the mailing listand add the following positive Intent examples:Can i get your newsletter?How can i subscribe to the newsletter?How to get on your mailing list?I want to subscribe to your mailing listI'd like to subscribe to the newsletterPlease add me to your mailing listPlease put me on the mailing list -
Click on Plus icon below the trigger, followed by 'Match' and 'Generate' to automatically generate the best Match based on the example specification.
-
Call the output node
Happy to add you to our mailing list. -
In the output node, add the answer
I would be happy to add you to our mailing list to receive our free newsletter.
Add a Call to the Sub-Flow
- Teneo Studio Desktop
- Teneo Studio Web
Now we want to pass control to the Sub-Flow and let it do all the work of prompting the user for an email address.
- Click on the Plus icon below the output followed by 'Continue With' and 'Flow Link'.
- Name the transition
Call Sub-flowand make sure 'Get input before continuing' is unchecked. - Select the 'Flow' node and call it
Get email address. - With the 'Get email address' node selected, make sure the sidebar area 'Flow Link' is visible. Click 'Browse' and select our Sub-Flow 'Get email address' inside the 'Flows' folder.
- Retrieve the email address from the Sub-Flow: in the section 'From', where you see 'Get the value back', select email from the dropdown list.
Now we want to pass control to the Sub-Flow and let it do all the work of prompting the user for an email address.
- Click on the Plus icon below the output followed by 'Continue With' and 'Flow Link'.
- Using the dropdown menu, locate our 'Get email address' Sub-Flow.
- Retrieve the email address from the Sub-Flow: in the section 'From', where you see 'Get the value back', select email from the dropdown lists.
Finish the Flow
- Teneo Studio Desktop
- Teneo Studio Web
- Select the Plus icon below the 'Flow' node and add a new output node by hovering over 'Continue With', followed by 'Transaction Element Output'.
- Name the transition
Return from Sub-flowand make sure 'Get input before continuing' is unchecked. - Call the output node
Confirmation. - Lastly, give the output an answer
I'm adding your address ${email} to our mailing list. You should receive a confirmation mail shortly. - Hit 'Save'.
- Select the Plus icon below the 'Flow' node and add a new output node by selecting 'Continue With', followed by 'Transaction Element Output'.
- Call the output node
Confirmation. - Lastly, give the output an answer
I'm adding your address ${email} to our mailing list. You should receive a confirmation mail shortly.. - Hit 'Save'.
You should now be able to replicate the conversation below in Tryout. Note that the answer parts from the Sub-Flow are italic for illustrative purposes. In practice, they will not be distinguishable from the answers of the main Flow:
User: I want to subscribe to your newsletter!
Bot: I'm happy to add you to receive our completely free newsletter. Please enter your email address.
User: teneo@example.com
Bot: I have your email as teneo@example.com, is that correct?
User: Yes.
Bot: OK, thank you! I'm adding your address teneo@example.com to our mailing list. You should receive a confirmation mail shortly.
If the name of the Sub-Flow should change at some point, all existing connections between main Flows and this Sub-Flow will automatically be updated by Teneo.




