AI chatbot for online booking
Mavibot services - is one of the sections related to the CRM system that allows you to automate the filling of employees' schedules with online booking through a bot.

To work with an online booking and an artificial intelligence chatbot, we need:
A customized branch with categories and services themselves, as well as a completed staff schedule.
Pay attention! Do not forget to assign a position to employees in the Service settings, otherwise the function for reading services will not work!
There are two blocks in the funnel constructor;
AI assistant.
The Funnel Constructor
Step 1. Go to the funnel constructor and create a block for primary verification of the condition:
The block need to be created before the assistant settings, because we will use it to add a variable with information about services and employee time to the project settings.
Also, the information from the variable will be available to all your clients.
To do this, write project before the declared variable, then the name of the service_info variable, then assign it the value of the function for reading available services in the get_info_for_booking branch.

In total, we get: project.service_info = get_info_for_booking().
To understand that the block has started, add any system message, and also to display the values stored in a variable, output it using the #{} construction:

Next, go to the testing window of the bot and launch the block for caching the variable in the project settings:
If you have done everything correctly, you will receive a response from the bot in the form of a message that you have specified in this block (in our example, "Variable updated") and the value contained in the variable.
Pay attention!
After setting up the AI chatbot and online booking, do not delete the "Primary Condition Verification" block
You will need it if you update your range of services or add new employees.
To update the service_info variable in the project, simply launch this block in the test window, then the updated data will be included in the variable value.
Step 2 Create a second block - “State”, where you need to register:
A function for creating booking
create_booking_by_name function (service_name, date, date_time, company_id) creates booking based on the data transmitted by the AI assistant to the system.
The function takes three required parameters to generate booking:
! service_name
required parameter, service name
! date
date in the format dd.mm.yyyy
! date_time
service time in hh:mm format
company_id
Branch ID, optional If it is specified, an entry will be created for the service with the specified name, which belongs to this particular branch. This parameter may be needed if several branches have services with the same name.
project.service_info = get_info_for_booking() - is in order to configure and make an booking into the CRM system, these free services were provided to users due to the availability of additional service information.
In the message block field, write the required bot response after the client selects the service and time.
Working as an AI assistant
Next, go to the AI assistant, where you need to set up the settings for online booking.
Let's choose the assistant role - it should be an online booking:

The prepared settings can be selected at your discretion:

What determines the choice of our settings?:
Minimizing fantasies - is an option necessary in order for the bot to be less creative and to advise the client only on the available data.
Step-by-step data entry - you will need to enter step-by-step data for the formation of the application and variables.
Do not learn from messages - to limit the influence of third parties on the bot and prevent it from being corrupted by intruders.
Buttons - so that the client does not independently enter the date, time and service during the process of making an application in the bot.
Next, go to the settings of the bot, where we will describe its main tasks:

mportant in the settings:
Since the role has already been configured by the developers of the Mavibot, only those key commands that are presumably unknown to the bot need to be specified in the bot settings.
а) There is no need to prescribe what a bot should do - it already knows perfectly well that it should advise your clients on available services.

Thanks to the prepared settings of the "Button", the AI generates services in the form of buttons: now the client does not have to independently register the name of the service, he only needs to click on the appropriate one.
After the client clicks on the button, the AI will advise them on the cost and the service itself:

б) Next, the bot will independently show the free days and time for the service selected by the client, since this is also set in the bot settings.

Please note the command “Write without changing start_block_from_ai N“ in the bot settings:

"Write without modification “start_block_from_ai 31972400" - instead of the numbers marked in green, write down the ID of the "Status" block, which was created earlier in the funnel constructor. It contains the necessary function for generating a record in the CRM system:

Copy the block ID and set it to the command 'Write without modification "start_block_from_ai N"', where substitute the ID instead of N.
Other assistant settings
We put a cached variable into the bot's knowledge, which we used in the “Primary condition verification” block:
In the knowledge of the bot, a variable need to be written as a variable using the construction #{}

In the “Format of transmitted data” field, enter the value and key:
These variables will be transferred to the system after calling the block, and using our create_booking_by_name(service_name, date, date_time) function, a CRM service will be created.
In the same Dialog Status block, we register the service_info variable again, so that after booking the client , the variable with the function value updates the data on available windows.
Now let's test the assistant:


The assistant worked correctly.
Now let's look at the calendar in the “CRM” section:

An entry is also created in the calendar, taking into account the time for the service.
This way, you can create different branches of your services and automate customer registration in an AI bot.
Booking Notification
After booking, a callback notification about booking will be sent to the dialog with the client:

new_order_in_calendar - the unchangeable part of the callback
[489046159] - order_id order ID
Added booking date_and time_booking
for 30 minutes - the duration of the service
To the object: Test 30 - to which object the booking was added
View of the callback itself:
new_order_in_calendar: [489046159] Added booking from 2025-06-01 2pm to 2025-06-01 2:30pm for 30 minutes. To the object: Test 30
You can adjust the callback response by specifying a value in the block condition:

In the block, you can specify the necessary return message to the client.
Video Guide
Last updated