Deploy a robust, multi-department support bot with this advanced n8n workflow. Integrates Telegram, PostgreSQL for sessions, Google Drive, Pinecone RAG, and AI agents.
Download this n8n workflow template and start using it instantly.
Managing customer inquiries efficiently across multiple departments—such as Billing, Technical Support, and Returns—is challenging. This n8n workflow solves this by creating a highly organized, intelligent support bot powered by retrieval-augmented generation (RAG).
This sophisticated n8n solution uses Telegram as the interface and PostgreSQL for persistent session management, allowing the bot to maintain context even across long conversations. Crucially, the system uses three parallel RAG pipelines that monitor Google Drive folders. When a new policy document (like a PDF) is added, an n8n trigger initiates the automatic embedding and ingestion into the correct Pinecone vector store namespace, ensuring the AI agent always has the latest information. This dynamic setup makes the n8n workflow an ideal backend for responsive, accurate customer service.
The entire process starts with the Telegram n8n trigger, monitoring incoming messages.
Switch1): A primary n8n node, Switch1, routes the user based on their current state and command (/start or /end)./start, they are prompted with available departments. If they send a slash command (e.g., /billing), a second Switch n8n node detects the command, sends a confirmation via a Telegram n8n node, and updates the PostgreSQL session to set the user's department and activate the chat session.AI Agent3 n8n node.Simple Memory n8n node, and dynamically uses the appropriate Pinecone Vector Store n8n tool (e.g., only the 'Billing' vector store if the user is in that department).Embeddings Cohere, Default Data Loader, Character Text Splitter), and inserted into the relevant Pinecone namespace using an n8n node configured for insertion, keeping the knowledge base current.To deploy this comprehensive n8n workflow, follow these steps:
Telegram Trigger and all Telegram send nodes.Postgres n8n nodes for session management.Google Drive Trigger nodes and ensure they point to the correct department-specific folders.This n8n workflow leverages several powerful nodes:
Telegram Trigger (n8n trigger): The starting point. Listens for new messages on Telegram, initiating the core automation flow.
Postgres (Execute a SQL query / Select rows): Used for robust state management. It inserts new user IDs, checks their session status (active/department), and updates their chosen department, making this n8n node critical for context.
Switch (n8n node): Essential for routing the user's journey. The primary switch handles /start, /end, and routes messages to the AI Agent if a department is selected.
AI Agent3 (n8n node): The core intelligence. This Langchain n8n node dynamically routes user questions to the correct knowledge base using specific tools.
OpenRouter Chat Model3 (n8n node): Provides the LLM capabilities (configured here using the deepseek model).
Pinecone Vector Store (Insert Mode): Used in the three parallel RAG ingestion pipelines. This n8n node inserts document chunks and their Cohere embeddings into the dedicated Pinecone namespaces (billing, tech ques, return policy).
Pinecone Vector Store (Retrieve-as-Tool Mode): Used within the AI Agent configuration. These n8n nodes act as specialized tools, allowing the AI to search the correct knowledge base based on the user’s department context.
Google Drive Trigger (n8n trigger): Watches specified Google Drive folders. This n8n trigger ensures the knowledge base is updated automatically whenever new documents are uploaded.
Centralize error management for your automations. This robust n8n workflow captures failures using the specialized n8n trigger and routes detailed alerts to Telegram, Gmail, and other channels. Download this n8n templates for reliable monitoring.

Automate multi-channel task reminders using a powerful n8n workflow, PostgreSQL, Slack, Telegram, and Email. Use this robust n8n template for reliable scheduling and delivery.

Automate product feedback intake using an n8n workflow. Consolidate Telegram, Gmail, and Google Forms data, score via AI (RICE method), create Jira tickets, and generate Notion reports.

Implement a powerful multi-engine search toolset for your AI agent using this n8n workflow template. Integrates 20+ specialized SerpApi search functions via an n8n MCP server.

Use this robust n8n workflow to automatically process and ingest multi-format documents (PDF, Docx, Excel) from Google Drive into a Supabase Vectorstore using OpenAI embeddings, perfect for building custom RAG chatbots.

Use this powerful n8n workflow to automatically monitor multi-jurisdiction regulatory changes (EU, US, UK), compare them against active contracts via a Postgres database, calculate risk scores using a custom n8n node, and send critical alerts via Gmail. This is one of the essential n8n templates for legal tech.








































