Enable and disable flows using Rule Cells
Another good use of Rule cells is to branch, enable or disable specific flows or part of flows. See the scenarios below to better understand:
Case 1: when you want to branch, in a single flow, which path each customer will follow, without having to edit your whole flow structure.
Case 2: when you want your flow to be available only for a specific group of users
Case 3: to switch on/off a flow (seasonal or promotional flows, for example).
For these scenarios, we can combine the use of Code, Service and Rule cells. Let's break down each case below.
Manually toggling your flows
You may want to manually disable a flow during a specific period. Rather than updating your flows, by adding or removing cells, or even changing their connections, we recommend the use of a Rule cell with a custom variable.
Add a Code Cell right before your branching paths, or at the beginning of your virtual agent in your Welcome flow, if you want to use this same variable in several places, with a availability variable, such as:
Or true if you want to enable it:
See in the image below how the flow was built to branch between a path for a transactional or an informational flow. In this scenario it was used (true) to enable the transactional flow and (false) to disable it:
You may use any number of variables for any number of paths you want to possibly block by different parameters.
Branching paths
Open a Rule Cell with the following evaluation:
This will enter into the branching path you want to access only periodically. If the specified variable is false, you'll fallback into a not expected answer, so you might also want to add a fallback rule (yourVariable == false) and add an answer cell with a message about this functionality unavailability.
You may also use the virtual agent parameter, or even an environment parameter, rather than a Code cell, to toggle which path will be taken bot-wide or environment-wide.
Automatically toggling your flows with your API
If you want to custom a time frame, such as disabling a few operations between 0am and 5am, for example, have a user-specific flow, or any more advanced branching path for flows based on an external variable, you may instead implement your own API and use a Service Cell, setting a variable as true or false immediately before executing the Rule Cell and evaluating it.
Last updated