# Chatbot scenario logging

{% hint style="info" %}
Chatbot scenario logging is not a default feature and is configured individually upon the client’s request.
{% endhint %}

Bot events are logged within the BotFlow scenario builder. To implement this, a special subflow node — **Log Bot/IVR Event** — is used. Each event is recorded at the moment it occurs as a separate entry in the database (table **`[`**).

To enable logging, add this node to the flow (after the action you want to log) and fill in its **Properties**.

<figure><img src="/files/zBKBzxcNQ9S9dME33cjD" alt=""><figcaption></figcaption></figure>

### Configuring the `Log Bot/IVR Event Node`

According to the node’s property interface (**Edit subflow instance**), to ensure correct logging, configure the following properties (**Properties**):

* **Name** — the name of the node in the flow (e.g., Log Back, Log To Submenu).
* **Event** — the event that occurred (for loggable events, see point [1. Event](#id-1.-event)).
* **Source** — the source and section from which the event was recorded (for loggable sources, see point [2. Source](#id-2.-source)).
* **Task** — the action performed as a result of the event (for loggable actions, see point [3. Task](#id-2.-task)).
* **Name** — the name of the event that occurred. This can be the name of the selected button (if using the Answer Switch node, it is logged automatically) or another custom event name specified during logging.
* **Parent Name** — the name of the previous step. For **source: chatbot\_menu**, each event except the first (menu entry) contains the name of the step the client came from (name from the previous step).&#x20;

{% hint style="info" %}
This field is filled automatically after the **Answer Switch** node.
{% endhint %}

* **Status** — service execution status. Logged only for events with **task:self\_serve** (see point [4.1. status](#id-4.1.-status)).
* **Exit Reason** — the reason the user exited the bot. Logged only for events with **task:transfer** or **task:resolve** (see point[ 4.2. exit\_reason](#id-4.2.-exit_reason)).
* **Custom Data 1-5** — fields for passing additional custom data (if needed).
* **logger** — enables or disables log output for analyzing the logging process.

<figure><img src="/files/eGnukXsJbakhkObTT2GP" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
CSAT ratings and system timeouts are logged automatically (no additional configuration is required).
{% endhint %}

### **Description of loggable Properties values:**

#### **1. Event**

Events that are subject to logging:

<table><thead><tr><th width="153">Event</th><th>Description</th></tr></thead><tbody><tr><td>button_click</td><td>The client selects one of the predefined options in the language selection menu, self-service menu, or CSAT rating menu.</td></tr><tr><td>text_input</td><td>The user enters a text message in the chatbot in response to an open question (without buttons).</td></tr><tr><td>system_event</td><td>An event initiated by the system (e.g., client, agent, or bot inactivity timeout).</td></tr><tr><td>api_request</td><td>A web service call within the chatbot scenario to retrieve client data or perform an operation.</td></tr><tr><td>announce</td><td>Sending a message to the client.</td></tr></tbody></table>

#### **2. Source**

Sources that are subject to logging:

| Source            | Description                                              |
| ----------------- | -------------------------------------------------------- |
| chatbot\_language | Chatbot: language selection stage                        |
| chatbot\_menu     | Chatbot: menu navigation stage                           |
| chatbot\_csat     | Chatbot: CSAT stage                                      |
| agent             | Event at the stage of locating the dialogue on the agent |

#### **3. Task**

Tasks to be logged:

| Source      | Description                                          |
| ----------- | ---------------------------------------------------- |
| subflow     | Navigating to a menu or submenu                      |
| transfer    | Transferring the dialogue from bot/IVR to agent/team |
| resolve     | Dialogue completion                                  |
| self\_serve | Self-service launch                                  |

#### 4. Action Details (task)

#### 4.1. Status

Service execution status. Logged only for events with `task:self_serve`.\
Statuses to be logged:

| status    | Description                           |
| --------- | ------------------------------------- |
| initiated | Self-service scenario started         |
| completed | Self-service completed successfully   |
| failed    | Self-service completed unsuccessfully |

#### 4.2. exit\_reason&#x20;

Reason for user exit from the bot. Logged only for events with `task:transfer` or `task:resolve`.

Reasons to be logged:

| exit\_reason                                    | Description                                        |
| ----------------------------------------------- | -------------------------------------------------- |
| transfer\_button                                | Menu item selected with transfer action            |
| end\_button                                     | Menu item selected with dialogue completion action |
| client\_timeout                                 | Dialogue completion due to customer inactivity     |
| agent\_bot\_timeout                             | Dialogue completion due to agent/bot inactivity    |
| not\_working\_time                              | Dialogue completion due to non-working hours       |
| csat                                            | Dialogue completion after CSAT completion          |
| Any custom exit reason specified during logging | ​                                                  |

***

### Examples of possible event logging scenarios&#xD;

1. Scenario: Language selection, menu navigation, transfer to agent, and CSAT completion

> Flow description:
>
> 1. The user is presented with the language selection menu and chooses **Ukrainian**.
> 2. The user is shown the Main Menu and selects **Deposits**.
> 3. The user sees the Deposits submenu and selects **Back**.
> 4. The user is shown the Main Menu again and selects **Credits**.
> 5. The user sees the Credits submenu and selects **Main Menu**.
> 6. The user is shown the Main Menu and selects **Cards**.
> 7. The user sees the Cards submenu and selects **Open**.
> 8. The user sees the Cards → Open submenu and selects **Debit**. The system performs a transfer to the agent.
> 9. After the dialogue is completed by the agent, the user is presented with the CSAT survey and selects **Excellent 😄**.

Example of logging:

<table><thead><tr><th width="47">№</th><th>event</th><th width="169">source</th><th>name</th><th>parent_name</th><th>task</th><th>status</th><th>exit_reason</th></tr></thead><tbody><tr><td>1</td><td>button_click</td><td>chatbot_language</td><td>Українська</td><td>NULL</td><td>subflow</td><td>NULL</td><td>NULL</td></tr><tr><td>2</td><td>button_click</td><td>chatbot_menu</td><td>Депозити</td><td>NULL</td><td>subflow</td><td>NULL</td><td>NULL</td></tr><tr><td>3</td><td>button_click</td><td>chatbot_menu</td><td>Назад</td><td>Депозити</td><td>subflow</td><td>NULL</td><td>NULL</td></tr><tr><td>4</td><td>button_click</td><td>chatbot_menu</td><td>Кредити</td><td>Назад</td><td>subflow</td><td>NULL</td><td>NULL</td></tr><tr><td>5</td><td>button_click</td><td>chatbot_menu</td><td>Головне меню</td><td>Кредити</td><td>subflow</td><td>NULL</td><td>NULL</td></tr><tr><td>6</td><td>button_click</td><td>chatbot_menu</td><td>Карти</td><td>Головне меню</td><td>subflow</td><td>NULL</td><td>NULL</td></tr><tr><td>7</td><td>button_click</td><td>chatbot_menu</td><td>Відкрити</td><td>Карти</td><td>subflow</td><td>NULL</td><td>NULL</td></tr><tr><td>8</td><td>button_click</td><td>chatbot_menu</td><td>Дебетову</td><td>Відкрити</td><td>transfer</td><td>NULL</td><td>transfer_button</td></tr><tr><td>9</td><td>button_click</td><td>chatbot_csat</td><td>Відмінно 😄</td><td>NULL</td><td>resolve</td><td>NULL</td><td>csat</td></tr></tbody></table>

2. Scenario: Dialogue completion – “Finish” button

> Flow description:
>
> 1. The user is presented with the language selection menu and chooses **Ukrainian**.
> 2. The user is shown the Main Menu and selects **Cards**.
> 3. The user sees the Cards submenu and selects **Open**.
> 4. The user sees the Cards → Open submenu and selects **Finish**. The system completes the dialogue.

Example of logging:

<table><thead><tr><th width="50">№</th><th width="128">event</th><th width="149">source</th><th>name</th><th>parent_name</th><th>task</th><th width="130">status</th><th>exit_reason</th></tr></thead><tbody><tr><td>1</td><td>button_click</td><td>chatbot_language</td><td>Українська</td><td>NULL</td><td>subflow</td><td>NULL</td><td>NULL</td></tr><tr><td>2</td><td>button_click</td><td>chatbot_menu</td><td>Карти</td><td>NULL</td><td>subflow</td><td>NULL</td><td>NULL</td></tr><tr><td>3</td><td>button_click</td><td>chatbot_menu</td><td>Відкрити</td><td>Карти</td><td>subflow</td><td>NULL</td><td>NULL</td></tr><tr><td>4</td><td>button_click</td><td>chatbot_menu</td><td>Завершити</td><td>Відкрити</td><td>resolve</td><td>NULL</td><td>end_button</td></tr></tbody></table>

3. Scenario: Dialogue completion – Completion due to customer inactivity timeout<br>

> Flow description:
>
> 1. The user is presented with the language selection menu and chooses **Ukrainian**.
> 2. The user is shown the Main Menu and selects **Cards**.
> 3. The user sees the Cards submenu and selects **Open**.
> 4. The user sees the Cards → Open submenu. The user does not take any action during the waiting period. The system automatically completes the dialogue.

Example of logging:

<table><thead><tr><th width="50">№</th><th>event</th><th width="161">source</th><th>name</th><th>parent_name</th><th>task</th><th>status</th><th>exit_reason</th></tr></thead><tbody><tr><td>1</td><td>button_click</td><td>chatbot_language</td><td>Українська</td><td>NULL</td><td>subflow</td><td>NULL</td><td>NULL</td></tr><tr><td>2</td><td>button_click</td><td>chatbot_menu</td><td>Карти</td><td>NULL</td><td>subflow</td><td>NULL</td><td>NULL</td></tr><tr><td>3</td><td>button_click</td><td>chatbot_menu</td><td>Відкрити</td><td>Карти</td><td>subflow</td><td>NULL</td><td>NULL</td></tr><tr><td>4</td><td>system_event</td><td>chatbot_menu</td><td>NULL</td><td>NULL</td><td>resolve</td><td>NULL</td><td>client_timeo</td></tr></tbody></table>

4. Scenario: Dialogue completion – Completion due to agent inactivity timeout

> Flow description:&#x20;
>
> 1. The user is presented with the language selection menu and chooses **Ukrainian**.
> 2. The user is shown the Main Menu and selects **Cards**.
> 3. The user sees the Cards submenu and selects **Open**.
> 4. The user sees the Cards → Open submenu and selects **Debit**. The system performs a transfer to the agent.
> 5. During the conversation, the agent does not respond within the set time. The system automatically completes the dialogue.

Example of logging:

<table><thead><tr><th width="46">№</th><th>event</th><th width="189">source</th><th>name</th><th width="147">parent_name</th><th>task</th><th>status</th><th>exit_reason</th></tr></thead><tbody><tr><td>1</td><td>button_click</td><td>chatbot_language</td><td>Українська</td><td>NULL</td><td>subflow</td><td>NULL</td><td>NULL</td></tr><tr><td>2</td><td>button_click</td><td>chatbot_menu</td><td>Карти</td><td>NULL</td><td>subflow</td><td>NULL</td><td>NULL</td></tr><tr><td>3</td><td>button_click</td><td>chatbot_menu</td><td>Відкрити</td><td>Карти</td><td>subflow</td><td>NULL</td><td>NULL</td></tr><tr><td>4</td><td>button_click</td><td>chatbot_menu</td><td>Дебетову</td><td>Відкрити</td><td>transfer</td><td>NULL</td><td>transfer_button</td></tr><tr><td>5</td><td>system_event</td><td>agent</td><td>NULL</td><td>NULL</td><td>resolve</td><td>NULL</td><td>agent_bot_timeou</td></tr></tbody></table>

5. Scenario: Dialogue completion – Contact during non-working hours

> Flow description:
>
> 1. The user is presented with the language selection menu and chooses **Ukrainian**.
> 2. The user is shown the Main Menu and selects **Cards**.
> 3. The user sees the Cards submenu and selects **Open**.
> 4. The user sees the Cards → Open submenu and selects **Debit**. The system checks the working schedule and determines that it is outside working hours. The system completes the dialogue.

Example of logging:

<table><thead><tr><th>№</th><th>event</th><th width="181">source</th><th>name</th><th width="146">parent_name</th><th>task</th><th>status</th><th width="201">exit_reason</th></tr></thead><tbody><tr><td>1</td><td>button_click</td><td>chatbot_language</td><td>Українська</td><td>NULL</td><td>subflow</td><td>NULL</td><td>NULL</td></tr><tr><td>2</td><td>button_click</td><td>chatbot_menu</td><td>Карти</td><td>NULL</td><td>subflow</td><td>NULL</td><td>NULL</td></tr><tr><td>3</td><td>button_click</td><td>chatbot_menu</td><td>Відкрити</td><td>Карти</td><td>subflow</td><td>NULL</td><td>NULL</td></tr><tr><td>4</td><td>button_click</td><td>chatbot_menu</td><td>Дебетову</td><td>Відкрити</td><td>resolve</td><td>NULL</td><td>not_working_time</td></tr></tbody></table>

6. Scenario: Self-service with text input field, web service call, and information announcement

> Flow description:
>
> 1. The user is presented with the language selection menu and chooses **Ukrainian**.
> 2. The user is shown the Main Menu and selects **Cards**.
> 3. The user sees the Cards submenu and selects **Card Balance**. The system initiates a self-service scenario (`task=selfServe`, `status=initiated`).
> 4. The user sees the message “Enter your card number” and inputs the value manually.
> 5. The system calls an external web service to retrieve the balance information.
> 6. After receiving the response, the user is shown an announcement with the card balance, and it is logged that the service was completed successfully.
> 7. The user is asked “Do you have any other questions?” and selects **No**. The system completes the dialogue.

Example of logging:

<table><thead><tr><th width="54">№</th><th>event</th><th width="184">source</th><th>name</th><th width="149">parent_name</th><th>task</th><th>status</th><th>exit_reason</th></tr></thead><tbody><tr><td>1</td><td>button_click</td><td>chatbot_language</td><td>Українська</td><td>NULL</td><td>subflow</td><td>NULL</td><td>NULL</td></tr><tr><td>2</td><td>button_click</td><td>chatbot_menu</td><td>Карти</td><td>NULL</td><td>subflow</td><td>NULL</td><td>NULL</td></tr><tr><td>3</td><td>button_click</td><td>chatbot_menu</td><td>Баланс карти</td><td>Карти</td><td>selfServe</td><td>initiated</td><td>NULL</td></tr><tr><td>4</td><td>text_input</td><td>chatbot_menu</td><td>ask_card_number</td><td>Баланс карти</td><td>subflow</td><td>NULL</td><td>NULL</td></tr><tr><td>5</td><td>api_request</td><td>chatbot_menu</td><td>ws_clientdata</td><td>ask_card_number</td><td>subflow</td><td>NULL</td><td>NULL</td></tr><tr><td>6</td><td>announce</td><td>chatbot_menu</td><td>announce_card_balance</td><td>ws_clientdata_call</td><td>selfServe</td><td>completed</td><td>NULL</td></tr><tr><td>7</td><td>button_click</td><td>chatbot_menu</td><td>Ні</td><td>announce_card_balance</td><td>resolve</td><td>NULL</td><td>other_question_no</td></tr></tbody></table>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://help.novatalks.com.ua/en/get-started/settings/chatbots/chatbot-script-logging.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
