> 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/functions/sending-result/vklyuchit-vyklyuchit-scenarii.md).

# Включить/выключить сценарии

Данная опция позволяет гибко управлять диалогом с пользователями отключая или включая сценарии после выполненной функции.

Сценарии создаются во вкладке [Сценарии](https://doc.nextbot.ru/functional/scenarii.md). Можете ознакомиться с данной статьей, если еще не использовали в работе.

Предположим, что есть настроенные сценарии, и нам нужно чтобы после того как выполнится определенная функция, включались либо отключались заготовленные сценарии.

<figure><img src="https://2593311972-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fef2EBU68XAlye1NtG8DF%2Fuploads%2Fn2UZjJmigqdBUetWY4Kg%2F%7BD0228024-FBE4-4875-8008-E0BC0A21E74A%7D.png?alt=media&amp;token=df7e7368-9939-47fb-9265-3567d311163e" alt=""><figcaption></figcaption></figure>

1. Перемещаемся во вкладку Функции.
2. Выберите готовую настроенную функцию, и в самом низу страницы в блоке Действия нажмите на кнопку "Добавить действия"
3. Выберите из списка опцию "Включить/выключить сценарии".

<figure><img src="https://2593311972-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fef2EBU68XAlye1NtG8DF%2Fuploads%2FVeLh0oFfEgzWppeghCZe%2F%7BE4DA7B05-166A-4D7F-8D95-AB0B5B1AE3D9%7D.png?alt=media&amp;token=3ff805bc-ab77-45aa-9fe2-4934b731669c" 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%2FLmiHOEMEgabXI7O3tKCp%2F%7B9C453CBA-9CA6-4E3C-9039-E5AD2B633B8C%7D.png?alt=media&amp;token=401dbe06-0fcf-4426-8d1b-f9f1671f0376" 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%2FCees6G9LZD2isMsPppSB%2F%7BA3190C69-0611-424A-B6D6-6441B3678A31%7D.png?alt=media&amp;token=5a616ba2-461b-4be1-883e-dc4f0c8deb34" alt=""><figcaption></figcaption></figure>

6. Выберите все сценарии или какой то определенный, нажав на кнопку "Добавить"

<figure><img src="https://2593311972-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fef2EBU68XAlye1NtG8DF%2Fuploads%2FbGJHVXEKl9ND4fzuXvYJ%2F%7BAFB1A496-DAD5-4959-AFB5-0EE695DC6C2C%7D.png?alt=media&amp;token=257e98d8-5e8b-447b-b4db-6e29233303aa" alt=""><figcaption></figcaption></figure>

Настроили. Теперь после выполненной функции, выбранные сценарии включаться. Отключить сценарий можно нажав на чек бокс, он будет неактивным.

Итого: Я выбрал определенную функцию (save\_name\_user) и добавил включение сценария, чтобы после того как пользователь скажет свое имя, срабатывали сценарии.

<figure><img src="https://2593311972-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fef2EBU68XAlye1NtG8DF%2Fuploads%2FajXUjoiKxAtv1FGOKqlX%2F%7B5184690E-A902-42F2-8B3F-3DEB75DCF048%7D.png?alt=media&amp;token=b0304d1e-624d-4cbf-93d0-30c09317230b" alt=""><figcaption></figcaption></figure>

При включенной опции "Сброс состояния" все сценарии сбросятся к значениям по умолчанию, все связанные сценарии становятся неактивными.


---

# 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/functions/sending-result/vklyuchit-vyklyuchit-scenarii.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.
