Save, search, and summarize Telegram links with Google Sheets and Supabase
Ready for 3.0Ready 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.
Nodes used (27)
- Telegram Trigger
n8n-nodes-base.telegramTrigger - Edit Fields (Set)
n8n-nodes-base.set - If
n8n-nodes-base.if - AI Agent
@n8n/n8n-nodes-langchain.agent - Google Sheets Tool
n8n-nodes-base.googleSheetsTool - Telegram
n8n-nodes-base.telegram - HTTP Request
n8n-nodes-base.httpRequest - Google Sheets
n8n-nodes-base.googleSheets - Aggregate
n8n-nodes-base.aggregate - Basic LLM Chain
@n8n/n8n-nodes-langchain.chainLlm - Structured Output Parser
@n8n/n8n-nodes-langchain.outputParserStructured - Respond to Webhook
n8n-nodes-base.respondToWebhook - Webhook
n8n-nodes-base.webhook - Http Request Tool
n8n-nodes-base.httpRequestTool - Embeddings Google Gemini
@n8n/n8n-nodes-langchain.embeddingsGoogleGemini - Default Data Loader
@n8n/n8n-nodes-langchain.documentDefaultDataLoader - Recursive Character Text Splitter
@n8n/n8n-nodes-langchain.textSplitterRecursiveCharacterTextSplitter - Chat Memory Manager
@n8n/n8n-nodes-langchain.memoryManager - Remove Duplicates
n8n-nodes-base.removeDuplicates - Crypto
n8n-nodes-base.crypto - Supabase Vector Store
@n8n/n8n-nodes-langchain.vectorStoreSupabase - Limit
n8n-nodes-base.limit - Manual Trigger
n8n-nodes-base.manualTrigger - No Operation, do nothing
n8n-nodes-base.noOp - Simple Memory
@n8n/n8n-nodes-langchain.memoryBufferWindow - Supabase
n8n-nodes-base.supabase - OpenAI Chat Model
@n8n/n8n-nodes-langchain.lmChatOpenAi
What it does
Quick overview This workflow turns a Telegram bot into a “second brain” link library by saving shared URLs to Google Sheets, generating titles/summaries/categories with Google Gemini, and indexing full-page content in Supabase (pgvector) for semantic search. How it works 1. Triggers when a new Telegram message arrives, supports /clear to delete the per-chat memory, and sends a short usage guide if the message has no text. 2. Uses a Google Gemini chat agent with memory to decide whether the message contains URLs to save or a question to answer from the library. 3. For each URL, calls a protected n8n webhook that normalizes the URL, fetches page text via Jina Reader (r.jina.ai), and stops with a “not saved” response if the page is unreadable. 4. Looks up the normalized URL in a Google Sheets “Links” tab to avoid duplicates, then uses an LLM to generate a concise title, summary, and an existing-or-new category. 5. Upserts the card into Google Sheets (tracking notes, timestamps, and times saved), deletes any older Supabase vectors for that card, and re-embeds and inserts the latest page content into Supabase for RAG search. 6. For questions, searches either Google Sheets for structured library data or Supabase vectors for semantic content matches, then replies in Telegram with the results. Setup 1. Create and connect credentials for Telegram Bot API, Google Sheets OAuth2, Google Gemini (PaLM) API, Supabase, and one HTTP Header Auth credential shared by both the save-link webhook and the agent’s savelink tool. 2. Create a Supabase project and run the provided SQL to create the pgvector-enabled documents table and matchdocuments function with 3072 dimensions (to match Gemini embeddings). 3. Run the one-time setup to create the “Second Brain - Link Library” Google Sheets spreadsheet, then paste the new Spreadsheet ID into all nodes that reference the document (Find This Link, Read All Cards, Save to Library, and searchlibrary). 4. Update the savelink tool URL to your n8n instance domain and ensure the webhook authentication header name/value match on both sides. Requirements - Telegram Bot: A Telegram bot token to receive messages and reply. - Google Sheets: A Google Sheets OAuth2 credential — the library and source of truth for saved cards. - AI Model & Embeddings: An AI chat model plus Google Gemini embeddings (or your own equivalent). - Supabase: A Supabase project for vector storage (free tier is fine). - Jina Reader: r.jina.ai for reading page content — free, no API key required (works better with an API key). Customization - Swap Storage: Replace Google Sheets with Notion or any wiki — storage is isolated inside the Save Link path, so you change only those nodes while the agent and tools stay untouched. - Add Doorways: Feed the same agent from email, Slack, or voice by adding another trigger, with each caller passing its own source. - Tune the Pipeline: Adjust the Librarian prompt (summary style, category rules), the model nodes (any OpenAI-compatible router), or the RAG settings (chunk size, topK). Additional info Send the same link twice and the card is updated rather than duplicated; if a page can't be read, nothing is filed and the bot asks you to retry. Need help? If you're facing any issues using this workflow, join the community discussion on the n8n forum.