Skip to main content

AI-powered RAG Q&A chatbot with OpenAI, Google Sheets, Glide & Supabase

Workflow preview

Workflow preview
100%
AI-powered RAG Q&A chatbot with OpenAI, Google Sheets, Glide & Supabase preview
Open on n8n.io

Important notice

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

1. Workflow Overview

Automate AI Powered RAG System with Contextual Q&A, Google Sheets Integration, and Glide Frontend—Powered by n8n, OpenAI, Supabase, and Google Apps Script. Tools & Services Used Glide (Frontend for...

Best for

  • Support Chatbot automation workflows
  • AI RAG automation workflows
  • advanced n8n builders looking for reusable templates

Tools used

n8n-nodes-base.webhook, n8n-nodes-base.googlecalendar, @n8n/n8n-nodes-langchain.lmchatopenai, @n8n/n8n-nodes-langchain.chainllm, @n8n/n8n-nodes-langchain.vectorstoreqdrant, @n8n/n8n-nodes-langchain.embeddingsopenai, @n8n/n8n-nodes-langchain.toolvectorstore, @n8n/n8n-nodes-langchain.agent

Source and attribution

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

Original n8n.io source

1.1 Workflow description

Title
AI-powered RAG Q&A chatbot with OpenAI, Google Sheets, Glide & Supabase
Workflow name
AI-powered RAG Q&A chatbot with OpenAI, Google Sheets, Glide & Supabase

Automate AI-Powered RAG System with Contextual Q&A, Google Sheets Integration, and Glide Frontend—Powered by n8n, OpenAI, Supabase, and Google Apps Script.

Tools & Services Used

Glide (Frontend for user interactions)

Google Sheets (Stores questions and answers)

Google Apps Script (Forms + media upload handling)

OpenAI (Embeddings + GPT-4 to rank and generate answers)

Supabase (Optional for image hosting)

n8n (Automation logic and backend glue)

Workflow Overview

This automation performs the following steps:

Trigger: Webhook receives a user question from a Glide frontend.

Fetch Data: Retrieves Q&A entries (and optionally, image URLs) from a connected Google Sheet.

Rank Relevance:

OpenAI Embeddings rank the relevance of stored questions to the new input.

Top matches are passed to a GPT-4 prompt for answer generation.

Generate Answer:

GPT-4 creates a contextual answer using the best match.

Optional: Includes media URL if attached to the matched answer.

Response: Sends the formatted answer back to Glide frontend (text + optional image).

Prerequisites

Active accounts and API keys for:

OpenAI (API key with GPT-4 and embedding access)

Google Sheets (linked via Service Account or OAuth2 credentials)

Glide App (with a form to submit questions)

Supabase (optional, if hosting user-uploaded media)

n8n Self-hosted (for community nodes and webhook access)

How to Use This Template

Step 1: Import the Template

Upload the provided JSON into your self-hosted n8n instance.

Requires installation of the Community Node: @n8n/n8n-nodes-openai-embeddings

Step 2: Configure Credentials

Webhook Trigger: Replace the Glide webhook URL with your actual endpoint from your app.

Google Sheets Node: Set the spreadsheet ID and worksheet name to fetch your Q&A dataset.

OpenAI Nodes:

Insert your OpenAI API key.

Confirm that both text-embedding-ada-002 (or similar) and gpt-4 are available.

Supabase or Apps Script (Optional): Ensure image links are correctly formed in the Sheet.

Step 3: Customize Prompts and Thresholds

Update the OpenAI ranking prompt or similarity threshold in the Function or Code node.

Tailor GPT-4 prompts to return concise or detailed answers based on your use case.

Initial Test Run

Simulate a Question: Trigger the Glide form with a sample question.

Check n8n logs for:

Matching score/ranking success

Correct retrieval from Sheets

GPT-4 answer generation

Image URL handling (if enabled)

Production Prep

Add error-handling nodes for cases when Sheets are empty or GPT-4 fails.

Set up logging via Google Sheets, Supabase, or external database.

Rate-limit or debounce requests from Glide if needed.

Use Cases

Customer Support Portals: Offer instant Q&A with your business data.

Internal Knowledgebase: Employees can query training manuals and SOPs.

AI Concierge: Combine structured answers with friendly tone for guest interactions.

Disclaimer

Validate Glide form inputs before full deployment.

Ensure your OpenAI and Google Sheets usage stays within quota limits.

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 - n8n_order

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

Block 2 - Google Calendar

Type / Role
n8n-nodes-base.googleCalendar - googleCalendar
Config choices
Version 1.3

Block 3 - OpenAI Chat Model3

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

Block 4 - Concert start date

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

Block 5 - n8n_appointment

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

Block 6 - Retrive Qdrant Vector Store

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

Block 7 - Embeddings OpenAI2

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

Block 8 - RAG

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

Block 9 - OpenAI Chat Model2

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

Block 10 - OpenAI Chat Model1

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

Block 11 - Retrive Agent

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

Block 12 - n8n_rag

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

Block 13 - Tracking response

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

Block 14 - Calendar response

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

Block 15 - Webhook tracking response

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

Block 16 - API URL Tracking

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

Block 17 - Webhook calendar response

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

Block 18 - Structured Output Parser

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

Block 19 - Webhook RAG response

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

Block 20 - Sticky Note

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

Block 21 - When clicking ‘Test workflow’

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

Block 22 - Qdrant Vector Store

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

Block 23 - Create collection

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

Block 24 - Refresh collection

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

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

3. Summary Table

Workflow AI-powered RAG Q&A chatbot with OpenAI, Google Sheets, Glide & Supabase
Complexity advanced
Nodes 34
Categories Support Chatbot, AI RAG
Author Sam Yassine
Published 15 May 2025

4. Reproducing the Workflow from Scratch

  1. 1. Download the workflow JSON

    Use the JSON export at /data/workflows/4071/4071.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 Q&A chatbot with OpenAI, Google Sheets, Glide & Supabase do?

Automate AI Powered RAG System with Contextual Q&A, Google Sheets Integration, and Glide Frontend—Powered by n8n, OpenAI, Supabase, and Google Apps Script. Tools & Services Used Glide (Frontend for...

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 Support Chatbot, AI RAG use case.