Developing a bot to automate Bitrix24 tasks

Our company is engaged in the development, support and maintenance of Bitrix and Bitrix24 solutions of any complexity. From simple one-page sites to complex online stores, CRM systems with 1C and telephony integration. The experience of developers is confirmed by certificates from the vendor.
Our competencies:
Development stages
Latest works
  • image_website-b2b-advance_0.png
    B2B ADVANCE company website development
    1173
  • image_bitrix-bitrix-24-1c_fixper_448_0.png
    Website development for FIXPER company
    811
  • image_bitrix-bitrix-24-1c_development_of_an_online_appointment_booking_widget_for_a_medical_center_594_0.webp
    Development based on Bitrix, Bitrix24, 1C for the company Development of an Online Appointment Booking Widget for a Medical Center
    564
  • image_bitrix-bitrix-24-1c_mirsanbel_458_0.webp
    Development based on 1C Enterprise for MIRSANBEL
    745
  • image_crm_dolbimby_434_0.webp
    Website development on CRM Bitrix24 for DOLBIMBY
    655
  • image_crm_technotorgcomplex_453_0.webp
    Development based on Bitrix24 for the company TECHNOTORGKOMPLEKS
    976

Developing a Bot for Bitrix24 Task Automation

A manager creates a task but forgets to set a deadline — the task sits idle for a week. Another manager closes a deal but doesn't create a task for fulfillment — the client waits. A third scenario: every morning a supervisor manually collects task statuses from different projects. All of this is solved with a bot that works inside Bitrix24's chat and interacts with tasks, CRM, and notifications via REST API.

Bot Architecture

A bot in Bitrix24 is a server-side application registered via the imbot.register method. The portal sends events to the handler URL (webhook endpoint), the bot processes commands and responds via imbot.message.add. All logic runs on your server — Bitrix24 serves as the interface (chat) and data source (REST API).

Key components:

  • Bot registrationimbot.register specifying EVENT_HANDLER (URL for receiving events), MESSAGE_ADD (URL for sending messages), BOT_ID. After registration, the bot appears in the chat list.
  • Command handler — a server endpoint that receives POST requests from Bitrix24 when a message is sent to the bot. Parses command text, executes logic, responds.
  • REST API calls — the bot works with tasks (tasks.task.add, tasks.task.update, tasks.task.list), CRM (crm.deal.get, crm.lead.add), notifications (im.notify), users (user.get).

Automation Scenarios

Task Controller Bot

Runs on schedule (cron on the server side) and checks tasks via tasks.task.list with filters:

  • Tasks without deadline (DEADLINE = null) — sends a message to the responsible: "Task #123 has no deadline. Set a deadline or explain why".
  • Overdue tasks (DEADLINE < now, STATUS != 5) — notifies the supervisor and executor.
  • Tasks inactive for more than N days — DATE_LAST_ACTIVITY is compared with current date. If a task is "stuck" — a ping in the chat.

The bot writes to the employee's personal chat or to the project group chat depending on settings. The message contains a link to the task, the responsible person's name, and the number of days overdue.

CRM Assistant Bot

A manager writes to the bot in chat: "Create a task for shipping on deal 4521". The bot:

  1. Calls crm.deal.get with ID 4521 — receives deal data.
  2. Extracts contact, amount, products from the deal.
  3. Calls tasks.task.add — creates a task with filled fields: title, description with deal data, responsible (from settings), deadline (current date + 2 business days).
  4. Responds in chat: "Task #789 created, responsible — Ivanov A.S., deadline — Mar 15".

Parsing text commands is implemented via regular expressions or a set of fixed templates. For complex scenarios, we connect NLP processing, but in 90% of cases simple parsing is sufficient.

Report Collector Bot

A supervisor writes: "Status on project Alpha". The bot:

  1. Finds the group (project) by name via sonet_group.get with a filter.
  2. Gets project tasks: tasks.task.list with GROUP_ID filter.
  3. Groups by status: new, in progress, completed, overdue.
  4. Compiles a summary and sends it to the chat.

The response format is a structured message with breakdown by category. The Bitrix24 REST API supports formatting: bold text, links, separators.

Event Processing (Webhook Handler)

The bot receives events via POST requests. Main event types:

  • ONIMBOTMESSAGEADD — user wrote to the bot. Payload contains DIALOG_ID, MESSAGE_ID, FROM_USER_ID, message text.
  • ONIMBOTJOINCHAT — bot added to a group chat.
  • ONIMBOTDELETE — bot removed from chat.

The handler must respond with HTTP 200 within 5 seconds — otherwise Bitrix24 considers the request failed. If command processing takes longer (external API request, heavy task query), we use asynchronous processing: receive event, put in queue, respond 200, process in background, send result via imbot.message.add.

Integration with External Services

The bot is not limited to Bitrix24 data. Typical external connections:

  • Trackers and Git. Bot receives webhook from GitLab/GitHub on merge — finds a task in Bitrix24 by number from commit, changes status to "Completed".
  • Monitoring. Zabbix sends alert → bot creates a task in the "Infrastructure" project and notifies the on-call person.
  • Calendar and HR. Bot checks absences via calendar.event.get and redistributes tasks of an employee on sick leave.

Implementation Timeline

Scale Includes Timeline
Simple bot 1–2 commands, work with tasks or CRM, no external integrations 3–5 days
Medium 5–10 commands, integration with 1–2 external services, event handling 1–2 weeks
Complex Full-featured assistant with NLP, multiple integrations, admin panel 3–4 weeks

Technical Requirements

The bot server-side runs on your server or in the cloud. Requirements:

  • HTTPS access — Bitrix24 sends events only to HTTPS endpoints.
  • Response time — less than 5 seconds for POST requests. For heavy operations — queue (Redis, RabbitMQ).
  • Authorization — bot works with OAuth application rights. During registration via imbot.register, scope is specified: imbot, task, crm, sonet_group, and other modules the bot accesses.
  • Logging — all incoming events and outgoing REST API calls are logged. Without logs, debugging the bot becomes guesswork.

What We Develop

  • Server-side bot handler (Node.js, PHP, or Python — depends on your infrastructure)
  • Bot registration in Bitrix24 via imbot.register
  • Set of commands for your business processes
  • Integration with external services via webhook or API
  • Testing in dev environment, deployment to production
  • Documentation for bot commands for employees