Block 1 - ⚙️ Setup Instructions
- Type / Role
- n8n-nodes-base.stickyNote - stickyNote
- Config choices
- Version 1
Who's it for This template is for developers, teams, and automation enthusiasts who want a private, PIN protected Telegram chatbot that answers questions from their own documents — without relying ...
n8n-nodes-base.stickynote, n8n-nodes-base.webhook, n8n-nodes-base.postgres, n8n-nodes-base.code, n8n-nodes-base.if, n8n-nodes-base.telegram, n8n-nodes-base.httprequest, n8n-nodes-base.googledrivetrigger
This workflow is cataloged by N8N Workflows and links back to its original n8n.io source page by Ali HAIDER.
Original n8n.io sourceThis template is for developers, teams, and automation enthusiasts who want a private, PIN-protected Telegram chatbot that answers questions from their own documents — without relying on external AI APIs. Ideal for internal knowledge bases, private document search, or anyone running a local LLM stack with Ollama.
The workflow has two flows running in parallel:
Document Ingestion: Monitors a Google Drive folder for new files. When a file is added, it is downloaded, split into 500-character chunks (with 50-character overlap), embedded using Ollama's nomic-embed-text model, and stored in a PostgreSQL database with pgvector. Telegram Bot: Accepts messages from users. New users are registered and prompted for a PIN code. Once verified, users can ask any question in plain text. The question is embedded, the top 5 most similar document chunks are retrieved via cosine similarity, and qwen2.5:7b generates a context-aware answer which is sent back to the user. All queries are logged.
Enable the pgvector extension in PostgreSQL and create the 4 required tables — full SQL is included in the workflow's sticky notes Install Ollama and pull the required models: ollama pull nomic-embed-text and ollama pull qwen2.5:7b Add your credentials in n8n: Telegram Bot token (from @BotFather), PostgreSQL connection, and Google Drive OAuth2 Open the Google Drive Trigger node and select the folder you want to monitor In the Register New User node, replace YOUR_PIN_CODE with your chosen access PIN Activate the workflow and send a message to your Telegram bot
Ollama running locally (accessible at http://host.docker.internal:11434 if using Docker) PostgreSQL with pgvector extension (Supabase free tier works) Telegram Bot token from @BotFather Google Drive account
Change the LLM model: Replace qwen2.5:7b in the Build Prompt node with any Ollama-supported model Change the embedding model: Replace nomic-embed-text in Embed Query and Embed Chunk nodes (update vector dimension in the DB schema accordingly) Adjust chunk size: Modify chunkSize and overlap values in the Split Into Chunks node Change top-K results: Edit the .slice(0, 5) in Build Prompt to return more or fewer context chunks Customize the system prompt: Edit the system message in Build Prompt to change the bot's persona or restrict its scope.
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.
Showing the first 24 of 35 workflow blocks. Download the JSON for the full node graph.
| Workflow | Create a RAG Telegram bot using Google Drive, PostgreSQL, and local Ollama |
|---|---|
| Complexity | advanced |
| Nodes | 35 |
| Categories | Internal Wiki, AI RAG |
| Author | Ali HAIDER |
| Published | 13 Apr 2026 |
Use the JSON export at /data/workflows/15031/15031.json as the source template for this automation.
Open n8n, import the downloaded JSON, and review each node before activating the workflow.
Replace placeholder credentials, API keys, webhook URLs, account IDs, and environment-specific values with your own settings.
Run the workflow manually or in a staging workspace, inspect node output, and confirm downstream systems receive the expected data.
Enable the workflow only after testing, then monitor executions, errors, and rate limits during the first production runs.
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.
Who's it for This template is for developers, teams, and automation enthusiasts who want a private, PIN protected Telegram chatbot that answers questions from their own documents — without relying ...
Review the workflow JSON, configure any required credentials in n8n, and test the automation in a safe workspace before using it in production.
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 Internal Wiki, AI RAG use case.