+55 (21) 960104492
Log In Free trial
Select region

Transition to scenario

Dialog scenarios are needed for bot or employees to communicate with clients. The "Transition to scenario" block allows you to add up to 30 nested scenarios to one main scenario and up to 5 nested scenarios to each other. Variables are automatically passed between all scenarios of the same bot.

When receiving messages from customers, you can run nested scenarios for different sections of the site and context. For example, different dialogs for a promotional campaign, for orders in the online store and communication with regular customers.

Transition to nested scenarios

To add nested scripts:

1. Go to the Script editor and open the script that will be the main one.

2. Add the "Transition to scenario" block to the workspace.

2. Click in the "Scenario" field and a list of all scenarios that are linked to the current account will appear.

Select the scenario you want to put into the main one.

3. Place the block in the main scenario, where you want to transfer the client to the selected nested scenario.

The "Transition to scenario" block can be connected to any other block.

  • Only one Transition to Scenario block can be added to a nested scenario.
  • In total, you can add a maximum of 5 linked "Transition to Scenario" blocks following from one main block.
  • The "Reaction to phrase" block in the logic of transitions between scenarios works only within a nested scenario.

Using the block in the Bot constructor options

1. The blocks "Close dialog", "Auto close dialog" and sending the /start command after executing a nested scenario will take the bot to the beginning of the main scenario. If they are not present, the bot will go to the previous scenario of any type, nested or main (see point 4).

2. To recycle a nested script, add a "Return to start" block at the end or send the "/clearall" command. Then the bot will not go to the main script after executing the nested script and will return to the beginning.

3. The "Incoming webhook" block in a nested script must be combined with the "Send message*" block. When the "Incoming webhook" block is triggered, the bot switches to the webhook script. After its execution, the bot returns to the beginning of the script where it stopped before the incoming webhook. 

4. The Transition to Scenario block can be a dead-end block. A deadlock block has an output but is not connected to the next block. When a deadlock block is reached in a nested scenario, the bot will return to executing the "Transition to scenario" block in the previous scenario of any type, nested or main.

  • Schematic of the execution of the deadlock block scenario:

  • Schematic of script execution with deadlock block via webhook:

Leave a request for integrator services