n8n RAG chatbot for website support, built on your own documents
This n8n workflow gives your website a support chatbot that answers only from your own documents. One branch loads files from a Google Drive folder into a Supabase vector store. The other runs the embeddable n8n chat: an AI agent searches your documents for each question, answers in plain English, and posts a handoff to Slack with the visitor's details when it cannot answer or the visitor asks for a person.
- Difficulty
- Advanced
- Setup time
- About 1 to 2 hours
- Nodes
- 15
- Checked against
- n8n 2.41
- n8n Chat
- OpenAI or Anthropic
- OpenAI embeddings
- Supabase
- Google Drive
- Slack
Last reviewed October 2026
What this workflow does
Website visitors ask the same questions about opening hours, delivery, returns, pricing structure and how a service works, often outside business hours. Generic chatbots either give canned menus or, worse, make up answers that contradict your policies. Staff end up answering the same questions by email while the information already sits in documents nobody can find.
This template is for Australian businesses with a set of support documents, such as FAQs, policies, product guides or service descriptions, that want a chatbot grounded in that material. It suits retailers, clinics, trades, education providers, councils and SaaS teams who want quick answers on the website and a clear path to a human when the bot reaches the limit of what it knows.
Who it's for
- →Small support teams answering repeat website questions
- →Businesses that want after-hours answers without a live chat roster
- →Teams whose policies and FAQs already live in Google Drive
- →Developers prototyping a RAG chatbot before building a custom one
How it works, step by step
- 1
Website chat
The Chat Trigger in embedded mode receives each message from the @n8n/chat widget on your site. Allowed origins restrict it to your domain.
- 2
Support agent
An AI Agent with a system message that tells it to search before answering, answer only from your documents, avoid sensitive information and hand off when unsure. Conversation memory keeps the last ten messages per session.
- 3
Search knowledge base
A Supabase vector store in retrieve-as-tool mode, using OpenAI embeddings, returns the five most relevant chunks of your documents for each question.
- 4
Hand off to a human
A Slack tool the agent calls when it cannot answer or the visitor asks for a person. It posts the visitor's name, email and a summary to your support channel.
- 5
Load all documents now
The ingestion branch starts with a manual trigger that lists every file in your Google Drive knowledge folder, for the first load or a full refresh.
- 6
New file in knowledge folder
A Google Drive Trigger watches the same folder, so documents added later are loaded without running anything by hand.
- 7
Download document
Each file is downloaded, with Google Docs converted to plain text. PDFs, Word files and text files are passed through as they are.
- 8
Add to knowledge base
A document loader detects the file type, a recursive text splitter breaks it into overlapping chunks, and the Supabase vector store saves each chunk with its embedding and file name.
What you need
n8n
n8n Cloud or self-hosted, active and reachable from your website for the chat widget.
OpenAI API key
For embeddings, and for the chat model unless you swap it for Anthropic.
Supabase project
With the pgvector extension, a documents table and a match_documents function. Supabase offers a Sydney region.
Google Drive
A folder holding the documents you want the bot to answer from.
Slack workspace
A channel for handoff messages from the bot.
Set it up in n8n
- 1
Create a Supabase project in the Sydney region, enable pgvector and run the documents table and match_documents function SQL from the n8n Supabase vector store docs.
- 2
Import the workflow and add your Supabase, OpenAI and Google Drive credentials to the matching nodes.
- 3
Put your FAQs, policies and guides in one Google Drive folder and set its folder ID in List files in knowledge folder and New file in knowledge folder.
- 4
Run Load all documents now and check that rows appear in the Supabase documents table.
- 5
Edit the Support agent system message with your business name, hours, contact options and the topics it should not discuss.
- 6
Connect Slack to Hand off to a human and change the #support channel to your own support channel.
- 7
In Website chat, set allowed origins to your domain and activate the workflow.
- 8
Embed the chat on your site with the @n8n/chat package or script, using the chat URL from the trigger, and test it with real customer questions.
Ways to customise it
- +Add a File Updated trigger plus a step that deletes a file's old chunks before reloading it, so edited documents stay current.
- +Send handoffs by email with a Gmail tool, or create a ticket in Zendesk, Freshdesk or HubSpot instead of posting to Slack.
- +Swap Supabase for Pinecone, Qdrant or Postgres with pgvector if you already run one of them.
- +Store chat memory in Postgres or Redis so conversations survive restarts and can be reviewed.
- +Add a Google Calendar tool so the bot can offer appointment times for bookable services.
For Australian businesses
Show a short notice in the chat window saying answers are AI-generated and messages may be processed overseas. Visitor messages go to the AI provider and embeddings API, often in the United States, which is a cross-border disclosure under APP 8 of the Privacy Act 1988. Supabase offers a Sydney region, so stored document chunks can stay in Australia, and self-hosting n8n in an Australian cloud region keeps chat memory onshore. The agent is told not to ask for payment details or health information. Only load documents you would publish, because the bot can quote anything in the folder. Check that answers match the Australian Consumer Law where your documents cover refunds and warranties.
Tools in this workflow
n8n
Free plan + paidAutomation
A workflow automation platform that combines a visual node editor with code when you need it. It connects hundreds of apps and APIs and includes AI agent nodes that can call language models, tools and memory. Teams can self-host the free Community Edition on their own servers or use n8n's hosted cloud.
Best for: Australian organisations that need automation data to stay onshore
n8n review →ChatGPT (OpenAI)
Free plan + paidGeneral Assistant
OpenAI's general-purpose AI assistant. It handles writing, coding, file and image analysis, data analysis and web research through a chat interface, with an API for building it into your own systems.
Best for: Small and mid-sized teams wanting one general assistant for everyday writing and analysis
ChatGPT review →Claude (Anthropic)
Free plan + paidGeneral Assistant
Anthropic's AI assistant, known for careful reasoning, long-document analysis, writing and coding. It can work through large documents and codebases in a single conversation, paid plans include the Claude Code agentic coding tool, and it is available through an API and major cloud platforms.
Best for: Legal, policy and consulting teams reviewing long documents
Claude review →Pinecone
Free plan + paidDatabase
A fully managed vector database and knowledge platform. It stores embeddings of your documents or products so AI applications can find relevant content by meaning, the retrieval step behind document chatbots and semantic search, and adds Pinecone Assistant for managed question answering over files.
Best for: Developers building retrieval-augmented chatbots over company documents
Pinecone review →Support
An AI customer service agent that answers and resolves customer questions across chat, email, voice, WhatsApp, SMS and Slack using your help content and policies. It runs natively on Intercom's helpdesk but also works with other helpdesks such as Salesforce and HubSpot.
Best for: Support teams with a well-maintained help centre and high ticket volumes
Fin review →
Frequently asked questions
What is a RAG chatbot in n8n?
Retrieval-augmented generation means the bot searches your documents first and answers from the matching passages. In n8n, a vector store node retrieves the passages and the AI Agent writes the answer, so replies stay grounded in your content.
Why Supabase instead of the in-memory vector store?
The in-memory store is lost when n8n restarts and is not shared between workers. Supabase keeps your document chunks in a Postgres database you control, with a Sydney region option and standard Postgres backups and access controls.
How do I add the chat to my website?
Set the Chat Trigger to embedded mode, activate the workflow, then add the @n8n/chat widget to your site with the chat URL. You can style it with CSS variables and set the welcome message and title.
What happens when the bot does not know the answer?
The system message tells the agent not to guess. It asks for the visitor's name and email, calls the Slack handoff tool with a summary, and tells the visitor a person will reply by email within one business day.
Which file types can it load from Google Drive?
Google Docs are converted to plain text on download. The document loader also detects PDF, Word, CSV, JSON and text files by type. Scanned PDFs need OCR first, because the loader reads text, not images.
More customer service templates
Other n8n templates
- Speed to Lead: AI Lead Qualification from Website Form to HubSpot
- AI Company Research Agent: Lead Research Briefs Saved to HubSpot
- Supplier Invoice Email to Xero Draft Bill with AI Extraction
- Tiered Overdue Invoice Reminders from Xero
- File Email Attachments into Google Drive with AI
- Daily Business KPI Digest from Stripe, Shopify and GA4
Want this running in your business?
AI Lab Australia sets up n8n workflows end to end: hosting in Australia, connecting your systems, testing with real data and handing over documentation.
