Other flow elements

Flows can contain many more elements than just triggers, outputs and transitions. This page highlights some of them.

Flow elements

Script nodes

With Script nodes you can execute scripts during the processing of the flow. For example, you can use scripts to look up information or calculate values. Its position in the flow defines if and when the script is executed. In Teneo, scripts are written in Groovy. More details on scripting in Teneo can be found here: Scripting. You can find a practical example of how to add a script node to a flow here: Add a script to a flow.

In Teneo you can link flows together, making it possible to combine processes that were implemented in different flows.

You can either link to sub-flows or to regular flows. Both result in different behaviour. When linking to a sub-flow, the dialog is handed back when the sub-flow has finished processing.

Linking to subflows

This is not the case when linking to regular flows. When flow A links to another regular flow B, the processing of flow A stops and flow B takes over. When flow B has finished executing, processing ends.

Linking to regular flows

Another thing to remember when linking to regular flows: the triggers and trigger-listeners of the flow you link to are ignored.

To link to a (sub)flow, click the 'Flow' icon in the ribbon. Once added, you can specify which flow you would like to link to. When linking to a flow you can specify which variables can be transferred back and forth.

Junctions

Junctions help you to model the layout and logic of your flow. Multiple transitions can point to the same junction, or a junction can be the starting point of multiple transitions. The same is true of other flow elements (like outputs or script nodes), but all those elements perform a specific function. Junction themselves don't do anything, they don't execute scripts, don't display an output, they just offer an easy way to model your flow.

Integrations

Integrations make it easy to make programmatic calls to external services. For example, a weather integration can contain code that calls an external weather service, parses the response and returns a weather description and the temperature. Once created, the integration can then be used by any flow in your solution. It will appear in the ribbon (as shown in the screenshot above). Clicking it adds the integration as a node to your flow.

More information on scripting and how to add integrations to your solution can be found in the Scripting section.

Prompt triggers

Prompt triggers (or Dialogue Continuation Prompt Triggers) behave quite differently from intent triggers. Prompt triggers can append a flow to the last flow that was executed. When Teneo has executed a flow and is about to return the response, it will check if there are flows with prompt triggers that need to be executed first. If a prompt trigger matches, the flow containing this trigger will be executed and the resulting output will be appended to the response. For example, you could create flow with a prompt trigger that asks a user for feedback after x number of inputs.

Prompt triggers contain a Groovy expression (as opposed to syntax triggers that contain a language condition) and have their own ordering groups. For an example of how to use prompt triggers: How to make your bot pro-active.

'On top' and 'On drop' scripts

Throughout the lifetime of your bot, you may need to execute scripts and code. Sometimes you may need to execute some code as soon as a flow is triggered or when a flow has finished processing. For this you can use 'On top' and 'On drop' scripts. The 'On top' script is triggered each time a flow is triggered or when a flow is resumed (in other words, when a flow reaches the top of the flow stack). When a flow reaches the end-node (when the flow is dropped from the flow stack), the 'On drop' script is executed.

When editing a flow, you can add the 'On top' and 'On drop' scripts by clicking on the 'Flow' tab in the top left corner of your flow window. Then click on 'Scripts' and add your code to the relevant field.

There are many more places where you can store and execute code. For a fuller explanation, see the Scripting section.

Was this page helpful?