AutomationFlowsAI & RAG › Smart Email Assistant: Automate Customer Support with AI & Supabase

Smart Email Assistant: Automate Customer Support with AI & Supabase

ByBadr @b4dr on n8n.io

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. Email Monitoring & Classification Gmail trigger…

Event trigger★★★★☆ complexityAI-powered23 nodesGmail TriggerOpenAIAgentOpenAI ChatTool Vector StoreOpenAI EmbeddingsSupabase Vector StoreDocument Default Data Loader
AI & RAG Trigger: Event Nodes: 23 Complexity: ★★★★☆ AI nodes: yes Added:

This workflow corresponds to n8n.io template #2929 — we link there as the canonical source.

This workflow follows the Agent → Documentdefaultdataloader recipe pattern — see all workflows that pair these two integrations.

The workflow JSON

Copy or download the full n8n JSON below. Paste it into a new n8n workflow, add your credentials, activate. Full import guide →

Download .json
{
  "meta": {
    "templateCredsSetupCompleted": true
  },
  "nodes": [
    {
      "id": "c71e68fa-1901-4df7-b76f-9508213f0753",
      "name": "Email Monitor",
      "type": "n8n-nodes-base.gmailTrigger",
      "position": [
        -760,
        -640
      ],
      "parameters": {},
      "typeVersion": 1.2
    },
    {
      "id": "4a5d0db0-41c9-4824-80b2-6329bd1379d0",
      "name": "AI Email Classifier",
      "type": "@n8n/n8n-nodes-langchain.openAi",
      "notes": "Uses AI to classify incoming emails as customer support or non-support",
      "position": [
        -240,
        -640
      ],
      "parameters": {},
      "typeVersion": 1.7
    },
    {
      "id": "cb835409-ba65-406e-ba54-60d9a62c6b5d",
      "name": "Route Email",
      "type": "n8n-nodes-base.switch",
      "notes": "Routes emails based on AI classification results",
      "position": [
        120,
        -640
      ],
      "parameters": {},
      "typeVersion": 3.2
    },
    {
      "id": "91198514-c899-427d-9e7a-41017897390a",
      "name": "AI Response Generator",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "notes": "Generates personalized support responses using AI",
      "position": [
        620,
        -700
      ],
      "parameters": {},
      "typeVersion": 1.7
    },
    {
      "id": "26f65176-b37a-48cb-bd77-5d02485f0a56",
      "name": "OpenAI Chat Model2",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        380,
        -360
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "90b26157-6653-4f50-982f-0cfae21576bc",
      "name": "Vector Store Tool1",
      "type": "@n8n/n8n-nodes-langchain.toolVectorStore",
      "position": [
        880,
        -500
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "9ccfe80d-195e-42a9-8168-3d76d3252817",
      "name": "OpenAI Chat Model3",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        1320,
        -240
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "db7eea69-2084-49ce-940b-d90c213fef1a",
      "name": "Embeddings OpenAI1",
      "type": "@n8n/n8n-nodes-langchain.embeddingsOpenAi",
      "position": [
        680,
        -120
      ],
      "parameters": {},
      "typeVersion": 1.1
    },
    {
      "id": "4168a0fd-05e4-4db1-a0bb-119d8a60bb23",
      "name": "Supabase Vector Store",
      "type": "@n8n/n8n-nodes-langchain.vectorStoreSupabase",
      "position": [
        740,
        -300
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "1e71a2f2-90b9-4a34-ad67-59fdc2ee9f71",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -2400,
        -820
      ],
      "parameters": {
        "content": ""
      },
      "typeVersion": 1
    },
    {
      "id": "8bbdc661-4a8b-4da6-93dc-34239eca7675",
      "name": "Default Data Loader",
      "type": "@n8n/n8n-nodes-langchain.documentDefaultDataLoader",
      "position": [
        1120,
        560
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "1a153c81-9322-4829-99d1-f7c862dbf5bc",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -660,
        220
      ],
      "parameters": {
        "content": ""
      },
      "typeVersion": 1
    },
    {
      "id": "6d4520bd-d7a8-4f67-8826-d310c15e3a01",
      "name": "Download File",
      "type": "n8n-nodes-base.googleDrive",
      "position": [
        460,
        440
      ],
      "parameters": {},
      "executeOnce": true,
      "typeVersion": 3
    },
    {
      "id": "4afd45d7-4d67-4fef-af05-0e6e82392742",
      "name": "File Created",
      "type": "n8n-nodes-base.googleDriveTrigger",
      "position": [
        -580,
        340
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "a3bea952-8bf0-4a86-8c31-b9042556e2ce",
      "name": "File Updated",
      "type": "n8n-nodes-base.googleDriveTrigger",
      "position": [
        -580,
        560
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "95891826-3c3e-4e77-abed-33133672eea9",
      "name": "Extract Document Text",
      "type": "n8n-nodes-base.extractFromFile",
      "position": [
        720,
        440
      ],
      "parameters": {},
      "typeVersion": 1,
      "alwaysOutputData": true
    },
    {
      "id": "4cb79fec-98e2-45f3-b88f-52b5e4145b73",
      "name": "Recursive Character Text Splitter",
      "type": "@n8n/n8n-nodes-langchain.textSplitterRecursiveCharacterTextSplitter",
      "position": [
        1120,
        760
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "ea6a2e0e-a5c4-4ee5-8c32-9e3c002a4859",
      "name": "Delete Old Doc Rows",
      "type": "n8n-nodes-base.supabase",
      "position": [
        160,
        440
      ],
      "parameters": {},
      "typeVersion": 1,
      "alwaysOutputData": true
    },
    {
      "id": "8a3257e2-89b8-4999-8201-39af615976da",
      "name": "Set File ID",
      "type": "n8n-nodes-base.set",
      "position": [
        -260,
        420
      ],
      "parameters": {},
      "typeVersion": 3.4
    },
    {
      "id": "139d3e27-90b0-4ada-b31f-7cc98b6b089f",
      "name": "Insert into Supabase Vectorstore",
      "type": "@n8n/n8n-nodes-langchain.vectorStoreSupabase",
      "position": [
        1000,
        340
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "2db8ca4f-79f6-4407-b498-3d05d3b506ac",
      "name": "Embeddings OpenAI",
      "type": "@n8n/n8n-nodes-langchain.embeddingsOpenAi",
      "position": [
        960,
        560
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "01463a9d-0781-4ee8-9649-f7210ad25dd4",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -860,
        -900
      ],
      "parameters": {
        "content": ""
      },
      "typeVersion": 1
    },
    {
      "id": "d8fc3491-0b50-4cdb-b5bc-6cbffcd3276b",
      "name": "Create Draft",
      "type": "n8n-nodes-base.gmailTool",
      "position": [
        1440,
        -520
      ],
      "parameters": {},
      "typeVersion": 2.1
    }
  ],
  "connections": {
    "Route Email": {
      "main": [
        [
          {
            "node": "AI Response Generator",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Set File ID": {
      "main": [
        [
          {
            "node": "Delete Old Doc Rows",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Create Draft": {
      "ai_tool": [
        [
          {
            "node": "AI Response Generator",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "File Created": {
      "main": [
        [
          {
            "node": "Set File ID",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "File Updated": {
      "main": [
        [
          {
            "node": "Set File ID",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Download File": {
      "main": [
        [
          {
            "node": "Extract Document Text",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Email Monitor": {
      "main": [
        [
          {
            "node": "AI Email Classifier",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Embeddings OpenAI": {
      "ai_embedding": [
        [
          {
            "node": "Insert into Supabase Vectorstore",
            "type": "ai_embedding",
            "index": 0
          }
        ]
      ]
    },
    "Embeddings OpenAI1": {
      "ai_embedding": [
        [
          {
            "node": "Supabase Vector Store",
            "type": "ai_embedding",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Chat Model2": {
      "ai_languageModel": [
        [
          {
            "node": "AI Response Generator",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Chat Model3": {
      "ai_languageModel": [
        [
          {
            "node": "Vector Store Tool1",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Vector Store Tool1": {
      "ai_tool": [
        [
          {
            "node": "AI Response Generator",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "AI Email Classifier": {
      "main": [
        [
          {
            "node": "Route Email",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Default Data Loader": {
      "ai_document": [
        [
          {
            "node": "Insert into Supabase Vectorstore",
            "type": "ai_document",
            "index": 0
          }
        ]
      ]
    },
    "Delete Old Doc Rows": {
      "main": [
        [
          {
            "node": "Download File",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Extract Document Text": {
      "main": [
        [
          {
            "node": "Insert into Supabase Vectorstore",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Supabase Vector Store": {
      "ai_vectorStore": [
        [
          {
            "node": "Vector Store Tool1",
            "type": "ai_vectorStore",
            "index": 0
          }
        ]
      ]
    },
    "Recursive Character Text Splitter": {
      "ai_textSplitter": [
        [
          {
            "node": "Default Data Loader",
            "type": "ai_textSplitter",
            "index": 0
          }
        ]
      ]
    }
  }
}
Pro

For the full experience including quality scoring and batch install features for each workflow upgrade to Pro

About this workflow

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. Email Monitoring & Classification Gmail trigger…

Source: https://n8n.io/workflows/2929/ — original creator credit. Request a take-down →

More AI & RAG workflows → · Browse all categories →

Related workflows

Workflows that share integrations, category, or trigger type with this one. All free to copy and import.

AI & RAG

A lightweight, self-hosted AI assistant built entirely in n8n. Multi-channel messaging (Telegram, WhatsApp, Gmail), persistent memory, task management, and autonomous work — all in a single visual wor

Telegram Trigger, OpenRouter Chat, Data Table +20
AI & RAG

Your AI workforce is ready. Are you?

Google Sheets Tool, Mcp Trigger, Google Drive +29
AI & RAG

This intelligent chatbot leverages cutting-edge financial APIs and AI-driven analysis to deliver comprehensive stock research reports. Get instant access to professional-grade investment analysis that

Tool Think, Supabase Vector Store, OpenAI Embeddings +15
AI & RAG

RAG_Ingest. Uses httpRequest, vectorStoreSupabase, documentDefaultDataLoader, textSplitterRecursiveCharacterTextSplitter. Event-driven trigger; 73 nodes.

HTTP Request, Supabase Vector Store, Document Default Data Loader +4
AI & RAG

This advanced n8n workflow automates the full lead enrichment, qualification, and personalized outreach process tailored specifically for the B2B real estate sector. Integrating top platforms like Api

N8N Nodes Fillout, OpenAI Chat, Pinecone Vector Store +11