Skip to main content

AI-Powered RAG Document Processing & Chatbot with Google Drive, Supabase, OpenAI

Workflow preview

Workflow preview
100%
AI-Powered RAG Document Processing & Chatbot with Google Drive, Supabase, OpenAI preview
Open on n8n.io

Important notice

This workflow is provided as-is. Please review and test before using in production.

1. Workflow Overview

Who is this for? This workflow is perfect for: Businesses and teams who need an automated solution to organize, analyze, and retrieve insights from their internal documents. Researchers who want to...

Best for

  • Internal Wiki automation workflows
  • AI RAG automation workflows
  • advanced n8n builders looking for reusable templates

Tools used

n8n-nodes-base.splitinbatches, n8n-nodes-base.extractfromfile, @n8n/n8n-nodes-langchain.documentdefaultdataloader, n8n-nodes-base.googledrivetrigger, @n8n/n8n-nodes-langchain.textsplittercharactertextsplitter, n8n-nodes-base.set, n8n-nodes-base.googledrive, n8n-nodes-base.switch

Source and attribution

This workflow is cataloged by N8N Workflows and links back to its original n8n.io source page by Billy Christi.

Original n8n.io source

1.1 Workflow description

Title
AI-Powered RAG Document Processing & Chatbot with Google Drive, Supabase, OpenAI
Workflow name
AI-Powered RAG Document Processing & Chatbot with Google Drive, Supabase, OpenAI

Who is this for?

This workflow is perfect for:

  • Businesses and teams who need an automated solution to organize, analyze, and retrieve insights from their internal documents.
  • Researchers who want to quickly analyze and query large collections of research papers, reports, or datasets.
  • Customer support teams looking to streamline access to product documentation and support resources.
  • Legal and compliance professionals needing to reference and query legal documents with confidence.
  • AI enthusiasts and developers wanting to implement Retrieval-Augmented Generation (RAG) systems without starting from scratch.

What problem is this workflow solving?

Manually organizing, processing, and searching through documents can be time-consuming, error-prone, and inefficient. This workflow solves that by:

  • Automating document processing from Google Drive, supporting multiple formats like PDFs, CSVs, and Google Docs.
  • Extracting, chunking, and enhancing document text, preserving context and improving AI comprehension.
  • Storing vector embeddings in a secure, scalable Supabase vector database, enabling semantic search and retrieval.
  • Providing an interactive AI chat interface that allows users to ask natural language questions and get precise, document-based answers.

This means teams can quickly access relevant insights from their document repositories—boosting productivity and ensuring accurate information retrieval.

Key Features

  • 🚀 End-to-End Document Processing: From Google Drive upload detection to vector embedding and storage.
  • 🔍 Semantic Search & Retrieval: Users can ask complex, natural-language questions and receive contextually relevant answers.
  • 🤖 AI-Powered Summaries & Metadata: Automatically generates document titles and summaries using Google Gemini AI.
  • 📝 Smart Chunking & Contextual Enhancement: Breaks documents into smart chunks with overlap, preserving context and table integrity.
  • 🔐 Secure & Scalable Vector Database: Stores and retrieves embeddings in a Supabase vector store for fast, reliable searches.
  • 💬 Conversational AI Interface: Uses OpenAI to power natural, accurate, and cost-effective AI chat interactions.

How does this workflow work?

  • Monitors Google Drive for new files
  • Extracts text from PDFs and CSVs (or Google Docs auto-converted)
  • Splits text into context-preserving chunks
  • Enhances chunk quality and stores embeddings in Supabase
  • Enables natural language search and AI-powered chat interactions with the stored documents

Typical Use Cases

  • 📚 Corporate Knowledge Base
  • 🔬 Research Paper Analysis
  • 📞 Customer Support Document Query
  • ⚖️ Legal Document Review and Analysis
  • 🔍 Internal Team Documentation Search

Why You’ll Love It

This workflow lets you build a scalable, searchable, and AI-powered document system—without needing to write complex code or manage multiple systems. With this, you can:

  • Stay organized with automated document processing.
  • Deliver faster, more accurate answers to user queries.
  • Reduce manual work and improve productivity.
  • Gain a competitive edge with cutting-edge AI search capabilities.

Setup Requirements

  • An n8n instance with Google Drive, Supabase, OpenAI, and Gemini credentials configured.
  • Access to a Supabase vector store for storing document embeddings.
  • Configurable chunk size, overlap, and processing limits (default: 1000 characters per chunk, 20 chunks max).

Contact me for consulting and support:
📧 [email protected]

1.2 Logical Blocks

This catalog entry is organized from the workflow JSON. The node-level section below shows the executable blocks available for review before importing the template.

2. Block-by-Block Analysis

Block 1 - Loop Over Items

Type / Role
n8n-nodes-base.splitInBatches - splitInBatches
Config choices
Version 3

Block 2 - Extract from PDF

Type / Role
n8n-nodes-base.extractFromFile - extractFromFile
Config choices
Version 1

Block 3 - Extract from CSV

Type / Role
n8n-nodes-base.extractFromFile - extractFromFile
Config choices
Version 1

Block 4 - Default Data Loader

Type / Role
@n8n/n8n-nodes-langchain.documentDefaultDataLoader - documentDefaultDataLoader
Config choices
Version 1

Block 5 - Google Drive Trigger File Created

Type / Role
n8n-nodes-base.googleDriveTrigger - googleDriveTrigger
Config choices
Version 1

Block 6 - Character Text Splitter

Type / Role
@n8n/n8n-nodes-langchain.textSplitterCharacterTextSplitter - textSplitterCharacterTextSplitter
Config choices
Version 1

Block 7 - Set File ID

Type / Role
n8n-nodes-base.set - set
Config choices
Version 3.4

Block 8 - Download FIle

Type / Role
n8n-nodes-base.googleDrive - googleDrive
Config choices
Version 3

Block 9 - Switch

Type / Role
n8n-nodes-base.switch - switch
Config choices
Version 3.2

Block 10 - Structured Output Parser

Type / Role
@n8n/n8n-nodes-langchain.outputParserStructured - outputParserStructured
Config choices
Version 1.2

Block 11 - Google Gemini Chat Model

Type / Role
@n8n/n8n-nodes-langchain.lmChatGoogleGemini - lmChatGoogleGemini
Config choices
Version 1

Block 12 - Process Context

Type / Role
@n8n/n8n-nodes-langchain.chainLlm - chainLlm
Config choices
Version 1.6

Block 13 - Document Data

Type / Role
n8n-nodes-base.set - set
Config choices
Version 3.4

Block 14 - Split Out

Type / Role
n8n-nodes-base.splitOut - splitOut
Config choices
Version 1

Block 15 - Limit

Type / Role
n8n-nodes-base.limit - limit
Config choices
Version 1

Block 16 - Summarize

Type / Role
n8n-nodes-base.summarize - summarize
Config choices
Version 1.1

Block 17 - Embeddings OpenAI

Type / Role
@n8n/n8n-nodes-langchain.embeddingsOpenAi - embeddingsOpenAi
Config choices
Version 1.2

Block 18 - Add Data to Supabase Vector Store

Type / Role
@n8n/n8n-nodes-langchain.vectorStoreSupabase - vectorStoreSupabase
Config choices
Version 1.1

Block 19 - Google Gemini Chat Model1

Type / Role
@n8n/n8n-nodes-langchain.lmChatGoogleGemini - lmChatGoogleGemini
Config choices
Version 1

Block 20 - Sticky Note

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 21 - Sticky Note1

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 22 - Create Metadata Title & Description

Type / Role
@n8n/n8n-nodes-langchain.chainLlm - chainLlm
Config choices
Version 1.6

Block 23 - Split into chunks

Type / Role
n8n-nodes-base.code - code
Config choices
Version 2

Block 24 - OpenAI Chat Model

Type / Role
@n8n/n8n-nodes-langchain.lmChatOpenAi - lmChatOpenAi
Config choices
Version 1.2

Showing the first 24 of 36 workflow blocks. Download the JSON for the full node graph.

3. Summary Table

Workflow AI-Powered RAG Document Processing & Chatbot with Google Drive, Supabase, OpenAI
Complexity advanced
Nodes 36
Categories Internal Wiki, AI RAG
Author Billy Christi
Published 01 Jun 2025

4. Reproducing the Workflow from Scratch

  1. 1. Download the workflow JSON

    Use the JSON export at /data/workflows/4551/4551.json as the source template for this automation.

  2. 2. Import the template into n8n

    Open n8n, import the downloaded JSON, and review each node before activating the workflow.

  3. 3. Configure credentials and variables

    Replace placeholder credentials, API keys, webhook URLs, account IDs, and environment-specific values with your own settings.

  4. 4. Test with sample data

    Run the workflow manually or in a staging workspace, inspect node output, and confirm downstream systems receive the expected data.

  5. 5. Activate and monitor

    Enable the workflow only after testing, then monitor executions, errors, and rate limits during the first production runs.

5. General Notes & Resources

Review imported nodes carefully before activation. This catalog entry is intended to help you inspect the workflow structure, understand required services, and find related templates faster.

Node names, credentials, schedules, webhook paths, and external service limits may need adjustment for your workspace.

Frequently asked questions

What does AI-Powered RAG Document Processing & Chatbot with Google Drive, Supabase, OpenAI do?

Who is this for? This workflow is perfect for: Businesses and teams who need an automated solution to organize, analyze, and retrieve insights from their internal documents. Researchers who want to...

What do I need before importing this workflow?

Review the workflow JSON, configure any required credentials in n8n, and test the automation in a safe workspace before using it in production.

Can I customize this workflow?

Yes. Use the block-by-block analysis and the downloadable JSON to inspect each node, then adjust credentials, prompts, schedules, filters, or destinations for your Internal Wiki, AI RAG use case.