Back to Catalog

Smart email assistant: automate customer support with AI & Supabase

BadrBadr
6524 views
2/3/2026
Official Page

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

-- 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 vector_cosine_ops)
  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

AI-Powered Smart Email Assistant for Customer Support

This n8n workflow automates customer support by intelligently processing incoming emails, extracting information from attached documents, leveraging a knowledge base, and generating AI-powered responses. It aims to streamline your support operations, reduce response times, and improve customer satisfaction.

What it does

This workflow orchestrates several steps to provide an AI-driven customer support solution:

  1. Triggers on new emails: It listens for new emails in a specified Gmail inbox.
  2. Extracts content from attachments: If an email has a PDF attachment, it extracts the text content from it.
  3. Loads data for AI processing: The extracted text (or the email body if no PDF) is prepared for the AI agent.
  4. Splits text for vector storage: The document content is broken down into smaller, manageable chunks suitable for embedding.
  5. Embeds text into a vector store: These text chunks are then converted into numerical embeddings using OpenAI and stored in a Supabase vector database, creating a searchable knowledge base.
  6. Initializes AI Agent: Sets up an AI agent using an OpenAI Chat Model to process queries.
  7. Configures Vector Store Tool: Provides the AI agent with a tool to query the Supabase vector store, enabling it to retrieve relevant information from your documents.
  8. Processes email with AI: The AI agent uses the email content (and potentially extracted document data) and the vector store tool to understand the customer's query and formulate an informed response.
  9. Handles different scenarios: A "Switch" node is present, indicating potential branching logic for different email types or AI outcomes (though specific conditions are not defined in the provided JSON).
  10. Prepares response: An "Edit Fields (Set)" node is included, likely to format or refine the AI-generated response before further action.

Prerequisites/Requirements

To use this workflow, you will need:

  • n8n instance: A running n8n instance.
  • Gmail Account: Configured credentials for a Gmail account to trigger on new emails.
  • Google Drive Account: Configured credentials for a Google Drive account (though its specific use is not directly connected in the provided JSON, it's a present node).
  • OpenAI API Key: For the OpenAI Chat Model and Embeddings.
  • Supabase Account: A Supabase project with a configured vector store to store and retrieve document embeddings.

Setup/Usage

  1. Import the workflow: Import the provided JSON into your n8n instance.
  2. Configure Credentials:
    • Set up your Gmail Account credentials for the "Gmail Trigger" node.
    • Set up your OpenAI API Key credentials for the "OpenAI Chat Model" and "Embeddings OpenAI" nodes.
    • Set up your Supabase credentials for the "Supabase Vector Store" node. Ensure your Supabase database is set up with a table suitable for a vector store (e.g., using pg_vector).
  3. Activate the workflow: Once all credentials are set and configurations are complete, activate the workflow.
  4. Test the workflow: Send an email to the configured Gmail inbox, optionally with a PDF attachment, to see the workflow in action.

This workflow provides a robust foundation for an AI-powered customer support system, capable of understanding queries from emails and document attachments, and responding using a knowledge base stored in Supabase.

Related Templates

Send Rapiwa WhatsApp apology & reorder link when Shopify order is cancelled

Who Is This For? This n8n workflow listens for order cancellations in Shopify, extracts relevant customer and order data, checks if the customer’s phone number is registered on WhatsApp via the Rapiwa API, and sends a personalised apology message with a re-order link. It also logs successful and unsuccessful attempts in Google Sheets for tracking. What This Workflow Does Listens for cancelled orders in your Shopify store Extracts customer details and order information Generates a personalised apology message including a reorder link Sends the message to customers via WhatsApp using a messaging API (e.g., Twilio or Rapiwa) Logs the communication results for tracking purposes Key Features Real-Time Cancellation Detection: Automatically triggers when an order is cancelled Personalised Messaging: Includes customer name, order details, and a direct reorder link WhatsApp Integration: Sends messages via WhatsApp for higher engagement Error Handling: Logs successful and failed message deliveries Reorder Link: Provides a convenient link for customers to reorder with one click Requirements n8n instance with nodes: Shopify Trigger, HTTP Request (for WhatsApp API), Code, Google Sheets (optional) Shopify store with API access WhatsApp messaging provider account with API access Valid customer phone numbers stored in Shopify orders How to Use β€” Step-by-Step Setup Credentials Setup Shopify API: Configure Shopify API credentials in n8n to listen for order cancellations WhatsApp API: Set up WhatsApp messaging credentials (e.g., Twilio, Rapiwa, or any supported provider) Google Sheets (Optional): Configure Google Sheets OAuth2 if you want to log communications Configure Trigger Set the workflow to trigger on Shopify order cancellation events Customize Message Content Modify the apology message template to include your store branding and tone Ensure the reorder link dynamically includes the customer's cancelled order info Set Up WhatsApp Node Connect your WhatsApp API credentials Ensure the phone numbers are formatted correctly for WhatsApp delivery Google Sheet Required Columns You’ll need two Google Sheets (or two tabs in one spreadsheet): A Google Sheet formatted like this ➀ sample The workflow uses a Google Sheet with the following columns to track coupon distribution: | Name | Number | Email | Address | Price | Title | Re-order Link | Validity | Status | | -------------- | ------------- | --------------------------------------------------- | ----------------- | ----------- | -------------- | ------------------------------------------------------------------------------------------------------------------------------------------------ | ------------ | ---------- | | Abdul Mannan | 8801322827799 | contact@spagreen.net | Dhaka, Bangladesh | BDT 1955.00 | Pakistani Lawn | Link πŸ”— | unverified | not sent | | Abdul Mannan | 8801322827799 | contact@spagreen.net | Dhaka, Bangladesh | BDT 1955.00 | Pakistani Lawn | Link πŸ”— | verified | sent | Important Notes Phone Number Validation: Ensure customer phone numbers are WhatsApp-enabled and formatted properly API Rate Limits: Respect your WhatsApp provider’s API limits to avoid throttling Data Privacy: Always comply with privacy laws when messaging customers Error Handling: Monitor logs regularly to handle failed message deliveries Testing: Test thoroughly with dummy data before activating the workflow live Useful Links Dashboard: https://app.rapiwa.com Official Website: https://rapiwa.com Documentation: https://docs.rapiwa.com Support & Help WhatsApp: Chat on WhatsApp Discord: SpaGreen Community Facebook Group: SpaGreen Support Website: https://spagreen.net Developer Portfolio: Codecanyon SpaGreen

RapiwaBy Rapiwa
103

Automate job searching & resume customization with AI, LinkedIn & Google Sheets

πŸ€– AI-Powered Job Matcher & Resume Customizer Description This advanced workflow automates the entire job search and preparation process, moving beyond simple notifications to provide AI-driven career intelligence. It connects to LinkedIn to scrape fresh job postings, filters against jobs you've already seen, and then uses powerful LLMs (Mistral Large/Small) to perform a detailed resume-to-job match, generate tailored cover letters, and provide concrete resume improvement suggestions. All data is logged into a Google Sheet for comprehensive tracking, and a clean, single Daily Digest Email summarizes the top 5 matches found each day. --- ✨ Key Features Automated Scheduling: Runs daily to find new job postings. Multi-Keyword Search: Uses your main job title and three alternate titles generated by an AI Agent for maximum search coverage. LinkedIn Web Scraping: Pulls new job URLs, details, location, and salary data from LinkedIn Search results. Duplicate Prevention: Uses the Compare Datasets node to ensure only new, unseen jobs are processed against your master Google Sheet. Intelligent Matching (LLM): The workflow performs a detailed job-to-resume comparison, generating: A Match Score (0-100) with evidence for alignment in skills, experience, and domain. A Tailored Cover Letter specific to the job title and company. Actionable Resume Improvement points (e.g., [ADD], [QUANTIFY]) to optimize your resume for the specific role. Centralized Tracking: Saves all job data, match scores, cover letters, and resume suggestions to a Google Sheet. Professional Daily Digest: Sends a single, clean HTML email summarizing the top 5 highest-scoring job matches for easy review. --- πŸ› οΈ Prerequisites n8n Credentials: Google Drive: To download your resume (PDF/DOCX file URL). Google Sheets: To connect to your job tracking sheet. Gmail: To send the daily digest email. Mistral Cloud: For the LLM processing (Resume Breakdown, Job Matching, and Resume Analysis). External Files: A Job Tracking Google Sheet (used as a master database). Your current Resume file (PDF recommended, hosted on Google Drive). Setup Notes: Update the file links (Download Resume node) and Google Sheet details (Get row(s)/Append nodes). Set your personal email address in the Send Digest Email node. Review the LLM prompts to tailor the AI agent's persona and output fields to your exact needs.

Jordan HoyleBy Jordan Hoyle
1405

Automate peer review assignments with GPT-4-nano, Slack and email notifications

Introduction Automate peer review assignment and grading with AI-powered evaluation. Designed for educators managing collaborative assessments efficiently. How It Works Webhook receives assignments, distributes them, AI generates review rubrics, emails reviewers, collects responses, calculates scores, stores results, emails reports, updates dashboards, and posts analytics to Slack. Workflow Template Webhook β†’ Store Assignment β†’ Distribute β†’ Generate Review Rubric β†’ Notify Slack β†’ Email Reviewers β†’ Prepare Response β†’ Calculate Score β†’ Store Results β†’ Check Status β†’ Generate Report β†’ Email Report β†’ Update Dashboard β†’ Analytics β†’ Post to Slack β†’ Respond to Webhook Workflow Steps Receive & Store: Webhook captures assignments, stores data. Distribute & Generate: Assigns peer reviewers, AI creates rubrics. Notify & Email: Alerts via Slack, sends review requests. Collect & Score: Gathers responses, calculates peer scores. Report & Update: Generates reports, emails results, updates dashboard. Analyze & Alert: Posts analytics to Slack, confirms completion. Setup Instructions Webhook & Storage: Configure endpoint, set up database. AI Configuration: Add OpenAI key, customize rubric prompts. Communication: Connect Gmail, Slack credentials. Dashboard: Link analytics platform, configure metrics. Prerequisites OpenAI API key Gmail account Slack workspace Database or storage system Dashboard tool Use Cases University peer review assignments Corporate training evaluations Research paper assessments Customization Multi-round review cycles Custom scoring algorithms Benefits Eliminates manual distribution Ensures consistent evaluation

Cheng Siong ChinBy Cheng Siong Chin
42