How to effectively use Cancel Config with your AtBot

Matt Wade
AtBot
Published in
4 min readAug 29, 2019

A pretty common need for a chatbot user is the option to cancel a request they’ve submitted. AtBot is built to accept that request and run with it. Canceling is basically a form of error handling, so you have to plan for it and build out the logic to make things work as expected. This article provides some best practices for working with the Cancel Config feature in AtBot Premium.

You can find the Cancel Config settings under the Help & Messages tab in the Bot Details page of the AtBot Admin Center. Here, you can provide various terms that can be used to cancel a bot’s action along the way. Separate them by commas and you’ll have a dictionary of action killers!

Some common phrases for termination requests.

Cancelation requests work differently depending on which section of an AtBot Skill you’re in. A Skill is defined as a workflow in Power Automate (or Azure LogicApps) triggered by LUIS or a LUIS Intent Vector.

Canceling during a LUIS intent vector

For cancel requests during a LUIS intent vector — when the vector is asking for required information, for example — the cancel command is clean and simply stops the process. At that point in the AtBot Skill, nothing’s been done with the information and the bot is still strictly in an information-collection mode. There are no negative ramifications to canceling the Skill and AtBot will stop the process and return to the state it was in prior to kicking off that Skill.

Canceling during a Flow

For cancel requests that come in during the Flow part of the Skill, the Flow needs to be set up to accept a cancel request and then kill the Flow. The practical outcome to this means that if you want to allow for a cancelation, each AtBot action that requires input (e.g., Get Response, Get Choice Response, Get Adaptive Card Response) must have a condition after the step to check for the property Cancellation Notice.

If the Cancellation Notice is true, set the Flow to terminate in the Yes actions. If it’s false, continue with the Flow as designed by leaving the No actions empty. Each get response-type action will come with its own Cancellation Notice value, so you can check that value after each step.

As an example, the screenshot below represents a citizen services bot with a Skill that will find the status of a bus line. The first action is to ask the user which stop they’re at. If they decide to cancel the Skill as they’re asked which stop they’re at, the bot needs to know this and terminate. Otherwise the Skill will continue running even though the bot confirmed the cancelation request.

Note the use of the Terminate action in the Yes actions of the condition; the No actions remain empty because if the user didn’t request a cancelation, there’s nothing to do with this condition.

This is an important feature because there might be the need to use additional logic to retract actions taken prior to the cancel request. For example, let’s say a user opens a trouble ticket with a tech support bot. The first action for the bot is opening a ticket in a tool like Service Now or Zendesk, recording the user’s information, intent, and the ticket topic.

And let’s say that once the user gets through the first troubleshooting question, the user realizes they did something wrong and fix it themselves. So they tell the bot to cancel the request. But the ticket was already opened.

Canceling the process should close or delete the ticket, not just leave the ticket open and hanging. In that situation, the true condition actions would include steps to find ticket, close ticket, inform the user the bot received the request and confirm the request was canceled, then terminate the Flow. Without the option to retract earlier steps, there’d be no way to fall back to the status prior to the cancel request.

This all boils down to a recommendation to provide a cancelation check after every input action in an AtBot Skill so you can deal with error handling in a smart, robust way. With the Cancel Config feature, you can have a fully featured, no-code bot that is able to react in an agile and intelligent way.

AtBot brings AI within reach

AtBot is the premiere bot-as-a-service solution for the Microsoft cloud. Built completely within Azure, AtBot is your out-of-the-box, easy-to-configure bot for Teams, SharePoint, or the web. Teach AtBot tasks using Power Automate, make him your corporate source of knowledge with QnA Maker, help him understand almost anything your colleagues could ask thanks to LUIS, and manage his features with the AtBot Admin Portal. Get going with AtBot Free or start your free trial of AtBot Premium today.

--

--

Matt Wade
AtBot
Writer for

Microsoft MVP • Office 365 & Microsoft Teams specialist • NY→USVI→DC→NY