See llms.txt for all machine-readable content.

Facebook Graph API and Supabase integration

Save yourself the work of writing custom integrations for Facebook Graph API and Supabase and use n8n instead. Build adaptable and scalable Development, workflows that work with your technology stack. All within a building experience you will love.

How to connect Facebook Graph API and Supabase

Create a new workflow and add the first step

In n8n, click the "Add workflow" button in the Workflows tab to create a new workflow. Add the starting point – a trigger on when your workflow should run: an app event, a schedule, a webhook call, another workflow, an AI chat, or a manual trigger. Sometimes, the HTTP Request node might already serve as your starting point.

Facebook Graph API and Supabase integration: Create a new workflow and add the first step

Run a RAG Messenger chatbot with Facebook, Google Drive, Supabase, OpenAI and OpenRouter

Quick overview This workflow powers a Facebook Messenger chatbot that batches incoming user messages, answers with an OpenRouter chat model using RAG retrieval from a Supabase vector store, and keeps the knowledge base synced from PDFs in Google Drive (add, update, and delete). How it works Receives Facebook Messenger webhook requests (including the initial webhook verification challenge) and ignores messages sent by the page itself. Extracts the sender, page, and message text, then stores each incoming message in an n8n Data Table keyed by the sender ID. Re-checks the sender’s pending messages until the latest message is at least 10 seconds old, then combines all pending messages into a single prompt. Sends the combined prompt to an AI agent backed by an OpenRouter chat model, using Supabase Vector Store retrieval as a tool and Postgres chat memory for conversation context. Posts the agent’s response back to the user through the Facebook Graph API. Triggers on new PDFs in a specified Google Drive folder, downloads and extracts text, chunks the content, generates OpenAI embeddings, and inserts the vectors into a Supabase documents table. Triggers on updated PDFs in a specified Google Drive folder, deletes existing vectors matching the file name, then re-downloads, re-extracts, re-chunks, re-embeds, and re-indexes the updated content in Supabase. Triggers when a file appears in a Google Drive Trash folder, deletes matching vectors from Supabase, and then deletes the file from Google Drive. Setup Create a Facebook Page and Meta app, configure the Messenger webhook to point to this workflow’s webhook URL, and add Facebook Graph API credentials with permission to send messages. Connect Google Drive OAuth and set the correct folder IDs for the “new file”, “updated file”, and “trash” triggers. Set up Supabase (with pgvector) and a documents table, then add Supabase API credentials used for vector upserts and deletes. Add an OpenAI API key for embeddings and an OpenRouter API key for the chat model used by the AI agent. Provide a Postgres database for chat memory and ensure the n8n Data Table named conversations exists for temporary message batching storage.

Build your own Facebook Graph API and Supabase integration

Create custom Facebook Graph API and Supabase workflows by choosing triggers and actions. Nodes come with global operations and settings, as well as app-specific parameters that can be configured. You can also use the HTTP Request node to query data from any app or service with a REST API.

Supabase supported actions

Facebook Graph API and Supabase integration details

Facebook Graph API

Facebook needs no introduction. It is an online social networking and media service that gathers people from all parts of the world, from different backgrounds, and allows them to promote their businesses and services, share, react to and comment on all types of content, and communicate and message their friends.

Supabase

Supabase is an open-source Firebase alternative that provides all the backend features you need to build a product. It provides database storage, along with an easy to use authentication service.

Save engineering resources

Reduce time spent on customer integrations, engineer faster POCs, keep your customer-specific functionality separate from product all without having to code.

Learn more

FAQ about Facebook Graph API integrations

Need help setting up your Facebook Graph API and Supabase integration?

Discover our latest community's recommendations and join the discussions about Facebook Graph API and Supabase integration.

  • Nicolas Almazan

    Instagram DMs webhooks work only in test mode

    Nicolas Almazan

    I am having an issue when receiving direct messages on Instagram in LIVE mode within my workflow. I have Webhooks and HTTP requests configured in my workflow, but they are only triggered when I send direct messages from…

    Open topic
  • Cristian Martanov

    Best way to get leads from META?

    Cristian Martanov

    Hello! I have seen that there is a direct extractor of leads from META: Facebook Lead Ads Trigger, but there is also Graph API, which I think can also extract leads From what Im getting from online tutorials, this Facebo…

    Open topic
  • Rafael Ramos

    RAG supabase error searching for documents: 42883 operator does not exist: extensions.vector <=> extensions.vector null

    Rafael Ramos

    Describe the problem/error/question What is the error message (if any)? Hello everyone! I’m having trouble configuring the retrieval of information after the initial setup process has gone correctly. The database appea&hellip;

    Open topic
  • Malte Mattsson

    Problem with Supabase "Empty Array"

    Malte Mattsson

    Describe the problem/error/question I have two Supabase Vector Store nodes configured identically in “Retrieve Documents (As Tool for AI Agent)” mode, but one returns results while the other returns an empty array. Work&hellip;

    Open topic
  • Jeroen van Amerongen

    Supabase vector DB as a tool retrieval

    Jeroen van Amerongen

    Describe the problem/error/question Unable to retrieve from supabase vector DB node. Insert works fine, Supabase setup is all correct. Tested with meta data search and without but nothing comes back. Embeddings works fin&hellip;

    Open topic

Looking to integrate Slack and VirusTotal in your company?

Three colleagues talking around laptops at a shared desk

Trusted by teams building smarter workflows.

Why

Why use n8n to integrate Facebook Graph API with Supabase

Handle branching, merging and iteration easily. Pause your workflow to wait for external events.

Re-run single steps to test changes in no time. And pin your data to avoid generating trigger events every time you execute.

Your data is displayed alongside your settings, making edge cases easy to track down.

Use 1000+ workflow templates available from our core team and our community.

Copy and paste, easily import and export workflows.

Simple enough to 
understand + sophisticated 
enough to ship

Man in a brown jacket working at his desk by a window