Skip to main content

Chat with documents via RAG: Google Drive to GPT-5 with Supabase vector database

Workflow preview

Workflow preview
100%
Chat with documents via RAG: Google Drive to GPT-5 with Supabase vector database preview
Open on n8n.io

Important notice

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

1. Workflow Overview

n8n RAG Ingestion & Query Workflow Overview This workflow is your all in one pipeline to turn any document into a powerful searchable knowledge base using RAG (Retrieval Augmented Generation). F...

Best for

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

Tools used

n8n-nodes-base.googledrive, n8n-nodes-base.splitout, @n8n/n8n-nodes-langchain.documentdefaultdataloader, @n8n/n8n-nodes-langchain.embeddingsopenai, @n8n/n8n-nodes-langchain.textsplittercharactertextsplitter, @n8n/n8n-nodes-langchain.vectorstoresupabase, n8n-nodes-base.googledrivetrigger, n8n-nodes-base.stickynote

Source and attribution

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

Original n8n.io source

1.1 Workflow description

Title
Chat with documents via RAG: Google Drive to GPT-5 with Supabase vector database
Workflow name
Chat with documents via RAG: Google Drive to GPT-5 with Supabase vector database

πŸ“„ n8n RAG Ingestion & Query Workflow

Overview

This workflow is your all-in-one pipeline to turn any document into a powerful searchable knowledge base using RAG (Retrieval-Augmented Generation).
From the moment a file lands in your Google Drive, it’s automatically processed, understood, and made ready for instant AI-powered answers.

If you’re looking to unlock hidden value in your files and get answers in seconds instead of hours, this workflow is the foundation you need.


What It Does for You

  • πŸ“₯ Automatic Ingestion – New files in a designated Google Drive folder are instantly picked up.
  • πŸ” OCR Extraction – Extracts all text, whether it’s plain or inside tables.
  • πŸ“š Vector Database Storage – Keeps your documents in Supabase for lightning-fast semantic search.
  • 🧩 Smart Chunking – Each page becomes a single chunk for better understanding.
  • πŸ’‘ AI-Powered Answers – Ask questions in natural language and get precise, context-aware responses.
  • 🧠 Persistent Memory – Remembers previous chats for more coherent conversations.
  • ⚑ GPT-5 Intelligence – Uses OpenAI’s most advanced model for deep, accurate answers.

How It Works

  1. Detect β†’ Watches your Google Drive folder for new files.
  2. Extract β†’ Uses Mistral AI to read all text, including tables.
  3. Chunk β†’ Splits content so one page = one chunk for better context.
  4. Embed β†’ Generates vector embeddings with OpenAI for semantic search.
  5. Store β†’ Inserts processed content into Supabase.
  6. Retrieve & Answer β†’ When you ask, the system searches the database and passes the results to GPT-5.
  7. Remember β†’ Stores conversation history in Postgres for continuity.

Why You Want This

  • Stop wasting time digging through files.
  • Get fast, AI-driven answers from your own documents.
  • Keep your data organized and searchable at any scale.
  • Designed for businesses, researchers, and teams who want instant access to the right information.
  • You get the template + setup guide and description

Key Highlights

  • End-to-End Automation – From upload to query, no manual steps needed.
  • Flexible – Works with any document type.
  • High Accuracy – Large chunk size preserves full page context.
  • Scalable – Add as many files as you want without slowing down.
  • Future-Ready – Built to grow with your needs.

πŸš€ Imagine having your own private ChatGPT trained on your files.
This workflow makes it happen. Upload, search, and get answers β€” all automatically.

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 - Download File4

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

Block 2 - Split Out1

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

Block 3 - Default Data Loader4

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

Block 4 - Embeddings OpenAI8

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

Block 5 - Character Text Splitter4

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

Block 6 - Insert into Supabase Vectorstore3

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

Block 7 - Create file

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

Block 8 - Sticky Note

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

Block 9 - OCR

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

Block 10 - Sticky Note1

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

Block 11 - Sticky Note2

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

Block 12 - Sticky Note3

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

Block 13 - Supabase Vector Store

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

Block 14 - Embeddings OpenAI6

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

Block 15 - Chat Memory

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

Block 16 - When chat message received

Type / Role
@n8n/n8n-nodes-langchain.chatTrigger - chatTrigger
Config choices
Version 1.3

Block 17 - Sticky Note4

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

Block 18 - GPT 5

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

Block 19 - RAG Agent

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

Block 20 - Sticky Note5

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

Block 21 - Slack Trigger

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

Block 22 - Telegram Trigger

Type / Role
n8n-nodes-base.telegramTrigger - telegramTrigger
Config choices
Version 1.2

Block 23 - Gmail Trigger

Type / Role
n8n-nodes-base.gmailTrigger - gmailTrigger
Config choices
Version 1.2

Block 24 - WhatsApp Trigger

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

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

3. Summary Table

Workflow Chat with documents via RAG: Google Drive to GPT-5 with Supabase vector database
Complexity advanced
Nodes 30
Categories Internal Wiki, Multimodal AI
Author Paul
Published 12 Aug 2025

4. Reproducing the Workflow from Scratch

  1. 1. Download the workflow JSON

    Use the JSON export at /data/workflows/7308/7308.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 Chat with documents via RAG: Google Drive to GPT-5 with Supabase vector database do?

n8n RAG Ingestion & Query Workflow Overview This workflow is your all in one pipeline to turn any document into a powerful searchable knowledge base using RAG (Retrieval Augmented Generation). F...

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, Multimodal AI use case.