n8n

How to Connect Google Drive and Supabase Q and A Support?

Create a chat assistant that answers questions from your documents. It loads a file from Google Drive, stores it in a Supabase vector database, and uses an AI model to give clear answers. Great for support teams, training content, or policy help.

The chat starts when a message comes in. The system searches your Supabase table for the most relevant text chunks and feeds them to an AI chat model to write a helpful reply. Content is built from a Google Drive file, converted from EPUB, split into small parts, turned into embeddings, and saved in Supabase. It retrieves the top 10 matches using a custom match function. A response step formats the final text for easy output. You can also update records with upsert steps to keep the database current.

Setup needs pgvector enabled in Supabase, a table with an embedding column sized for your model, and a match_documents function. Use the same OpenAI embedding model for insert, upsert, and retrieval so dimensions match. Expect faster answers, fewer manual searches, and more capacity without adding staff. Ideal for knowledge bases, course material, and product documentation.

What are the key features?

  • Public chat trigger captures incoming questions and returns the last node response
  • Google Drive node downloads the source file by URL for ingestion
  • EPUB loader converts the file into clean documents ready for processing
  • Recursive text splitter creates small chunks that are easy to search
  • OpenAI embeddings generate 1536 dimension vectors for both insert and retrieval
  • Supabase vector store insert and retrieve by the match_documents function with top 10 results
  • Q and A chain with an OpenAI chat model writes a final, context aware answer
  • Customize Response maps the AI reply to a simple output field for the chat
  • Upsert and update steps let you refresh existing records without duplicates

What are the benefits?

  • Reduce manual reading time from 60 minutes to 2 minutes per answer
  • Automate up to 80 percent of repeated questions with source backed replies
  • Handle up to 10 times more chat requests without new hires
  • Improve answer accuracy by pulling exact text chunks from your files
  • Connect Google Drive content to a live Q and A interface
  • Keep the knowledge base current with simple upserts instead of full rebuilds

How do you set it up?

  1. Import the template into n8n: Create a new workflow in n8n > Click the three dots menu > Select 'Import from File' > Choose the downloaded JSON file.
  2. You'll need accounts with Google Drive, Supabase and OpenAI. See the Tools Required section above for links to create accounts with these services.
  3. In Supabase, enable the pgvector extension. Go to Database, then Extensions, and enable vector.
  4. Create a table with columns for content as TEXT, metadata as JSONB, and embedding as VECTOR with 1536 dimensions. Turn on Row Level Security and set policies as needed.
  5. In Supabase SQL Editor, create the match_documents function that queries by embedding similarity and returns top matches. Ensure the vector dimension matches your embedding model.
  6. In the n8n credentials manager, open the Google Drive credential on the Google Drive node. Click Create new credential, then follow the on screen steps to connect your Google account via OAuth2.
  7. In the n8n credentials manager, open the OpenAI nodes. Click Create new credential and paste your API key from the OpenAI API page. Use the same key for both embeddings and chat model nodes.
  8. On the Supabase vector store nodes, click Create new credential. Enter the Project URL and the service role or anon key from your Supabase project settings.
  9. On the Google Drive node, set the file URL for the EPUB. Confirm the Default Data Loader is set to EPUB and that the text splitter is connected.
  10. Ensure the OpenAI Embeddings nodes for insert, retrieval, and upsert all use the same model so the vector sizes match. The template uses text-embedding-3-small.
  11. On the Retrieve by Query node, set the table name and query name to match_documents. Test with a small match_count and check results.
  12. Open the chat trigger public URL and ask a question that the file can answer. Verify the response comes back and includes correct details from the source text.
  13. If you get empty results, check that embeddings were inserted, the table name is correct, and that your function and vector dimensions match. If you see permission errors, update Supabase policies to allow select and insert for your API key.

Tools Required

$24 / mo or $20 / mo billed annually to use n8n in the cloud. However, the local or self-hosted n8n Community Edition is free.

Google Drive

Sign up

Drive API: $0 (no additional cost; quota-limited)

OpenAI

Sign up

Pay-as-you-go: GPT-5 at $1.25 per 1M input tokens and $10 per 1M output tokens

Supabase

Sign up

Free: $0 / mo — unlimited API requests; 500 MB database; 5 GB bandwidth; 1 GB storage; 50,000 MAUs.

Similar Templates

Join Futurise to access 1,200+ automation templates

Get instant access to ready-made automation workflows for n8n, Make.com, AI agents, and more. Download, customise, and deploy in minutes.