Skip to main content

Build a website AI chatbot with lead capture using Gemini and Supabase RAG

Workflow preview

Workflow preview
100%
Build a website AI chatbot with lead capture using Gemini and Supabase RAG preview
Open on n8n.io

Important notice

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

1. Workflow Overview

This workflow deploys a fully customizable AI chatbot that can be embedded on any website, from custom coded sites to platforms like WordPress. The chatbot is powered by n8n, uses Supabase for memo...

Best for

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

Tools used

@n8n/n8n-nodes-langchain.lmchatgooglegemini, n8n-nodes-base.googledrivetrigger, n8n-nodes-base.googledrive, @n8n/n8n-nodes-langchain.vectorstoresupabase, @n8n/n8n-nodes-langchain.documentdefaultdataloader, @n8n/n8n-nodes-langchain.textsplitterrecursivecharactertextsplitter, n8n-nodes-base.stickynote, n8n-nodes-base.splitinbatches

Source and attribution

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

Original n8n.io source

1.1 Workflow description

Title
Build a website AI chatbot with lead capture using Gemini and Supabase RAG
Workflow name
Build a website AI chatbot with lead capture using Gemini and Supabase RAG

This workflow deploys a fully customizable AI chatbot that can be embedded on any website, from custom-coded sites to platforms like WordPress. The chatbot is powered by n8n, uses Supabase for memory and RAG, and integrates SerpAPI, Google Calendar, SMTP, and Google Sheets to automate responses, collect leads, and follow up intelligently.

Unlike typical widgets, this bot captures name and email before chatting, enabling personalized, human-like conversations and smart lead tracking. Check demo here

🎯 Core Features

πŸ’‘ Universal Embedding – Works on any site (custom HTML or WordPress) using a single embed snippet.

🧠 AI Agent Node + RAG – Powered by Gemini (or any AI model) with Supabase as memory for contextual replies.

🌐 SerpAPI Integration – Lets the agent search the internet for real-time information.

πŸ“… Google Calendar & Sheets – Logs leads, appointments, and chat summaries.

πŸ“§ SMTP Node – Sends personalized follow-up emails directly to new leads.

πŸͺͺ Lead Capture – Requires users to enter their name and email before chatting, creating personalized sessions.

βš™οΈ How It Works

Chat Trigger: The widget sends user input to your n8n webhook set to production mode.

AI Processing: The AI Agent node handles the response logic with memory and RAG context from Supabase.

Integrations:

SerpAPI β†’ Real-time search.

Google Calendar & Sheets β†’ Stores lead data and events.

SMTP Node β†’ Sends automatic thank-you or follow-up emails.

Response: The chatbot replies instantly on your website, maintaining session memory.

🧩 Quick Setup Steps

Fork or use the Open Source Repo: The widget script is hosted via CDN from your GitHub repo and is fully editable.

Embed the Widget:

Copy and paste the following snippet into your site’s <head> or footer (or use a plugin like Insert Headers and Footers on WordPress):


&lt;link href="https://cdn.jsdelivr.net/npm/@n8n/chat/dist/style.css" rel="stylesheet" /&gt;
&lt;script&gt;
    window.ChatWidgetConfig = {
        webhook: {
            url: '', // production webhook URL
            route: 'general'
        },
        branding: {
            logo: '', // your logo URL
            name: 'CustomCX Agent',
            welcomeText: 'Hi πŸ‘‹, how can we help?',
            responseTimeText: 'We typically respond right away',
        },
        style: {
            primaryColor: '#854fff',
            secondaryColor: '#6b3fd4',
            position: 'right',
            backgroundColor: '#ffffff',
            fontColor: '#333333',
        }
    };
&lt;/script&gt;
&lt;script src="https://cdn.jsdelivr.net/gh/shadrack-ago/n8n/widget.js?v=2.6"&gt;&lt;/script&gt;

Connect Integrations:

Add your Supabase, SerpAPI, Google, and SMTP credentials in n8n.

Update your webhook URL in the script above.

Deploy: Activate the workflow, refresh your site, and start chatting with your AI assistant.

πŸš€ Why Use This Template

Works with any website or CMS.

Captures and stores qualified leads automatically.

Open source β€” easily modify, brand, or extend it.

Seamlessly integrates AI, CRM, and communication tools.

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 - Google Gemini Chat Model

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

Block 2 - Google Drive Trigger

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

Block 3 - Google Drive Trigger1

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

Block 4 - Download file

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

Block 5 - Supabase Vector Store

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

Block 6 - Default Data Loader

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

Block 7 - Recursive Character Text Splitter

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

Block 8 - Sticky Note

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

Block 9 - Knowledgebase

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

Block 10 - Loop Over Items

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

Block 11 - Embeddings OpenAI

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

Block 12 - Think

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

Block 13 - Calculator

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

Block 14 - Sticky Note5

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

Block 15 - Support Agent

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

Block 16 - conversation buffer

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

Block 17 - Deletes old records

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

Block 18 - Set the fields for mapping

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

Block 19 - Sticky Note1

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

Block 20 - When chat message received

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

Block 21 - Code Tool

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

Block 22 - Data Normalizer

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

Block 23 - Sticky Note2

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

Block 24 - Sticky Note3

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

3. Summary Table

Workflow Build a website AI chatbot with lead capture using Gemini and Supabase RAG
Complexity advanced
Nodes 24
Categories Support Chatbot, AI Chatbot
Author Shadrack
Published 30 Oct 2025

4. Reproducing the Workflow from Scratch

  1. 1. Download the workflow JSON

    Use the JSON export at /data/workflows/10365/10365.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 Build a website AI chatbot with lead capture using Gemini and Supabase RAG do?

This workflow deploys a fully customizable AI chatbot that can be embedded on any website, from custom coded sites to platforms like WordPress. The chatbot is powered by n8n, uses Supabase for memo...

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 Chatbot use case.