Implementing OnError Loop Handling
This page describes how to implement an OnError loop "circuit breaker" to prevent infinite loops in your system. Infinite loop handling is necessary because it prevents your bot from running indefinitely. An infinite loop in a bot, for example, could lead to Parloa going in circles and never reaching the next State block, forcing the bot to cut off after 50 loops through the same node within a few seconds. Implementing an OnError loop "circuit breaker" can help stop these infinite loops.
How To Implement the OnError Circuit Breaker
Step 1 â Create and Initialize the Variable
In the dialog, click the Variables tab.
Click the + Add New Variable button.
Name the variable, for example
OnErrorCounter
.Initialize the variable in the TechSetup subdialog with a value of
0
.
Step 2 â Modify the Global Intent On Error Path
Add a Condition block in the global intent On Error path.
Set the condition to
OnErrorCounter < 2
.
Step 3 â Increment the Error Counter
Add a Storage block in the global intent On Error path.
Increate the value of
OnErrorCounter
by 1:++OnErrorCounter
.
Step 4 â Handle Exceeding Errors
Add an End Conversation block with a clear and concise message. For example:
Alternatively, add a Call Control block to forward the call to a predefined default destination, such as customer support or a fallback handler.
Last updated