Skip to main content

Bitrix24 AI-Powered RAG Chatbot for Open Line Channels

Workflow preview

Workflow preview
100%
Bitrix24 AI-Powered RAG Chatbot for Open Line Channels preview
Open on n8n.io

Important notice

This workflow is provided as-is. Please review and test before using in production.

1. Workflow Overview

Transform your Bitrix24 Open Line channels with an intelligent chatbot that leverages Retrieval Augmented Generation (RAG) technology to provide accurate, document based responses to customer inqui...

Best for

  • Support Chatbot automation workflows
  • AI RAG automation workflows
  • advanced n8n builders looking for reusable templates

Tools used

n8n-nodes-base.webhook, n8n-nodes-base.set, n8n-nodes-base.if, n8n-nodes-base.switch, n8n-nodes-base.function, n8n-nodes-base.httprequest, n8n-nodes-base.noop, n8n-nodes-base.respondtowebhook

Source and attribution

This workflow is cataloged by N8N Workflows and links back to its original n8n.io source page by Ferenc Erb.

Original n8n.io source

1.1 Workflow description

Title
Bitrix24 AI-Powered RAG Chatbot for Open Line Channels
Workflow name
Bitrix24 AI-Powered RAG Chatbot for Open Line Channels

Overview

Transform your Bitrix24 Open Line channels with an intelligent chatbot that leverages Retrieval-Augmented Generation (RAG) technology to provide accurate, document-based responses to customer inquiries in real-time.

Use Case

This workflow is designed for organizations that want to enhance their customer support capabilities in Bitrix24 by providing automated, knowledge-based responses to customer inquiries. It's particularly useful for:

  • Customer service teams handling repetitive questions
  • Support departments with extensive documentation
  • Sales teams needing quick access to product information
  • Organizations looking to provide 24/7 customer support

What This Workflow Does

Smart Document Processing

  • Automatically processes uploaded PDF documents
  • Splits documents into manageable chunks
  • Generates vector embeddings for semantic understanding
  • Indexes content for efficient retrieval

AI-Powered Responses

  • Utilizes Google Gemini AI to generate natural language responses
  • Constructs answers based on relevant document content
  • Maintains conversation context for coherent interactions
  • Provides fallback responses when information is not available

Vector Database Integration

  • Stores document embeddings in Qdrant vector database
  • Enables semantic search beyond simple keyword matching
  • Retrieves the most relevant information for each query
  • Maintains a persistent knowledge base that grows over time

Webhook Handler

  • Processes incoming messages from Bitrix24 Open Line channels
  • Handles authentication and security validation
  • Routes different types of events to appropriate handlers
  • Manages session and conversation state

Event Routing

  • Intelligently routes different event types:
    • ONIMBOTMESSAGEADD: Processes new user messages
    • ONIMBOTJOINCHAT: Handles bot joining a conversation
    • ONAPPINSTALL: Manages application installation
    • ONIMBOTDELETE: Handles bot deletion

Document Management

  • Organizes processed documents in designated folders
  • Tracks document processing status
  • Moves indexed documents to appropriate locations
  • Maintains document metadata for reference

Interactive Menu

  • Provides menu-based options for common user requests
  • Customizable menu items and responses
  • Easy navigation for users seeking specific information
  • Fallback to operator option when needed

Technical Architecture

Components

  1. Webhook Handler: Receives and validates incoming requests from Bitrix24
  2. Credential Manager: Securely manages authentication tokens and API keys
  3. Event Router: Directs events to appropriate processing functions
  4. Document Processor: Handles document loading, chunking, and embedding
  5. Vector Store: Qdrant database for storing and retrieving document embeddings
  6. Retrieval System: Searches for relevant document chunks based on user queries
  7. LLM Integration: Google Gemini model for generating natural language responses
  8. Response Manager: Formats and sends responses back to Bitrix24

Integration Points

  • Bitrix24 API: For bot registration, message handling, and user interaction
  • Ollama API: For generating document embeddings
  • Qdrant API: For vector storage and retrieval
  • Google Gemini API: For AI-powered response generation

Setup Instructions

Prerequisites

  • Active Bitrix24 account with Open Line channels enabled
  • Access to n8n workflow system
  • Ollama API credentials
  • Qdrant vector database access
  • Google Gemini API key

Configuration Steps

  1. Initial Setup

    • Import the workflow into your n8n instance
    • Configure credentials for all services
    • Set up webhook endpoints
  2. Bitrix24 Configuration

    • Create a new Bitrix24 application
    • Configure webhook URLs
    • Set appropriate permissions
    • Install the application to your Bitrix24 account
  3. Document Storage

    • Create a designated folder in Bitrix24 for knowledge base documents
    • Configure folder paths in the workflow settings
    • Upload initial documents to be processed
  4. Bot Configuration

    • Customize bot name, avatar, and description
    • Configure welcome messages and menu options
    • Set up fallback responses
  5. Testing

    • Verify successful installation
    • Test document processing pipeline
    • Send test queries to evaluate response qu

1.2 Logical Blocks

This catalog entry is organized from the workflow JSON. The node-level section below shows the executable blocks available for review before importing the template.

2. Block-by-Block Analysis

Block 1 - Bitrix24 Handler

Type / Role
n8n-nodes-base.webhook - webhook
Config choices
Version 1

Block 2 - Credentials

Type / Role
n8n-nodes-base.set - set
Config choices
Version 3.4

Block 3 - Validate Token

Type / Role
n8n-nodes-base.if - if
Config choices
Version 2.2

Block 4 - Route Event

Type / Role
n8n-nodes-base.switch - switch
Config choices
Version 3.2

Block 5 - Process Message

Type / Role
n8n-nodes-base.function - function
Config choices
Version 1

Block 6 - Process Join

Type / Role
n8n-nodes-base.function - function
Config choices
Version 1

Block 7 - Process Install

Type / Role
n8n-nodes-base.function - function
Config choices
Version 1

Block 8 - Register Bot

Type / Role
n8n-nodes-base.httpRequest - httpRequest
Config choices
Version 4.2

Block 9 - Send Message

Type / Role
n8n-nodes-base.httpRequest - httpRequest
Config choices
Version 4.2

Block 10 - Send Join Message

Type / Role
n8n-nodes-base.httpRequest - httpRequest
Config choices
Version 4.2

Block 11 - Process Delete

Type / Role
n8n-nodes-base.noOp - noOp
Config choices
Version 1

Block 12 - Success Response

Type / Role
n8n-nodes-base.respondToWebhook - respondToWebhook
Config choices
Version 1.1

Block 13 - Error Response

Type / Role
n8n-nodes-base.respondToWebhook - respondToWebhook
Config choices
Version 1.1

Block 14 - Merge parameters for Subworkflow

Type / Role
n8n-nodes-base.merge - merge
Config choices
Version 3

Block 15 - Get a list of available storages

Type / Role
n8n-nodes-base.httpRequest - httpRequest
Config choices
Version 4.2

Block 16 - Get a list of List of Files and Folders

Type / Role
n8n-nodes-base.httpRequest - httpRequest
Config choices
Version 4.2

Block 17 - Get a list of Folders files

Type / Role
n8n-nodes-base.httpRequest - httpRequest
Config choices
Version 4.2

Block 18 - Download file

Type / Role
n8n-nodes-base.httpRequest - httpRequest
Config choices
Version 4.2

Block 19 - Default Data Loader

Type / Role
@n8n/n8n-nodes-langchain.documentDefaultDataLoader - documentDefaultDataLoader
Config choices
Version 1

Block 20 - Recursive Character Text Splitter

Type / Role
@n8n/n8n-nodes-langchain.textSplitterRecursiveCharacterTextSplitter - textSplitterRecursiveCharacterTextSplitter
Config choices
Version 1

Block 21 - Split Out folder files and folders

Type / Role
n8n-nodes-base.splitOut - splitOut
Config choices
Version 1

Block 22 - Filter for files

Type / Role
n8n-nodes-base.filter - filter
Config choices
Version 2.2

Block 23 - Move files to Vector stored folder

Type / Role
n8n-nodes-base.httpRequest - httpRequest
Config choices
Version 4.2

Block 24 - Execute Workflow Trigger

Type / Role
n8n-nodes-base.executeWorkflowTrigger - executeWorkflowTrigger
Config choices
Version 1

Showing the first 24 of 34 workflow blocks. Download the JSON for the full node graph.

3. Summary Table

Workflow Bitrix24 AI-Powered RAG Chatbot for Open Line Channels
Complexity advanced
Nodes 34
Categories Support Chatbot, AI RAG
Author Ferenc Erb
Published 06 Mar 2025

4. Reproducing the Workflow from Scratch

  1. 1. Download the workflow JSON

    Use the JSON export at /data/workflows/3094/3094.json as the source template for this automation.

  2. 2. Import the template into n8n

    Open n8n, import the downloaded JSON, and review each node before activating the workflow.

  3. 3. Configure credentials and variables

    Replace placeholder credentials, API keys, webhook URLs, account IDs, and environment-specific values with your own settings.

  4. 4. Test with sample data

    Run the workflow manually or in a staging workspace, inspect node output, and confirm downstream systems receive the expected data.

  5. 5. Activate and monitor

    Enable the workflow only after testing, then monitor executions, errors, and rate limits during the first production runs.

5. General Notes & Resources

Review imported nodes carefully before activation. This catalog entry is intended to help you inspect the workflow structure, understand required services, and find related templates faster.

Node names, credentials, schedules, webhook paths, and external service limits may need adjustment for your workspace.

Frequently asked questions

What does Bitrix24 AI-Powered RAG Chatbot for Open Line Channels do?

Transform your Bitrix24 Open Line channels with an intelligent chatbot that leverages Retrieval Augmented Generation (RAG) technology to provide accurate, document based responses to customer inqui...

What do I need before importing this workflow?

Review the workflow JSON, configure any required credentials in n8n, and test the automation in a safe workspace before using it in production.

Can I customize this workflow?

Yes. Use the block-by-block analysis and the downloadable JSON to inspect each node, then adjust credentials, prompts, schedules, filters, or destinations for your Support Chatbot, AI RAG use case.