Skip to main content

Scrape and ingest web content into Supabase pgvector with Firecrawl

Workflow preview

Workflow preview
100%
Scrape and ingest web content into Supabase pgvector with Firecrawl preview
Open on n8n.io

1. Workflow Overview

What this does Receives a URL via webhook, uses Firecrawl to scrape the page into clean markdown, and stores it as vector embeddings in Supabase pgvector. A visual, self hosted ingestion pipeline f...

Best for

  • Document Extraction automation workflows
  • AI RAG automation workflows
  • advanced n8n builders looking for reusable templates

Tools used

n8n-nodes-base.webhook, n8n-nodes-base.code, n8n-nodes-base.supabase, n8n-nodes-base.respondtowebhook, @mendable/n8n-nodes-firecrawl.firecrawl, @n8n/n8n-nodes-langchain.documentdefaultdataloader, @n8n/n8n-nodes-langchain.embeddingsopenai, @n8n/n8n-nodes-langchain.chattrigger

Source and attribution

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

Original n8n.io source

1.1 Workflow description

Title
Scrape and ingest web content into Supabase pgvector with Firecrawl
Workflow name
Scrape and ingest web content into Supabase pgvector with Firecrawl

What this does

Receives a URL via webhook, uses Firecrawl to scrape the page into clean markdown, and stores it as vector embeddings in Supabase pgvector. A visual, self-hosted ingestion pipeline for RAG knowledge bases. Adding a new source is as simple as sending a URL.

The second part of the workflow exposes a chat interface where an AI Agent queries the stored knowledge base to answer questions, with Cohere reranking for better retrieval quality.

How it works

Part 1: Ingestion Pipeline

  1. Webhook receives a POST request with a url field
  2. Verify URL validates and normalizes the domain
  3. Supabase checks if the URL was already ingested (deduplication)
  4. If the URL already exists, ingestion is skipped; otherwise it continues
  5. Firecrawl fetches the page and converts it to clean markdown
  6. OpenAI generates vector embeddings from the scraped content
  7. Default Data Loader attaches the source URL as metadata
  8. Supabase Vector Store inserts the content and embeddings into pgvector
  9. Respond to Webhook confirms how many items were added

Part 2: RAG Chat Agent

  1. Chat trigger receives a user question
  2. AI Agent (OpenRouter) queries the Supabase vector store filtered by URL
  3. Cohere Reranker improves retrieval quality before the agent responds
  4. Agent answers based solely on the ingested knowledge base

Requirements

  • Firecrawl API key
  • OpenAI API key (for embeddings)
  • OpenRouter API key (for the chat agent)
  • Cohere API key (for reranking)
  • Supabase project with pgvector enabled

Setup

  1. Create a Supabase project and run the following SQL in the SQL editor:
-- Enable the pgvector extension
create extension vector
with
 schema extensions;

-- Create a table to store documents
create table documents (
 id bigserial primary key,
 content text,
 metadata jsonb,
 embedding extensions.vector(1536)
);

-- Create a function to search for documents
create function match_documents (
 query_embedding extensions.vector(1536),
 match_count int default null,
 filter jsonb default '{}'
) returns table (
 id bigint,
 content text,
 metadata jsonb,
 similarity float
)
language plpgsql
as $$
#variable_conflict use_column
begin
 return query
 select
 id,
 content,
 metadata,
 1 - (documents.embedding <=> query_embedding) as similarity
 from documents
 where metadata @> filter
 order by documents.embedding <=> query_embedding
 limit match_count;
end;
$$;
  1. Add your Firecrawl API key as a credential in n8n
  2. Add your OpenAI API key as a credential (for embeddings)
  3. Add your OpenRouter API key as a credential (for the chat agent)
  4. Add your Cohere API key as a credential (for reranking)
  5. Activate the workflow

How to use

Send a POST request to the webhook URL:

curl -X POST https://your-n8n-instance/webhook/your-id \
 -H "Content-Type: application/json" \
 -d '{"url": "https://firecrawl.dev/docs"}'

Then open the chat interface in n8n to ask questions about the ingested content.

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 - Receive company URL

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

Block 2 - Validate and normalize URL

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

Block 3 - Check for duplicate in Supabase

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

Block 4 - Return duplicate notice

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

Block 5 - Scrape company website with Firecrawl

Type / Role
@mendable/n8n-nodes-firecrawl.firecrawl - firecrawl
Config choices
Version 1

Block 6 - Return URL validation error

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

Block 7 - Load scraped content

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

Block 8 - Generate OpenAI embeddings

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

Block 9 - Receive chat message

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

Block 10 - Answer query from enriched leads

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

Block 11 - OpenRouter LLM

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

Block 12 - Chat memory

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

Block 13 - Generate OpenAI embeddings1

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

Block 14 - Rerank results with Cohere

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

Block 15 - Sticky Note

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

Block 16 - Sticky Note1

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

Block 17 - Skip if already ingested

Type / Role
n8n-nodes-base.if - if
Config choices
Version 2.3

Block 18 - Store embeddings in Supabase

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

Block 19 - Return ingestion result

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

Block 20 - Retrieve documents from Supabase

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

3. Summary Table

Workflow Scrape and ingest web content into Supabase pgvector with Firecrawl
Complexity advanced
Nodes 20
Categories Document Extraction, AI RAG
Author Firecrawl
Published 06 Mar 2026

4. Reproducing the Workflow from Scratch

  1. 1. Download the workflow JSON

    Use the JSON export at /data/workflows/13911/13911.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 Scrape and ingest web content into Supabase pgvector with Firecrawl do?

What this does Receives a URL via webhook, uses Firecrawl to scrape the page into clean markdown, and stores it as vector embeddings in Supabase pgvector. A visual, self hosted ingestion pipeline f...

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 Document Extraction, AI RAG use case.