1. Home
  2. Kore.ai Conversational Platform
  3. SDKs & APIs
  4. 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 user and updating backend systems.

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

Run a dialog

Select a Dialog task (Standard or Hidden ) to invoke when the event triggers. Once 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.

Note: The Dialog may be unavailable 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.

In such cases, the bot informs the end users that it cannot proceed with the conversation. Developers can preempt such situations by testing the bot in Debug mode. Debug Console shows full details about the error, including the reason for nonavailability 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. Also, developers can also define language-specific messages. Learn more about message formatting and templates.

Event Types

You can configure the following events to trigger responses:

Event Trigger
Welcome Event On receiving a message from the user when channel specific event is not configured
Facebook Welcome Event On receiving Welcome Event from Facebook Messenger
Telegram Welcome Event On receiving Welcome Event from Telegram
On Connect Every time when a user invokes Web / Mobile SDK

Configuring a Bot Event

Follow these steps to configure a bot event:

  1. On the bot main menu, click Extensions > Events.
  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.

Backward compatibility

Welcome Event – Additional Configuration

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?

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 user requested task to Follow-up Intents
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 user requested task
    • Discard Welcome Event message and run 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.
Was this article helpful to you? Yes 2 No