Skip to main content

Ai agent to chat with files in Supabase Storage and Google Drive

Workflow preview

Workflow preview
100%
Ai agent to chat with files in Supabase Storage and Google Drive preview
Open on n8n.io

Important notice

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

1. Workflow Overview

Video Guide I prepared a detailed guide that illustrates the entire process of building an AI agent using Supabase and Google Drive within N8N workflows. [![Youtube Thumbnail](https://res.cloudinar...

Best for

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

Tools used

n8n-nodes-base.httprequest, @n8n/n8n-nodes-langchain.documentdefaultdataloader, @n8n/n8n-nodes-langchain.textsplitterrecursivecharactertextsplitter, @n8n/n8n-nodes-langchain.embeddingsopenai, n8n-nodes-base.supabase, n8n-nodes-base.if, n8n-nodes-base.splitinbatches, n8n-nodes-base.manualtrigger

Source and attribution

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

Original n8n.io source

1.1 Workflow description

Title
Ai agent to chat with files in Supabase Storage and Google Drive
Workflow name
Ai agent to chat with files in Supabase Storage and Google Drive

Video Guide

I prepared a detailed guide that illustrates the entire process of building an AI agent using Supabase and Google Drive within N8N workflows.

Youtube Link

Who is this for?

This workflow is designed for developers, data scientists, and business users who wish to automate document management and enable AI-powered interactions over their stored files. It's especially beneficial for scenarios where users need to process, analyze, and retrieve information from uploaded documents rapidly.

What problem does this workflow solve?

Managing files across multiple platforms often involves tedious manual processes. This workflow facilitates automated file handling, making it easier for users to upload, parse, and interact with documents through an AI agent. It reduces redundancy and enhances the efficiency of data retrieval and management tasks.

What this workflow does

This workflow integrates Supabase storage with Google Drive and employs an AI agent to manage files effectively. The agent can:

  • Upload files to Supabase storage and activate processes based on file changes in Google Drive.
  • Retrieve and parse documents, converting them into a structured format for easy querying.
  • Utilize an AI agent to answer user queries based on saved document data.
  1. Data Collection: The workflow initially gathers files from Supabase storage, ensuring no duplicates are processed in the 'files' table.
  2. File Handling: It processes files to be parsed based on their type, leveraging LlamaParse for effective data transformation.
  3. Google Drive Integration: The workflow monitors a designated Google Drive folder to upload files automatically and refresh document records in the database with new data.
  4. AI Interaction: A webhook is established to enable the AI agent to converse with users, facilitating queries and leveraging stored document knowledge.

Setup

  1. Supabase Storage Setup:

    • Create a private bucket in Supabase storage, modifying the default name in the URL.
    • Upload your files using the provided upload options.
  2. Database Configuration:

    • Establish the 'file' and 'document' tables in Supabase with the necessary fields.
    • Execute any required SQL queries for enabling vector matching features.
  3. N8N Workflow Logic:

    • Start with a manual trigger for the initial workflow segment or consider alternative triggers like webhooks.
    • Replace all relevant credentials across nodes with your own to ensure seamless operation.
  4. File Processing and Google Drive Monitoring:

    • Set up file processing to take care of downloading and parsing files based on their types.
    • Create triggers to monitor the designated Google Drive folder for file uploads and updates.
  5. Integrate AI Agent:

    • Configure the webhook for the AI agent to accept chat inputs while maintaining session context for enhanced user interactions.
    • Utilize PostgreSQL to store user interactions and manage conversation states effectively.
  6. Testing and Adjustments:

    • Once everything is set up, run tests with the AI agent to validate its responses based on the documents in your database.
    • Fine-tune the workflow and AI model as needed to achieve desired performance.

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 - Get All files

Type / Role
n8n-nodes-base.httpRequest - httpRequest
Config choices
Version 4.2

Block 2 - Default Data Loader

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

Block 3 - Recursive Character Text Splitter

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

Block 4 - Embeddings OpenAI

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

Block 5 - Create File record2

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

Block 6 - If

Type / Role
n8n-nodes-base.if - if
Config choices
Version 2.2

Block 7 - Get All Files

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

Block 8 - Download

Type / Role
n8n-nodes-base.httpRequest - httpRequest
Config choices
Version 4.2

Block 9 - Loop Over Items

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

Block 10 - When clicking ‘Test workflow’

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

Block 11 - Aggregate

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

Block 12 - When chat message received

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

Block 13 - Insert into Supabase Vectorstore

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

Block 14 - Sticky Note

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

Block 15 - Sticky Note1

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

Block 16 - Sticky Note2

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

Block 17 - Sticky Note3

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

Block 18 - Sticky Note4

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

Block 19 - Sticky Note5

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

Block 20 - Sticky Note7

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

Block 21 - Sticky Note8

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

Block 22 - Sticky Note10

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

Block 23 - AI Agent1

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

Block 24 - OpenAI Chat Model

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

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

3. Summary Table

Workflow Ai agent to chat with files in Supabase Storage and Google Drive
Complexity advanced
Nodes 62
Categories Internal Wiki, AI RAG
Author Mark Shcherbakov
Published 15 May 2025

4. Reproducing the Workflow from Scratch

  1. 1. Download the workflow JSON

    Use the JSON export at /data/workflows/4086/4086.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 agent to chat with files in Supabase Storage and Google Drive do?

Video Guide I prepared a detailed guide that illustrates the entire process of building an AI agent using Supabase and Google Drive within N8N workflows. [![Youtube Thumbnail](https://res.cloudinar...

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.