Virtual Assistants Overview
Natural Language Processing (NLP)
Concepts and Terminology
Quick Start Guide
Accessing the Platform
Working with the Builder
Building a Virtual Assistant
Using Workspaces
Release Notes
Current Version
Previous Versions

Dialog Tasks
Dialog Builder
Node Types
Intent Node
Dialog Node
Entity Node
Form Node
Confirmation Node
Message Nodes
Logic Node
Bot Action Node
Service Node
Webhook Node
Script Node
Group Node
Agent Transfer
User Prompts
Voice Call Properties
Dialog Task Management
Connections & Transitions
Component Transition
Context Object
Event Handlers
Knowledge Graph
Knowledge Extraction
Build Knowledge Graph
Add Knowledge Graph to Bot
Create the Graph
Build Knowledge Graph
Add FAQs
Run a Task
Build FAQs from an Existing Source
Traits, Synonyms, and Stop Words
Manage Variable Namespaces
Move Question and Answers Between Nodes
Edit and Delete Terms
Edit Questions and Responses
Knowledge Graph Training
Knowledge Graph Analysis
Knowledge Graph Import and Export
Importing Knowledge Graph
Exporting Knowledge Graph
Creating a Knowledge Graph
From a CSV File
From a JSON file
Auto-Generate Knowledge Graph
Alert Tasks
Small Talk
Digital Skills
Digital Forms
ML Engine
Model Validation
FM Engine
KG Engine
Traits Engine
Ranking and Resolver
NLP Configurations
NLP Guidelines
Contextual Memory
Contextual Intents
Interruption Management
Multi-intent Detection
Amending Entities
Default Conversations
Sentinment Management
Tone Analysis
Test & Debug
Talk to Bot
Utterence Testing
Batch Testing
Conversation Testing
Conversations Dashboard
Performance Dashboard
Custom Dashboards
Meta Tags
Dashboards and Widgets
Conversation Flows
NLP Metrics
Containment Metrics
Usage Metrics
Smart Bots
Universal Bots
Universal Bot Definition
Universal Bot Creation
Training a Universal Bot
Universal Bot Customizations
Enabling Languages
Manage Assistant
Plan & Usage
Usage Plans
Support Plans
Multilingual Virtual Assistants
Masking PII Details
IVR Settings
General Settings
Assistant Management
Data Table
Table Views
App Definitions
Sharing Data Tables or Views

Build a Flight Status Assistant
Design Conversation Skills
Create a Sample Banking Assistant
Create a Transfer Funds Task
Create a Update Balance Task
Create a Knowledge Graph
Set Up a Smart Alert
Design Digital Skills
Configure Digital Forms
Configure Digital Views
Add Data to Data Tables
Update Data in Data Tables
Add Data from Digital Forms
Train the Assistant
Use Traits
Use Patterns for Intents & Entities
Manage Context Switching
Deploy the Assistant
Configure an Agent Transfer
Use Assistant Functions
Use Content Variables
Use Global Variables
Web SDK Tutorial
Widget SDK Tutorial
Analyze the Assistant
Create a Custom Dashboard
Use Custom Meta Tags in Filters

API Reference
API Introduction
API List
API Collection
koreUtil Libraries
SDK Reference
SDK Introduction
SDK Security
SDK Registration
Web Socket Connect and RTM
Using the BotKit SDK

Assistant Admin Console
Administration Dashboard
User Management
Add Users
Manage Groups
Manage Roles
Assistant Management
Invite Users
Send Bulk Invites
Import User Data
Synchronize Users from AD
Security & Compliance
Using Single-Sign On
Security Settings
Cloud Connector
  1. Home
  2. Docs
  3. Virtual Assistants
  4. Advanced Topics
  5. Event Based Bot Actions

Event Based Bot Actions

Bot Events are triggered when specific actions occur during bot conversation or when specific events are triggered on bot channels.

For example, when a user clicks the Get Started button to initiate a chat with your FB Messenger bot, it triggers the Facebook Welcome event. You can use this event to customize the welcome greeting such as personalizing it with the user’s first and last names, capturing additional information from users, and updating back-end systems.

Bot Behavior

Developers can define bot behavior when an event is triggered using one of the following options:

Run a task

Select a Dialog task (Standard or Hidden ) to be invoked when the event triggers. Once the event is triggered, the dialog starts executing. If it is interrupted because of other intent detections, the Hold and Resume settings come into play. During execution, if the selected Dialog is not published in the bot, the event is discarded.

In some cases, the Dialog may not be available to the user during a conversation for various reasons such as the task is not yet published or suspended or simply not assigned to the user. In such cases, the bot throws an error message that the task is not currently available for execution. Developers can preempt such situations by testing the bot in Debug mode. Debug Console shows full details about the error, including the reason for the non-availability of the task.

Run a script

Define a JavaScript to run when the event triggers. The script can make use of all applicable components such as session, context objects, bot variables, and bot functions. You can also fix the code using the Debug mode.

Show a message

Define a simple or advanced message to the user when the event triggers. It supports all messaging formatting features available in the Bots Platform, including multiple messages with channel override options.

Multilingual bot behavior:

  • You can define language-specific messages;
  • If a message is deleted from an Event for a specific language then it will be removed from all other languages of the bot;
  • If a message is added for a language then the message would be added in all other languages using the same content;
  • If a message is modified in a language, then the modifications will be applied for that language alone.

Learn more about message formatting and templates.

Event Types

You can configure the following events to trigger responses:

Event Trigger
Welcome Event On receiving the first message from the user from any channel.
Facebook Welcome Event On receiving Welcome Event from Facebook Messenger. This event takes precedence over Welcome Event if both are configured for a bot.
Telephony Welcome Event

On receiving a user’s call from a voice channel like IVR, Twilio, or Audio Codes. See below for details.

(previously called Twilio Voice Welcome Event)

Telegram Welcome Event On receiving the Welcome Event from Telegram. This event takes precedence over Welcome Event if both are configured for a bot.
On Connect Every time a user converses over Web / Mobile SDK channels. The event will be triggered irrespective of whether the user has started the conversation or not.
Note that this event applies ONLY for Web/Mobile SDK channel and takes precedence over the Welcome event of both are configured.
End of Conversation On reaching the end of conversation. See below for details.
Task Execution Failure

On encountering an error in dialog task execution like:

  • an error in the execution of the bot,
  • service call failure,
  • unable to reach the server
  • error in invoking agent node in case of Human-agent transfer,
  • Knowledge Graph Task failures,
  • Webhook node failures,
  • Dialog related to a sub-dialog node not available,
  • exceptions in parsing the bot message.
RCS Opt-in Event On receiving the message that a user has opted for the RCS Messaging channel.
RCS Opt-out Event On receiving the message that a user has opted out of RCS Messaging channel.


Follow these steps to configure a bot event:

  1. On the bot Build tab of the top menu, select Intelligence > Event Handlers.
  2. On the Events page, select one of the events. The Event Configuration window slides open.
  3. Select one of these options to define how to proceed when the selected event is detected:
    • Initiate Task,
    • Run Script,
    • Show Message.

The Event Handlers are classified as Conversation Events, Intent Events, and Channel Events.


The settings option allows you to:

  • Manage Variable Namespaces to associate the Variable Namespaces to be used with the Event Handler. This option will be visible only when the Variable Namespace is enabled for the bot. For more information, see Managing Namespace.

Additional Notes

Task Execution Failure Event

  • This event is available from the v6.40 release.
  • By default, this event is always enabled with the Show Message option. This event cannot be disabled.
  • This bot-level behavior can be overridden for specific tasks by defining task-specific failure event from the dialog task settings. Refer here for how.

Welcome/onConnect Event

Users can initiate bot conversations in varied ways, from a simple greeting to directly expressing an intent or asking an FAQ. To facilitate a scope for the developer to customize the bot response based on the user choice, the Welcome event comes with additional options when you choose Initiate Task or Show Message as the event configurations. For example, if the first user utterance maps to a bot task, should the bot execute the event-based task or the user intent first?

Post ver9.0, you can use the isReturningUser parameter in the BotUserSession context object to identify returning users and sending an appropriate welcome message (refer here for context object).

As a developer, you can define the bot priority when the user starts the bot conversation with a greeting, task, or FAQ from the options listed below:

Event Configuration Options
Initiate Task
  • Greetings / Small Talk
    • Respond to greetings or small talk and initiate Welcome Event dialog
    • Discard user message and initiate Welcome Event dialog
  • FAQ
    • Respond to FAQ and initiate Welcome Event dialog
    • Discard user message and initiate Welcome Event dialog
  • Task
    • Initiate user-requested task and discard Welcome Event dialog
    • Initiate Welcome Event dialog and add the user-requested task to Follow-up Intents

If the Task is unavailable to the user for any reason such as the task is not yet published or suspended or simply not assigned to the user, in such cases, the bot throws an error message that the task is not currently available for execution.

Show Message
  • Greetings / Small Talk
    • Respond to greetings or small talk and display Welcome Event message
    • Respond to greetings or small talk and discard Welcome Event message
  • FAQ
    • Respond to FAQ and display Welcome Event message
    • Respond to FAQ and discard Welcome Event message
  • Task
    • Display Welcome Event message and run the user-requested task
    • Discard Welcome Event message and run the user-requested task
Note: The Bot Builder platform no longer supports Welcome Message. If you have defined a Welcome Message in previous versions of the platform, the upgraded version automatically creates a corresponding Welcome event and On Connect event to ensure backward compatibility.

End of Conversation

End of Conversation is triggered when the bot is not expected to send any message to the user or receive any message from the user.

A new flag indicating the reason for ending the task, added to the end of task event, will help in deciding the end of the conversation behavior. Client-side implementations of BotKits, RTM, and Webhook channels can use this reason for task completion flag in the context, to determine an appropriate course of action.

On triggering this event, the context will be updated with the following details:

  • Reason for triggering event (see the table below)
  • Name of the task that has just ended. If its a FAQ then the task name will be given set to ‘FAQ’
Scenario End of Conversation Flag
Reached the last node of the dialog Fulfilled
The task is canceled by the user Canceled
Error in task or FAQs execution (without Task Failure Event, no hold tasks) Failed
Linked dialog completed without returning to the parent dialog Fulfilled_LinkedDialog
On answering a FAQ Fulfilled
Successful event execution with Run Script or Show Message (no tasks on hold) Fulfilled_Event
Error in executing an event with Run Script or Show Message (no tasks on hold) Failed_Event
User declines to resume on-hold task (when no other task is on hold Canceled

IVR Impact

You may also use this event to define how and when the calls should be terminated for voice-based channels. The IVR implementation has been enhanced to enable the closure of the session/call only when the ‘end of conversation’ is completed. See here for how.

Telephony Welcome Event

This event is triggered upon receiving the voice call to the platform from any voice channel. This event will be triggered every time a user’s call reaches the platform, and not just for the first time.

It has two options – ‘Run a Dialog’ and ‘Voice Call Properties’.

  • Run a Dialog – Select a task to be triggered from the drop-down list provided
  • Voice Call Properties can be set as follows:
    • Define at least one ‘Initial Prompts’
    • Prompts for Timeout, and No Match can be defined
    • Under Advanced Controls, settings for Timeout, No. of Retries, and Barge-in can be defined.
      See here for details.