Smart email assistant: automate customer support with AI & Supabase
Needs changesNeeds changes. This template uses 1 thing(s) that n8n 3.0 removes: AI Agent v1 (old agent modes). 1 breaking item(s) found. Static check, last run 2026-10-19.
What to replace before upgrading
| Removed in 3.0 | Replace with |
|---|---|
| AI Agent v1 (old agent modes) AI Response Generator (v1.7) | Latest AI Agent node (Tools Agent). For SQL Agent, use a Postgres or MySQL tool with a recent AI Agent. |
Worth a look
- Gmail Trigger below v1.4 runs as v1.4 (drafts skipped, max emails per poll) (Email Monitor)
Nodes used (16)
- Gmail Trigger
n8n-nodes-base.gmailTrigger - OpenAI
@n8n/n8n-nodes-langchain.openAi - Switch
n8n-nodes-base.switch - AI Agent
@n8n/n8n-nodes-langchain.agent - OpenAI Chat Model
@n8n/n8n-nodes-langchain.lmChatOpenAi - Vector Store Question Answer Tool
@n8n/n8n-nodes-langchain.toolVectorStore - Embeddings OpenAI
@n8n/n8n-nodes-langchain.embeddingsOpenAi - Supabase Vector Store
@n8n/n8n-nodes-langchain.vectorStoreSupabase - Default Data Loader
@n8n/n8n-nodes-langchain.documentDefaultDataLoader - Google Drive
n8n-nodes-base.googleDrive - Google Drive Trigger
n8n-nodes-base.googleDriveTrigger - Extract from File
n8n-nodes-base.extractFromFile - Recursive Character Text Splitter
@n8n/n8n-nodes-langchain.textSplitterRecursiveCharacterTextSplitter - Supabase
n8n-nodes-base.supabase - Edit Fields (Set)
n8n-nodes-base.set - Gmail Tool
n8n-nodes-base.gmailTool
What it does
Intelligent Email Support System with Vector Database Overview This n8n workflow automates email support using AI and vector database technology to provide smart, context-aware responses. It seamlessly integrates email automation and document management, ensuring efficient customer support. π System Components βοΈ Email Support System 1. Email Monitoring & Classification - Gmail trigger node monitoring inbox - AI-powered email classification - Intelligent routing (support vs non-support inquiries) 2. AI Response Generation - LangChain agent for response automation - OpenAI integration for NLP-driven replies - Vector-based knowledge retrieval - Automated draft creation in Gmail 3. Vector Database System - Supabase vector store for document management - OpenAI embeddings for vector conversion - Fast and efficient similarity search π Document Management System 1. Google Drive Integration - Monitors specific folders for new/updated files - Automatic document processing - Supports various file formats 2. Document Processing Pipeline - Auto file download & text extraction - Smart text chunking for better indexing - Embedding generation via OpenAI - Storage in Supabase vector database π Workflow Processes π§ Email Support Flow 1. Monitor Gmail inbox for new emails 2. AI classification of incoming messages 3. Route support emails to AI response generator 4. Perform vector similarity search for knowledge retrieval 5. Generate personalized AI-driven response 6. Create email drafts in Gmail π Document Management Flow 1. Monitor Google Drive for new/updated files 2. Auto-download and process documents 3. Clean up outdated vector entries for updated files 4. Extract and split document text efficiently 5. Generate OpenAI embeddings 6. Store processed data in Supabase vector DB βοΈ Setup Instructions 1οΈβ£ Prerequisites - Supabase account & project - OpenAI API key - Gmail account with OAuth2 setup - Google Drive API access - n8n installation 2οΈβ£ Supabase Database Setup sql -- Create the vector extension create extension if not exists vector; -- Create the documents table create table documents ( id bigserial primary key, content text, metadata jsonb, embedding vector(1536) ); -- Create an index for similarity search create index on documents using ivfflat (embedding vectorcosineops) with (lists = 100); 3οΈβ£ Google Drive Setup - Create & configure two monitored folders: - RAG folder for new documents documents - Assign correct folder permissions - Add folder IDs to the workflow 4οΈβ£ Document Processing Configuration - Set up triggers for file creation and file updates - Configure text extraction: - Define chunk size & overlap settings - Set document metadata processing π Maintenance & Optimization π Regular Tasks - Monitor system performance - Update the knowledge base regularly - Review AI response quality - Optimize vector search parameters - Clean up outdated document embeddings β
Best Practices 1. Document Organization - Maintain structured folders & naming conventions - Keep knowledge base content updated 2. System Optimization - Track AI classification accuracy - Tune response times & chunk sizes - Perform regular database maintenance π οΈ Troubleshooting 1. Email Issues - Verify Gmail API credentials - Check AI service uptime - Monitor classification performance 2. Document Processing Issues - Ensure correct file permissions - Validate extraction & embedding processes - Debug vector database insertions