Skip to product information

RAG Facebook Messenger Bot with n8n, Supabase & OpenAI

RAG Facebook Messenger Bot with n8n, Supabase & OpenAI

 (200+Reviews)
Regular price £62.99
Regular price £62.99 Sale price
SAVE Sold out
⬇
Instant Digital Download
∞
Unlimited Downloads
★
Lifetime Access in Your Account
🔥
128+ Sold
Popular with n8n builders
âš¡
23 people viewing
High interest right now
✅
9 added today
Fast-moving digital product
RAG Facebook Messenger Bot with n8n, Supabase & OpenAI

RAG Facebook Messenger Bot with n8n, Supabase & OpenAI

Regular price £62.99
Regular price £62.99 Sale price
SAVE Sold out

RAG-Powered Facebook Messenger Bot for n8n: Supabase Vector Search + OpenRouter + Auto-Synced PDF Knowledge

Turn your PDFs into an AI-powered Facebook Messenger chatbot. This n8n workflow batches incoming Facebook messages, answers with an OpenRouter chat model using RAG retrieval from a Supabase vector store, and keeps the knowledge base automatically synced from Google Drive (adds, updates, and deletes).

What this workflow does

  • Receives Facebook Messenger webhooks, including the initial webhook verification challenge, and ignores messages sent by the page itself.
  • Captures incoming messages by extracting sender/page/message text and storing each message in an n8n Data Table keyed by the sender ID.
  • Batches user messages: repeatedly checks pending messages until the latest message is at least 10 seconds old, then combines them into a single prompt.
  • Generates replies with RAG using an AI agent backed by an OpenRouter chat model, with retrieval from the Supabase Vector Store and Postgres chat memory for conversation context.
  • Sends the response back to the user via the Facebook Graph API.
  • Keeps the knowledge base in sync from Google Drive PDFs:
    • On new PDFs: downloads, extracts text, chunks content, generates embeddings, and inserts vectors into a Supabase documents table.
    • On updated PDFs: deletes existing vectors matching the file name, then re-downloads, re-embeds, and re-indexes.
    • On PDFs moved to Google Drive Trash: deletes matching vectors from Supabase.

Use cases

  • SaaS support bot that answers questions using your policy, help docs, and product PDFs.
  • Internal knowledge assistant for teams using Messenger to access up-to-date documentation.
  • Automation engineers building a production-style RAG pipeline with Supabase and OpenAI embeddings.

Technical details

  • Workflow triggers: Facebook webhook and Google Drive (new/updated/trash PDFs)
  • Core nodes/operators used: if, set, code, wait, limit, webhook
  • RAG stack: OpenRouter chat model + Supabase Vector Store + Postgres chat memory
View full details