Imagine your sales department drowning in repetitive inquiries, managers spending 2/3 of their time on routine tasks, and leads leaving due to slow responses. A chatbot for Bitrix24 solves this problem. We specialize in Bitrix24 chatbot development, including Open Lines chatbot and CRM integration, delivering turnkey solutions. Unlike standard auto-replies in Open Lines, which only cover one scenario—"you wrote outside business hours, please wait"—our bot handles up to 80% of incoming requests without operator involvement: it qualifies the lead, answers typical questions, creates deals in CRM, and transfers only those clients it couldn't process. Contact us to discuss scenarios for your business.
Architecture of a Chatbot in Bitrix24
Bitrix24 provides two mechanisms for chatbots:
Built-in Bot Framework — register a bot via REST API method imbot.register. The bot operates inside Bitrix24: replies in chats, Open Lines, internal conversations. Events are sent to your server's webhook URL.
Open Lines + external handler — all messages from connected channels (Telegram, WhatsApp, website) pass through an Open Line. The external service subscribes to events via imopenlines.bot.session.message and replies via imbot.message.add.
For most tasks, our Bitrix24 chatbot development uses a combination: external service (Python/Node.js) + Bitrix24 Bot Framework + CRM integration via REST. According to the official Bitrix24 REST API documentation, the imbot.register method is used to register a bot.
Registration and Bot Lifecycle
POST /rest/imbot.register
{
"CODE": "support_bot",
"EVENT_HANDLER": "https://your-server.com/bot/handler",
"EVENT_MESSAGE_ADD": "https://your-server.com/bot/message",
"OPENLINE": "Y",
"PROPERTIES": {"NAME": "Support", "COLOR": "AZURE"}
}
After registration, Bitrix24 assigns a BOT_ID. All incoming client messages in Open Lines connected to this bot are sent to EVENT_MESSAGE_ADD as a POST request with fields: BOT_ID, DIALOG_ID, MESSAGE, USER_ID.
The bot replies via:
POST /rest/imbot.message.add
{
"BOT_ID": 123,
"DIALOG_ID": "chat456",
"MESSAGE": "Hello! How can I help you?"
}
To transfer a chat to an operator — imopenlines.session.transfer with the operator's USER_ID or queue ID.
Dialog Logic: FSM vs. NLP
A script-based bot (FSM — finite state machine) is the most predictable option. Each dialog is a state tree. The user selects from buttons, the bot moves to the next state.
Buttons in Bitrix24 are implemented via KEYBOARD in imbot.message.add:
"KEYBOARD": {
"BUTTONS": [
[{"TEXT": "Order status", "COMMAND": "order_status"}],
[{"TEXT": "Return item", "COMMAND": "return"}],
[{"TEXT": "Talk to operator", "COMMAND": "transfer"}]
]
}
An NLP bot understands free text. It requires connecting a language model (Dialogflow, Rasa, OpenAI API). Process: message → NLP service → intent → intent handler → response. Accuracy for Russian in Rasa heavily depends on training data quality. OpenAI GPT-4 works without training but costs more at high loads.
In practice, we use a hybrid: structured buttons + NLP for free input with a fallback to operator when confidence is low (below 0.7). Hybrid bot is 1.5 times better than pure FSM, handling 95% of requests versus 60%.
Chatbot Integration with CRM
The key point is that everything the bot learns about the client must go into CRM. A typical scenario:
- Client writes → bot creates a lead:
crm.lead.addwith sourceSOURCE_ID = 'CHAT'. - Bot asks qualifying questions: name, phone, issue summary.
- Answers are written to lead fields:
crm.lead.updatewith filledNAME,PHONE,COMMENTS. - If the client enters a phone — bot searches for it in CRM:
crm.contact.listwith filter byPHONE. Found — updates, not found — creates. - When transferring to operator — the lead is already filled, operator sees chat history in the card.
Creating/updating a CRM entity automatically appears in the timeline — standard behavior of the crm module.
Real Case from Our Practice: Chatbot for an Online Store
Our case — development and deployment of a chatbot for a large home appliance e‑commerce store handling ~500 inquiries per day via Telegram. 70% of incoming questions fell into three typical scenarios: "Where is my order?", "Can I return an item?", "Is a specific model in stock?". This is an ideal situation for automation.
Solution architecture: Node.js server on a dedicated VPS + Bitrix24 Bot Framework + REST integration with 1C for syncing orders and stock levels. The bot works in the Telegram Open Line and syncs all actions with CRM.
Implemented scenarios:
- "Where is my order" → bot requests order number → queries 1C (via 1C REST service) → returns actual status. No operator involvement.
- "Product availability" → search Bitrix catalog (
iblock.element.list+ stock filter) → output current real-time stock. - "Product return" → FSM scenario: purchase date → return reason → product photo (upload via
disk.folder.uploadfile) → auto‑create a task for manager with attachment. - Non‑standard inquiries → automatic transfer to operator with category note for fast processing.
Results after one month: operators handle only 35% of initial inquiry volume. The remaining 65% is successfully closed by the bot without human involvement. Average response time for typical questions dropped from 8 minutes to 15 seconds (32 times faster). This allowed the client to reduce support operational costs by 40%, saving approximately $5,000 per month, while improving NPS. Our development cost for a basic bot is $2,500, and complex projects cost $8,000.
Technical details during development: the main bottleneck was file handling (product/package photos). Bitrix24 sends uploaded files via temporary links with TTL of 30-60 seconds. We had to implement asynchronous download with retry logic and caching in S3 to avoid data loss during network failures.
Testing and QA of Chatbots
Before going live, all scenarios and edge cases must be tested:
- Functional testing — every FSM path run manually. Correctness of replies, user input handling, CRM data transfer are checked.
- Integration testing — interaction with Bitrix24 API, 1C, payment systems. Special attention to network errors and timeouts with slow internet.
- Load testing — simulate peak loads (if expecting 500+ messages per hour). Check how the bot server handles the request queue, no messages lost.
- Real channel testing — pilot with a limited group (e.g., 10% of incoming traffic) before full launch. Catches issues invisible on staging.
A typical chatbot regression test includes 15-20 scenarios and takes 2-3 hours of manual testing. We recommend re‑testing with every dialog logic update.
Deployment and Monitoring
Deployment is usually on a dedicated VPS or container (Docker + PM2). Critical requirements:
- SSL certificate for webhook URL (Bitrix24 requires HTTPS).
- Fixed IP or DNS with long TTL (changing IP causes message loss).
- Persistent connection to a message queue (Redis/RabbitMQ for async processing under high load).
- Logging all requests and errors — without it, diagnosing problems is impossible.
Monitoring after launch:
- Processing metrics: messages per hour, success rate, transfer rate to operator.
- Response time: average and max time from incoming message to bot reply.
- Errors: number of API errors, timeouts, failed external integrations.
- Availability: live webhook endpoint check every 5 minutes, auto‑alert on failure.
We recommend connecting Sentry or a similar service for real‑time exception tracking. Quick reaction is crucial — even 1 hour of downtime means losing 20+ client inquiries.
Hybrid Architecture Is More Effective
Comparison of bot types helps choose the optimal option:
| Bot Type | Accuracy | Development Complexity | Data Requirements |
|---|---|---|---|
| FSM | High | Low | None |
| NLP | Medium | High | Training set |
| Hybrid | High | Medium | Minimal |
Hybrid architecture (FSM + NLP) handles 95% of requests vs 60% for pure FSM — 1.5x more efficient.
What's Included in Chatbot Development
- Business requirements analysis and scenario description
- Dialog logic development (FSM/NLP)
- Bot registration and setup in Bitrix24
- CRM integration (leads, contacts, deals)
- Third‑party integrations (1C, ERP, telephony)
- Deployment on client's server
- Scenario documentation and deployment guide
- 30‑day warranty support
Example of hybrid message processing
- Message arrives at external server.
- NLP service attempts to identify intent. If confidence > 0.7 — execute corresponding scenario.
- If confidence below 0.7 — bot offers button choices (FSM) or transfers to operator.
- All data is saved to CRM.
Effort Estimation Factors
| Component | Effort |
|---|---|
| Basic FSM bot (3-5 scenarios) | 16-40 h |
| CRM integration (leads, contacts) | 8-16 h |
| NLP on OpenAI/Dialogflow | 16-40 h |
| External system integration (1C, ERP) | 16-40 h |
| Testing, deployment, monitoring | 8-16 h |
A minimal working bot with 3-4 scenarios and CRM integration — from 40 hours (typical cost $2,500). A complex multi‑scenario bot with NLP and external integrations — 80-120 hours (typical cost $8,000). Contact us for a project estimate — we'll calculate timelines and cost individually. Get a consultation right now.







