# Actions

<div data-with-frame="true"><figure><img src="/files/RgUuSMPhlPkvJTtsjlBO" alt="" width="563"><figcaption></figcaption></figure></div>

### Add action field

This field is a dropdown list of actions that can be configured within the block.

Adding an action:

To add an action in the block, click **"+ Add action."**

<div data-with-frame="true"><figure><img src="/files/D6BsI8GHdPaYsuk6JRyn" alt="" width="563"><figcaption></figcaption></figure></div>

You can select an action from action lists:

<div data-with-frame="true"><figure><img src="/files/GzEaWwhW5ZJyyYvGnSB5" alt="" width="423"><figcaption></figcaption></figure></div>

You can add multiple actions:

<div data-with-frame="true"><figure><img src="/files/progsXW2ZNY1vIU6Pg0R" alt=""><figcaption></figcaption></figure></div>

### **Move through funnel**

You can select which sales funnel stage in MaviBot CRM the client will be placed in when entering this block. This is useful not only for advancing the client through the funnel stages but also for clear segmentation of clients by categories. For example, requests from individuals can go into one column, while those from organizations go into another column in MaviBot CRM.

<div data-with-frame="true"><figure><img src="/files/Rbm6lqMDnFzpNSCbCmBG" alt="" width="563"><figcaption></figcaption></figure></div>

### **Add to list / Remove from list / Move to list**

Clients can be added [to lists.](/crm/tags.md)&#x20;

Lists are used not only for segmenting the database but also for setting up basic analytics based on the lists.

<div data-with-frame="true"><figure><img src="/files/86aREx8YKyBewIk3atk0" alt="" width="563"><figcaption></figcaption></figure></div>

<div data-with-frame="true"><figure><img src="/files/9r6F3o8V1uGibHOL1N2s" alt="" width="563"><figcaption></figcaption></figure></div>

<div data-with-frame="true"><figure><img src="/files/lrUElJDtdds5RN6K4Sw7" alt="" width="563"><figcaption></figcaption></figure></div>

The action "Move to list" means the user will be removed from list A and added to list B.

You can create new lists and manage them in the **Lists** section, located in the left menu of the builder.

When a client enters a block with configured list actions, their assigned lists are automatically updated.

In the **Clients** section, you can:

* Filter clients by list membership
* View which lists a client belongs to in the right-hand menu of their dialog
* See all assigned lists in the client's profile card

<div data-with-frame="true"><figure><img src="/files/cqyBhmZVjvqX6sY3UCMm" alt=""><figcaption></figcaption></figure></div>

### Add tag / Remove tag

Tags simplify client segmentation and help visually navigate dialogues in the Clients section. Like lists, they can also be used to filter clients.

<div data-with-frame="true"><figure><img src="/files/Q3PjMHARPF1tYV7UvVN0" alt="" width="563"><figcaption></figcaption></figure></div>

<div data-with-frame="true"><figure><img src="/files/F37npKulve3cl8UX6ieF" alt="" width="563"><figcaption></figcaption></figure></div>

You can create and manage tags [in the **Lists** section under the **Tags** tab.](/crm/tags.md)\
After entering a block with the "Add tag" action, the corresponding tag will appear in the client's dialogue.

<div data-with-frame="true"><figure><img src="/files/pX1kfRBo2RVmygpyQ3aa" alt="" width="375"><figcaption></figcaption></figure></div>

And you can also see tags in deals in CRM:

<div data-with-frame="true"><figure><img src="/files/5Hi7KPOln1wsdEGsLKRg" alt="" width="375"><figcaption></figcaption></figure></div>

### **Run Python code**

<div data-with-frame="true"><figure><img src="/files/kdyszzCFWsi38Sy2wAZp" alt="" width="563"><figcaption></figcaption></figure></div>

Before entering a block where the action to execute Python code is used, you need to assign the variables used in the Python script.

All variables available in the Calculator will be accessible in the script: they will be passed in a dictionary named `data`; there is no need to create it beforehand.

<div data-with-frame="true"><figure><img src="/files/24ZpthKhB5YfAoJOMivg" alt=""><figcaption></figcaption></figure></div>

**Example:**\
In the "Start" block, variables `first` and `second` are assigned.

<div data-with-frame="true"><figure><img src="/files/WdqZYfU1eBrF6Z7tafw4" alt=""><figcaption></figcaption></figure></div>

Next, in the second block, set the action **"Run Python code":**

<div data-with-frame="true"><figure><img src="/files/tO4MQYG4nYrFkoYuIcb8" alt=""><figcaption></figcaption></figure></div>

In the Python code, you access these variables by their keys in the `data` dictionary, matching the variable names from the first block (creating variable `a`).\
Alternatively, you can refer to the variable the same way as in text output (creating variable `b`).

{% hint style="info" %}
Please note regarding the creation of variable **b** — before executing the script, all variables in the format `#{variable_name}` are replaced with the values of the corresponding variables, just like when sending a message to the client.
{% endhint %}

<div data-with-frame="true"><figure><img src="/files/LzxRsJqscUmFEi595nLE" alt=""><figcaption></figcaption></figure></div>

At the end of the script, the variable `result` is returned containing `{'`<mark style="color:red;">`a`</mark>`': a, '`<mark style="color:red;">`b`</mark>`': b, '`<mark style="color:red;">`sum_ab`</mark>`': sum_ab}`. You must return data in this exact format so that new variables will be created, where the variable names correspond to the dictionary keys, and their values correspond to the dictionary values.

<div data-with-frame="true"><figure><img src="/files/WJ2XvEDHAhLGdXrRFSQ9" alt="" width="563"><figcaption></figcaption></figure></div>

#### Errors

**Failed to download file** – an error that occurs when the saved code file fails to download for execution during message sending.

**`result is not dict`** – the returned value must be a dictionary in the key–value format, as shown in the example below:


---

# 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://docs.mavibot.ai/chatbot/builder/setting/actions.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.
