Skip to main content

Configure a Chatbot

The Deepser chatbot lets you automate chat interactions using flow-based triggers and actions. This guide covers how to enable the chatbot, create a bot, configure available bot actions, and walks through a complete example flow.

Prerequisites

To trigger a chatbot flow, the User Portal must be enabled. You can enable it under System > Configuration.

Next, enable the chat on the User Portal by navigating to System > Configuration > Chat > Configurations.

Under Configurations > Enabling, set "Enabled in Frontend" to Yes.

The chatbot in Deepser is powered by a flow with a trigger of type "Chatbot." This trigger executes every time a new chat is created in the User Portal.

Create a Bot

  1. Open System > Chat > Bot and click Add Bot.

  1. Configure your bot using the fields described below.

FieldDescription
NameThe name of the bot.
Flow HeaderThe flow to which the bot is connected.
StatusEnabled or Disabled.
AvatarThe image of the bot.
  1. After creating the bot, open the chat template and add the "Bot" field to the form.

Chatbot Actions

Send Message

This action sends a text message directly on the created chat.

To configure this action:

  1. Open Action > Chat Bot > Send Message by clicking "+".

  1. Write your message in the "Message" field and click Save.

Ask for Details

This action sends a question that waits for a response from the user. The response can be of type String or Attachment and can be used as a variable later in the flow.

To configure this action:

  1. Open Action > Chat Bot > Ask For Details by clicking "+".

  1. Write your message in the "Message" field and click Save.

Present Options

This action displays a message with a selection field. The user can choose only one answer and cannot type a custom message or add an attachment. Each option is defined by a "value" field (used as a key) and a "label" field (visible to the user).

To configure this action:

  1. Open Action > Chat Bot > Present Options by clicking "+".

  1. Write your message in the "Message" field, add your options in the "Options" field, and click Save.

tip

If you set the "Add Variable Options" field to "ON," you can add an array of options retrieved from earlier steps in the flow and stored in an output variable.

Chat with Operator

This action assigns the chat to a specific Deepser user (Administrator, Operator, or Key User).

User Portal User

Deepser Backend User

With this action, the assigned user can chat directly with the User Portal user.

To configure this action:

  1. Open Action > Chat Bot > Chat With Operator by clicking "+".

  1. Configure the following fields:
FieldDescription
MessageThe text displayed in the chat, informing the User Portal user that their conversation will be assigned to an Operator.
Notification MessageThe text message sent to the assigned Operator.
OperatorA variable of type DeepAdmin-User Model. Assign the user variable retrieved from earlier stages of the flow.

Chatbot Flow Example

This section walks you through a complete example of setting up a chatbot flow. In this scenario, when a User Portal user needs information, the chatbot routes the chat to the correct Deepser Backend Operator based on the user's selection.

For this example, three different users are used:

Trigger

First, set the trigger type to Chatbot.

This block produces the following variables:

VariableDescription
BotThe model of the bot, containing all form template fields.
RoomThe chat room variable.
All Room Form FieldsAll form template fields of the room model as an array.

Block 1: Welcome Message

Add a welcome message to the User Portal chat.

When the User Portal user starts the chat, the message written in the "Message" field is automatically sent.

This block does not produce any output variables.

Block 2: Ask for Details

Ask the User Portal user to enter their first and last name. This information renames the room.

The message is sent immediately after the welcome message.

The user replies by entering the requested information, which is saved in the "Response" variable.

This block produces the following variables:

VariableDescription
ResponseThe response entered by the User Portal user.
AttachmentsAny attachments the user included.
Attachments CountThe total number of attachments.

Block 3: Update Room Name

This block renames the chat room on the Deepser Backend side.

NDescriptionNote
1Choose the "Update Record" block.This allows you to change the name of the room.
2Choose the chat room as your model.The room is one of the variables obtained in the trigger.
3Enter the "Name" field in the query builder, populated with the user's response.The response is one of the variables obtained in Block 2.
note

This configuration takes effect when the "Chat with Operator" block is added.

This block produces the following variable:

VariableDescription
(Model) DeepChat -- RoomRoom template with updated name.

Block 4: Present Options

Present three selectable options to the user.

NDescriptionNote
1Choose the "Present Options" block.This creates the options shown to the User Portal user.
2Add variables.Optional. In this example, the user's name is used as input.
3Enter the message that appears as a header for the options.The text {{var name}} inserts the user's name provided as input.
4Define the options available to the user.

The following message is sent to the user:

Clicking the chosen answer automatically sends the selection as if it had been typed by the user.

This block produces the following variables:

VariableDescription
ResponseThe response entered by the User Portal user (string).
ValueThe response value.

Block 5: Condition for Option 1

Add a condition to check if option 1 was chosen.

NDescriptionNote
1Choose the "If" block.
2Set the desired condition.In this case, the user-chosen value is "support incident/request."

Block 6: Look Up Support User

This block executes only if the User Portal user chose "support incident/request" (option 1). It retrieves the "Support" user who will be the Operator receiving the chat.

NDescriptionNote
1Choose the "Lookup Record" block.This retrieves the user "Support."
2Choose the model "DeepAdmin -- User."
3Set the filter to "user_id."In this example, the user "Support" has ID 53.

This block produces the following variables:

VariableDescription
(Model) DeepAdmin -- UserModel with user data.
Model AliasFor this model it will be "deep_admin/user."

Block 7: Hand Over to Support Operator

This block handles the handover of the chat to the "Support" Operator.

NDescriptionNote
1Choose the "Chat with Operator" block.
2Message displayed to the User Portal user.Optional.
3Message sent to the Operator.Optional.
4Insert the user retrieved in Block 6 from the variables.Optional. If left blank, the chat is sent to all enabled users.

Block 8: Condition for Option 2

Add a condition to check if option 2 was chosen.

NDescriptionNote
1Choose the "Else If" block.
2Set the desired condition.In this case, the value chosen by the user is "sales problem/request."

Block 9: Look Up Sales User

This block executes only if the User Portal user chose "sales problem/request" (option 2). It retrieves the "Sales" user who will be the Operator receiving the chat.

NDescriptionNote
1Choose the "Lookup Record" block.This retrieves the user "Sales."
2Choose the model "DeepAdmin -- User."
3Set the filter to user_id.In this example, the user "Sales" has ID 54.

This block produces the following variables:

VariableDescription
(Model) DeepAdmin -- UserModel with user data.
Model AliasFor this model it will be "deep_admin/user."

Block 10: Hand Over to Sales Operator

This block handles the handover of the chat to the "Sales" Operator.

NDescriptionNote
1Choose the "Chat with Operator" block.
2Message displayed to the User Portal user.Optional.
3Message sent to the Operator.Optional.
4Insert the user retrieved in Block 9 from the variables.Optional. If left blank, the chat is sent to all enabled users.

Block 11: Condition for Option 3

Add a condition to check if option 3 was chosen.

NDescriptionNote
1Choose the "Else If" block.
2Set the desired condition.In this case, the value chosen by the user is "administration incident/request."

Block 12: Look Up Administration User

This block executes only if the User Portal user chose "administration incident/request" (option 3). It retrieves the "Administration" user who will be the Operator receiving the chat.

NDescriptionNote
1Choose the "Lookup Record" block.This retrieves the user "Administration."
2Choose the model "DeepAdmin -- User."
3Set the filter to user_id.In this example, the user "Administration" has ID 55.

This block produces the following variables:

VariableDescription
(Model) DeepAdmin -- UserModel with user data.
Model AliasFor this model it will be "deep_admin/user."

Block 13: Hand Over to Administration Operator

This block handles the handover of the chat to the "Administration" Operator.

NDescriptionNote
1Choose the "Chat with Operator" block.
2Message displayed to the User Portal user.Optional.
3Message sent to the Operator.Optional.
4Insert the user retrieved in Block 12 from the variables.Optional. If left blank, the chat is sent to all enabled users.