Templates / Create a RAG Telegram bot using Google Drive, PostgreSQL, and local Ollama

Create a RAG Telegram bot using Google Drive, PostgreSQL, and local Ollama

Ready for 3.0

by Ali HAIDER ✓ · 230 views · created 2026-04-13 · Internal Wiki, AI RAG

Ready for 3.0. This template uses no nodes that n8n 3.0 removes. No removed nodes, versions or helpers found. Static check, last run 2026-10-19.

What this workflow does

This workflow has 29 nodes and runs when an HTTP POST request hits its webhook URL (plus 1 other trigger). Along the way it connects Postgres, Telegram and Google Drive. It also calls host.docker.internal:11434 over HTTP.

How it runs

Trigger: When an HTTP POST request hits its webhook URL (plus 1 other trigger).

  1. Get User (Postgres): run a query
  2. Download File (Google Drive): download
  3. User State Router (Code): runs custom JavaScript code
  4. Extract Text (Code): runs custom JavaScript code
  5. Is New User? (If): checks a condition and branches into true / false
  6. Split Into Chunks (Code): runs custom JavaScript code
  7. Register New User (Postgres): run a query
  8. Is Verified? (If): checks a condition and branches into true / false
  9. Loop Chunks (Loop Over Items (Split in Batches)): loops over the items in batches
  10. Send PIN Request (Telegram): uses Telegram

…plus 17 more steps. See the full node list below.

Services it uses

PostgresTelegramGoogle Drive

HTTP calls to: host.docker.internal:11434

Before you upgrade to n8n 3.0

Nothing in this workflow is removed in n8n 3.0, so it should import and run after the upgrade.

Nodes used (9)

From the author

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 on external AI APIs. Ideal for internal knowledge bases,…

Excerpt from Ali HAIDER's description on n8n.io.

View the original on n8n.io → Check your own copy

Get the weekly “what broke” email

New templates, newly broken ones, and n8n release changes. One short email a week.

Form not loading? Subscribe here.