Prompt Triggers
Prompt Triggers are used to execute Flows when certain circumstances are met, e.g. when a Global Variable has a certain value or when another Flow has completed.
The pages in this section provide information about the various aspects of Prompt Triggers:
Concept
Sometimes we want our bot to give some extra information that the user did not explicitly request, such as special deals, promotions and more. We can accomplish this by using Prompt Triggers.
Prompt Triggers do not make use of match requirements, but are executed only in specific circumstances, for example, when a Global Variable has a certain value or when another Flow has completed. A Prompt Trigger may also be executed when the dialogue length is greater than a certain value or the current date within a specific date range.
The circumstances that trigger a Prompt Trigger are defined by Groovy script expressions which are tested when the flow stack becomes empty, i.e. when the last active Flow is dropped and the bot has nothing else to process. If a Prompt Trigger matches, the Flow containing this trigger will be executed and the resulting output will be added to the response.
Intent Triggers are triggered by Matches in the user input, whereas Prompt Triggers are triggered by external circumstances.
Prompt Flows
A Prompt Flow refers to any Flow that contains a Prompt Trigger. It can be created by...
-
opening a new Prompt Flow, which automatically adds a Prompt Trigger to the beginning.
-
simply adding a Prompt Trigger to a regular Flow after its creation.
Please see the UI section to learn more about how Prompt Flows and Prompt Triggers are added.
Prompt Trigger Ordering
To control the order in which Prompt Triggers are tested in a solution, read more about Trigger Ordering.
Prompt Trigger ordering is only available in Teneo Studio Desktop.
How To
Create Prompt Flow
- Teneo Studio Desktop
- Teneo Studio Web
To create a Prompt Flow in Studio Desktop, follow the below steps:
- In the top ribbon of the Home tab, click the lower part of the Flow button.
- Select Prompt Flow.
- The new Prompt Flow window opens on the Properties tab in the backstage, add the Name of the Prompt Flow.
- Optionally, add a Description and/or a Resume Prompt.
- Click the green Play icon or the back arrow in the top, left corner to go to the main Flow window.
- Select the Prompt Trigger, add the Expression in the right-side panel, optionally give the Prompt Trigger a Name and Description.
- Select the Output node, add the wanted Answer, optionally, add a Name, Description and Output Hyperlink.
- Remember to Save the Prompt Flow to conserve the modifications.
To create a new Prompt 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 Prompt Flow.
- Now, give the Prompt Flow a name and, optionally, add a description.
- Click Add Variable to add any Flow Variable, if needed.
- Lastly, click Create.
- Remember to Save the Flow to preserve any modifications.
If the Flow should always be considered, write the word true in the expression field.
The new Prompt Flow is automatically opened in edit mode and contains a Prompt Trigger and a Bot Output node as placeholders for development of the new Prompt Flow.
Add Prompt Trigger
- Teneo Studio Desktop
- Teneo Studio Web
With the Flow open, follow the below steps:
- Click the Plus icon available before the raise label and select Add Prompt. Alternatively, in the Flow's top ribbon, click Add Prompt.
![]()
- Next, select the Prompt Trigger in the Flow editor.
- Optionally, give it a Name.
- Write a Description in the right-side panel.
- Under Expression, add the script expression (Groovy).
- Under Triggering, select an order groups.
- In the Advanced Options section, specify if the Prompt Trigger should be Matched only once per session or potentially always*.
- Under Metadata, click Add to add Metadata definitions.
- Select the Output node and enter relevant details.
- Remember to Save the Flow to preserve the modifications.
When always is selected, the Flow may be triggered every time that the flow stack is empty in all sessions.
If you want a Prompt Trigger to execute more than once per session (but not all the time) untick the Matched only once per session option in the trigger's configuration panel and use programmatic or Flow logic to control how often the Prompt Trigger is fired per session. See the Practical Examples section for an example.
With the Flow open, follow the below steps:
- Click the Plus icon available before the raise label.
![]()
-
In the Trigger group, select Trigger after the input is processed to Prompt the user.
-
In the Prompt Trigger:
-
Optionally, click Add name to give the Prompt Trigger a name.
-
In the Expression field, add the script expression (Groovy).
-
-
Remember to Save the Flow to preserve the modifications.
Expand the Script editor for a better overview and bigger workspace by clicking the Expand icon in the lower, right side of the node.
Edit Prompt Trigger
- Teneo Studio Desktop
- Teneo Studio Web
With the Flow open, follow the below steps:
- Select the Prompt Trigger in the Flow editor, this will open the right-side Prompt Trigger panel. If the panel does not open automatically, click Prompt Trigger in the right side of the Flow window.
- Now, edit the wanted properties.
- Remember to Save the Flow to preserve the changes.
With the Flow open, follow the below steps:
- Simply select the Prompt Trigger in the Flow editor.
- Edit the name by clicking Add name.
- Click in the Expression field to edit the script expression.
- Remember to Save the Flow to preserve the changes.
Delete Prompt Trigger
- Teneo Studio Desktop
- Teneo Studio Web
With the Flow open, follow the below steps:
- Select the Prompt Trigger in the Flow editor.
- In the top ribbon, click Delete.
- Remember to Save the Flow to preserve the changes.
With the Flow open, follow the below steps:
- In the Prompt Trigger, click the Recycle Bin in the sidebar
- Remember to Save the Flow to preserve the changes.
UI
Icons
- Teneo Studio Desktop
- Teneo Studio Web
| Icon | Description | Visualization | Related Pages |
|---|---|---|---|
| Prompt Trigger in the Flow. | A configuration panel opens on the right; please see Prompt Trigger. | Prompt Trigger | |
| Adds Prompt Trigger in Flow. | Prompt Trigger | ||
| Opens ordering for Prompt Triggers | Trigger Ordering Prompt Trigger Ordering | ||
![]() | Creates a Prompt Flow. | Flows Prompt Flow |
| Icon | Description | Visualization | Related Pages |
|---|---|---|---|
| Adds Prompt Trigger in Flow. | Prompt Trigger | ||
| Creates a Prompt Flow from the Flows page. | A new window opens; please see Prompt Flow. | Flows Prompt Flow |
Prompt Flow
- Teneo Studio Desktop
- Teneo Studio Web

| Section | Description |
|---|---|
| Name | Adds a name for easy identification of the Flow. |
| Description | Adds a description of the Flow. |
| Flow Location | Folder where the Flow is saved. |
| Resume Prompt | Given when a user returns to a Flow after discussing something else. Reminds the user what they were discussing with the bot. |

| Section | Description |
|---|---|
| Drop-down menu | Choose between Flow, Sub-Flow or Prompt Flow. |
| Flow name | Add a name for the Flow. |
| Flow description | Add a description for the flow. Optional. |
| Variables | Create Flow Variables associated with the Prompt Flow. Optional. |
Prompt Trigger
- Teneo Studio Desktop
- Teneo Studio Web

| Section | Description |
|---|---|
| Prompt Trigger | Adds a name and description for the Prompt Trigger. |
| Expression | Groovy script expressions which are tested when the flow stack becomes empty. |
| Open With... | Opens an external code editor. |

| Section | Description |
|---|---|
| Add name | Adds a name for the Prompt Trigger. |
| Expression | Groovy script expressions which are tested when the flow stack becomes empty. |
| Recycle Bin | Deletes Prompt Trigger. |
Practical Examples
Use a Prompt Trigger
In our example, we are developing a solution for a fictional coffee shop. In the example below, the first part of the bot's answer comes from a Flow handling user requests to order a coffee, while the second part, in italics, comes from a Flow with a Prompt Trigger:
User: Could I get a large macchiato?
Bot: Ok, a large macchiato will be ready for pickup in 5 minutes. It is cookie hour right now! You’ll get a free cookie to go along with your coffee.
This Prompt Trigger is designed to only match during a certain time of day. We can implement this by doing the following:
- Teneo Studio Desktop
- Teneo Studio Web
-
Create a new Prompt Flow called
Cookie hour campaignusing the Flow dropdown menu in the ribbon bar. -
In the output node, paste the following: "It is cookie hour right now! You’ll get a free cookie to go along with your coffee."
-
In the Prompt Trigger, paste the following script:
// get the hour of the day
def currentHour = java.time.LocalDateTime.now().getHour()
// is it cookie hour?
(currentHour == 16) -
Save the Flow.

When interacting with the bot in Tryout between 16:00 and 17:00, the Prompt Flow's output answer text will be added to the bot output.
-
Create a new Prompt Flow called
Cookie hour campaignby clicking on Create new Flow and then selecting Prompt Flow from the dropdown menu. -
In the output node, paste the following: "It is cookie hour right now! You’ll get a free cookie to go along with your coffee."
-
In the Prompt Trigger, paste the following script:
// get the hour of the day
def currentHour = java.time.LocalDateTime.now().getHour()
// is it cookie hour?
(currentHour == 16) -
Save the Flow.

