Bitrix24 Open Channel RAG Chatbot with n8n Webhook

This Bitrix24 Open Channel workflow uses n8n to create a powerful RAG chatbot that processes incoming messages via webhook, retrieves document-based answers, and automates bot registration and messaging. It saves time in client communication by automating complex chatbot interactions within Bitrix24 Open Channels.
Webhook
HttpRequest
Function
+18
Workflow Identifier: 1920
NODES in Use: Webhook, Set, If, Switch, Function, HttpRequest, NoOp, RespondToWebhook, Merge, ExecuteWorkflowTrigger, SplitOut, Filter, documentDefaultDataLoader, textSplitterRecursiveCharacterTextSplitter, embeddingsOllama, vectorStoreQdrant, retrieverVectorStore, chainRetrievalQa, lmChatGoogleGemini, embeddingsOllama, vectorStoreQdrant

Press CTRL+F5 if the workflow didn't load.

Learn how to Build this Workflow with AI:

Visit through Desktop for Best experience

What This Workflow Does

This workflow catches messages from Bitrix24 Open Channels and answers clients automatically using company documents.
It stops support teams from spending many hours answering common questions by hand.
The chatbot reads company PDFs and files stored in Bitrix24 Drive and uses AI to give smart, right answers fast.
It works inside Bitrix24 chats, so clients get quick replies without waiting.


How the Workflow Works (Inputs → Process → Output)

Inputs

  • Incoming webhook events from Bitrix24 Open Channels like new user messages, bot joining chats, installation, or deletion.
  • Company documents stored in Bitrix24 Drive PDFs or similar files.
  • Bitrix24 API Credentials for making REST calls.

Processing Steps

  • The Webhook node waits for Bitrix24 events and parses them.
  • Extracts client tokens, app IDs, and tokens with the Credentials Set node.
  • Checks tokens for validity in the Validate Token node.
  • Uses switch nodes to route the event type to proper handling: new messages, bot installs, joins, or deletes.
  • Processes user messages to get text, chat ID, user ID, and session info.
  • When users ask normal questions, sends texts to a retrieval AI chain using embeddings from company documents.
  • Documents are loaded from drive, split into chunks, converted to vectors with Ollama embeddings, then saved in Qdrant.
  • The AI chain uses Google Gemini Chat model to answer questions using document context.
  • Sends answer back to chat via Bitrix24 API imbot.message.add.
  • Registers the bot dynamically on install to automate setup.
  • Sends welcome messages on chat join.
  • Handles bot deletion events gracefully.

Outputs

  • Chat replies sent inside Bitrix24 Open Channels.
  • Automated bot installation responses.
  • Updated document vector store for smarter answers.

Tools and Services Used

  • Bitrix24 Open Channels: Handles client chat messages and delivers chatbot replies.
  • n8n Automation Platform: Runs the workflow nodes and logic.
  • Bitrix24 REST API: For bot registration, message sending, and Drive file access.
  • Qdrant Vector Store: Stores text chunks from documents as AI vectors for fast retrieval.
  • Ollama Embeddings: Converts texts to AI vector format.
  • Google Gemini Chat Model: Answers client questions using document knowledge.
  • Langchain: Loads, splits, and processes documents.

Who Should Use This Workflow

This suits businesses using Bitrix24 with Open Channels and many document files.
Support teams spend too much time on common chats.
Users want fast help with real company info inside the chat.
You want to save human work and avoid confused clients with late or wrong answers.


Beginner Step-by-Step: How to Use This Workflow in n8n

1. Importing the Workflow

  1. Download the workflow file using the Download button on this page.
  2. Open n8n editor (can be cloud or self-host n8n setup).
  3. Click “Import from File” then select the downloaded JSON file.

2. Setting Credentials

  1. Open the node named Credentials Set.
  2. Fill in Bitrix24 API CLIENT_ID, CLIENT_SECRET, and tokens.
  3. Enter Qdrant vector store URL and API key.
  4. Configure Ollama embeddings node with your API key.

3. Updating IDs and Links

  1. Check folder or storage IDs in Bitrix24 to point to your document folder.
  2. Update any channel or chat IDs if needed.
  3. If prompts or messages include variables, adjust text inside relevant function nodes.

4. Testing the Workflow

  1. Manually trigger the workflow or send a test event to Bitrix24 webhook URL.
  2. Inspect the response and log output for errors.
  3. Make sure the chatbot replies appear inside Bitrix24 chat.

5. Activating for Production

  1. In n8n, toggle the workflow switch to “active”.
  2. Provide the webhook URL shown in the Webhook node to Bitrix24 Open Channels webhook settings.
  3. Monitor execution in n8n dashboard for smooth operation.

Customizations

  • Change greeting text inside Process Join node to reflect brand tone.
  • Add other file types by editing Filter Files node to accept .docx or .txt
  • Swap Ollama embeddings with another provider by updating the embeddings node model.
  • Adjust number of document chunks retrieved by changing topK in vector store retriever.
  • Insert translation steps to support other languages before and after AI response.

Troubleshooting

Problem: “Invalid application token” error

Means the incoming token does not match your Bitrix24 CLIENT_ID.
Check that Credentials Set node uses the correct CLIENT_ID. Make sure Bitrix24 webhook URLs and tokens are updated.

Problem: Chatbot does not respond to messages

Verify the Route Event node catches ONIMBOTMESSAGEADD events.
Check extraction logic in Process Message node matches the event data structure.

Problem: Files not ingested into vector store

Test Bitrix24 API calls for reading files have proper permissions.
Confirm Download File nodes get correct URLs.
Verify Qdrant vector store access and collection availability.


Pre-Production Checklist

  • Test webhook URL with sample Bitrix24 events to ensure triggers.
  • Verify all credentials and API keys are valid.
  • Check Bitrix24 app permissions for bot setup and messaging.
  • Confirm documents upload and folder IDs.
  • Run document ingestion separately to validate text splitting and vector inserts.
  • Simulate chat messages to see AI replies.

Deployment Guide

After testing, activate the workflow inside n8n by switching it on.
Copy the webhook URL from the Webhook node and add it to your Bitrix24 Open Channels webhook configuration.
Monitor the workflow in n8n dashboard for errors or warnings.
Check chat clients receive smart answers right away.


Summary

✓ Automatically answers client chats inside Bitrix24 Open Channels.
✓ Uses company documents as AI knowledge base.
✓ Saves hours of manual support work weekly.
✓ Keeps chatbot registration and messaging fully automated.
✓ Improves client satisfaction with fast, accurate replies.


Frequently Asked Questions

The workflow uses a webhook node in n8n to receive events like new messages from Bitrix24 Open Channels. It listens on a webhook URL that must be configured inside Bitrix24 Open Channels settings.
The workflow supports PDF documents stored inside a specific Bitrix24 Drive folder by default. Other document types like DOCX or TXT can be added by editing the file filtering nodes.
Yes, replacing the Ollama embeddings node with another compatible embeddings provider like OpenAI or Cohere is possible by updating node parameters and API keys.
Test the workflow by sending messages to the configured webhook URL and confirm messages appear in the chat. Check that the event routing and message processing nodes correctly parse and respond to chat events.

Promoted by BULDRR AI

Related Workflows

Automate Viral UGC Video Creation Using n8n + Degaus (Beginner-Friendly Guide)

Learn how to automate viral UGC video creation using n8n, AI prompts, and Degaus. This beginner-friendly guide shows how to import, configure, and run the workflow without technical complexity.
Form Trigger
Google Sheets
Gmail
+37
Free

AI SEO Blog Writer Automation Workflows in n8n

A complete beginner guide to building an AI SEO blog writer automation using n8n.
AI Agent
Google Sheets
httpRequest
+5
Free

Automate CrowdStrike Alerts with VirusTotal, Jira & Slack

This workflow automates processing of CrowdStrike detections by enriching threat data via VirusTotal, creating Jira tickets for incident tracking, and notifying teams on Slack for quick response. Save hours daily by transforming complex threat data into actionable alerts effortlessly.
scheduleTrigger
httpRequest
jira
+5
Free

Automate Telegram Invoices to Notion with AI Summaries & Reports

Save hours on financial tracking by automating invoice extraction from Telegram photos to Notion using Google Gemini AI. This workflow extracts data, records transactions, and generates detailed spending reports with charts sent on schedule via Telegram.
lmChatGoogleGemini
telegramTrigger
notion
+9
Free

Automate Email Replies with n8n and AI-Powered Summarization

Save hours managing your inbox with this n8n workflow that uses IMAP email triggers, AI summarization, and vector search to draft concise replies requiring minimal review. Automate business email processing efficiently with AI guidance and Gmail integration.
emailReadImap
vectorStoreQdrant
emailSend
+12
Free

Automate Email Campaigns Using n8n with Gmail & Google Sheets

This n8n workflow automates personalized email outreach campaigns by integrating Gmail and Google Sheets, saving hours of manual follow-up work and reducing errors in email sequences. It ensures timely follow-ups based on previous email interactions, optimizing communication efficiency.
googleSheets
gmail
code
+5
Free