> For the complete documentation index, see [llms.txt](https://doc.nextbot.ru/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://doc.nextbot.ru/functional/integrations/bitrix24/otpravka-soobshenii-v-maks-iz-bitrix24-robot.md).

# Отправка сообщений в МАКС из Bitrix24 (робот)

**Задача:** На сайте имеется форма для сбора контактных данных, которые сохраняются в CRM Bitrix24. Необходимо при смене этапа сделки инициировать первое сообщение клиенту в МАКС и передать общение ИИ-агенту для выявления потребностей клиента.

**Решение:** В приложении Nextbot можно включить робота для Bitrix24, который отправляет сообщения в МАКС. Вы можете инициировать диалог с клиентом с помощью сообщения, а также автоматически отправлять такие сообщения на определённых этапах сделки.

### Настройка

1. У агента необходимо подключить канал МАКС
2. Зайдите в приложение **Nextbot** в Bitrix24 и выберите вариант подключения: **«Коммуникация через Nextbot»**.

<figure><img src="https://2593311972-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fef2EBU68XAlye1NtG8DF%2Fuploads%2FbsTJD9gi60PjGSAPi5yp%2F%7BB7D078D4-611D-4429-B2C0-0A255A90FEE0%7D.png?alt=media&amp;token=499badef-dc2c-4b5b-875e-f8a9ba65cb48" alt=""><figcaption></figcaption></figure>

3. Найдите нужного ИИ-агента и включите опцию **«Добавить робота для отправки шаблонных сообщений»**. Если агент уже подключён, его нужно отключить и повторно подключить с включённой опцией. Нажмите "Подключить"

<figure><img src="https://2593311972-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fef2EBU68XAlye1NtG8DF%2Fuploads%2FqZywfzRpayAFTineMM6B%2Fimage.png?alt=media&amp;token=4f45ea86-02ff-4afc-bef3-92a85df506f6" alt=""><figcaption></figcaption></figure>

4. В настройках **открытой линии**, к которой подключен ИИ-агент, отключите опцию **«Отправлять автоматически ответ на сообщение клиента»**. Иначе будет отправлено два сообщения: одно от робота, другое — от открытой линии.

<figure><img src="https://2593311972-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fef2EBU68XAlye1NtG8DF%2Fuploads%2FQnAlRtPaVq73Dc8qnkaG%2Fimage.png?alt=media&amp;token=947e0d86-e3cc-41d9-a01a-8788463f16b3" alt=""><figcaption></figcaption></figure>

5. Добавьте робота на нужный этап сделки. Для примера — на этап **«Подготовка документов»**.

<figure><img src="https://2593311972-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fef2EBU68XAlye1NtG8DF%2Fuploads%2F6WAtWNA9ZKuf8WVczC7j%2Fimage.png?alt=media&amp;token=ca0018ba-c71c-43bb-a204-3712a8c1993d" alt=""><figcaption></figcaption></figure>

6. Нажмите **«Добавить»**.
7. Выберите раздел **«Другие роботы»**

<figure><img src="https://2593311972-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fef2EBU68XAlye1NtG8DF%2Fuploads%2FsqLTOwgA3nQDlwJyRNH3%2Fimage.png?alt=media&amp;token=3c5663c0-af77-4a83-b02d-aec8c1f94ce4" alt=""><figcaption></figcaption></figure>

8. Найдите робота с именем нужного агента и нажмите **«Добавить»**.
9. Настройте параметры робота:

   1. **Очередность срабатывания**.
   2. **Интервал отправки сообщения**.
   3. **Условие срабатывания** (при необходимости).
   4. **Получатель сообщения** — укажите, из какого поля берётся номер телефона.
   5. **Имя пользователя** — укажите, из какого поля берётся имя.
   6. **Сообщение** — задайте сообщение.

   <br>

   <figure><img src="https://2593311972-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fef2EBU68XAlye1NtG8DF%2Fuploads%2FDMYG8P0M2KvHmRKAMqQR%2Fimage.png?alt=media&amp;token=8cc133c3-f6aa-488d-a440-bc55d77b9fd1" alt=""><figcaption></figcaption></figure>
10. Сохраните все настройки.

    <br>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

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

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://doc.nextbot.ru/functional/integrations/bitrix24/otpravka-soobshenii-v-maks-iz-bitrix24-robot.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
