Skip to main content

From sitemap crawling to vector storage: Creating an efficient workflow for RAG

Workflow preview

Workflow preview
100%
From sitemap crawling to vector storage: Creating an efficient workflow for 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 template crawls a website from its sitemap, deduplicates URLs in Supabase, scrapes pages with Crawl4AI, cleans and validates the text, then stores content + metadata in a Supabase vector store...

Best for

  • Market Research automation workflows
  • AI RAG automation workflows
  • advanced n8n builders looking for reusable templates

Tools used

n8n-nodes-base.manualtrigger, n8n-nodes-base.httprequest, n8n-nodes-base.xml, n8n-nodes-base.splitout, n8n-nodes-base.splitinbatches, n8n-nodes-base.wait, n8n-nodes-base.if, @n8n/n8n-nodes-langchain.documentdefaultdataloader

Source and attribution

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

Original n8n.io source

1.1 Workflow description

Title
From sitemap crawling to vector storage: Creating an efficient workflow for RAG
Workflow name
From sitemap crawling to vector storage: Creating an efficient workflow for RAG

This template crawls a website from its sitemap, deduplicates URLs in Supabase, scrapes pages with Crawl4AI, cleans and validates the text, then stores content + metadata in a Supabase vector store using OpenAI embeddings. It’s a reliable, repeatable pipeline for building searchable knowledge bases, SEO research corpora, and RAG datasets.

Good to know

•	Built-in de-duplication via a scrape_queue table (status: pending/completed/error).
•	Resilient flow: waits, retries, and marks failed tasks.
•	Costs depend on Crawl4AI usage and OpenAI embeddings.
•	Replace any placeholders (API keys, tokens, URLs) before running.
•	Respect website robots/ToS and applicable data laws when scraping.

How it works

1.	Sitemap fetch & parse — Load sitemap.xml, extract all URLs.
2.	De-dupe — Normalize URLs, check Supabase scrape_queue; insert only new ones.
3.	Scrape — Send URLs to Crawl4AI; poll task status until completed.
4.	Clean & score — Remove boilerplate/markup, detect content type, compute quality metrics, extract metadata (title, domain, language, length).
5.	Chunk & embed — Split text, create OpenAI embeddings.
6.	Store — Upsert into Supabase vector store (documents) with metadata; update job status.

Requirements

•	Supabase (Postgres + Vector extension enabled)
•	Crawl4AI API key (or header auth)
•	OpenAI API key (for embeddings)
•	n8n credentials set for HTTP, Postgres/Supabase

How to use

1.	Configure credentials (Supabase/Postgres, Crawl4AI, OpenAI).
2.	(Optional) Run the provided SQL to create scrape_queue and documents.
3.	Set your sitemap URL in the HTTP Request node.
4.	Execute the workflow (manual trigger) and monitor Supabase statuses.
5.	Query your documents table or vector store from your app/RAG stack.

Potential Use Cases

This automation is ideal for:

  • Market research teams collecting competitive data
  • Content creators monitoring web trends
  • SEO specialists tracking website content updates
  • Analysts gathering structured data for insights
  • Anyone needing reliable, structured web content for analysis

Need help customizing?

Contact me for consulting and support: LinkedIn

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 - When clicking ‘Test workflow’

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

Block 2 - HTTP Request

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

Block 3 - XML

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

Block 4 - Split Out

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

Block 5 - Loop Over Items

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

Block 6 - Wait

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

Block 7 - If

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

Block 8 - Default Data Loader

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

Block 9 - Character Text Splitter

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

Block 10 - Embeddings OpenAI

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

Block 11 - Edit Fields

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

Block 12 - Crawl4AI_Task Status

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

Block 13 - Loop Over Items1

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

Block 14 - If2

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

Block 15 - Split Out1

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

Block 16 - Format the URL

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

Block 17 - Check if the URL is in the Supabase Table

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

Block 18 - Format the Output from the Supabase node

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

Block 19 - If "shouldInsert" is true

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

Block 20 - URL in a new row

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

Block 21 - Sticky Note1

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

Block 22 - CREATE TABLE scrape_queue in Supabase

Type / Role
n8n-nodes-base.postgres - postgres
Config choices
Version 2.6

Block 23 - CREATE TABLE scrape_queue in Supabase1

Type / Role
n8n-nodes-base.postgres - postgres
Config choices
Version 2.6

Block 24 - Sticky Note2

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

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

3. Summary Table

Workflow From sitemap crawling to vector storage: Creating an efficient workflow for RAG
Complexity advanced
Nodes 40
Categories Market Research, AI RAG
Author Mariela Slavenova
Published 18 Sept 2025

4. Reproducing the Workflow from Scratch

  1. 1. Download the workflow JSON

    Use the JSON export at /data/workflows/8707/8707.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 From sitemap crawling to vector storage: Creating an efficient workflow for RAG do?

This template crawls a website from its sitemap, deduplicates URLs in Supabase, scrapes pages with Crawl4AI, cleans and validates the text, then stores content + metadata in a Supabase vector store...

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 Market Research, AI RAG use case.