Use this advanced n8n workflow to crawl website sitemaps, clean HTML content, generate OpenAI embeddings, and store vectors in Supabase for building powerful RAG knowledge bases.
Download this n8n workflow template and start using it instantly.
This comprehensive n8n workflow provides a robust solution for transforming raw website content into a ready-to-use knowledge base for AI agents. It tackles the common challenges of web scraping: handling sitemap structure, queuing URLs, cleaning noisy HTML, and ensuring data quality before vectorization. By leveraging a specialized scraping API (Crawl4AI) and integrating it with the OpenAI Embeddings n8n node, this n8n workflow automates the entire ETL (Extract, Transform, Load) process. The use of Supabase as both a job queue and a vector database ensures reliability and scalability for handling large scraping tasks, making this n8n template an essential component for production RAG systems built using n8n.
This powerful n8n workflow operates in three major phases: Sitemapping & Queuing, Scraping & Polling, and Vectorization.
scrapequeue and documents tables in Supabase, with the latter designed to hold high-dimensional vectors (1536).When clicking ‘Test workflow’, initiates the run. An HTTP Request n8n node fetches the site's sitemap, which the XML n8n node parses. The Split Out n8n node separates the sitemap into individual URLs.Loop Over Items1 block iterates through all URLs. Supabase nodes check if the URL already exists in the scrapequeue. If the URL is new, it is inserted as 'pending' using the URL in a new row Supabase n8n node.Loop Over Items) retrieves a 'pending' URL and submits it to the Crawl4AI service via an HTTP Request n8n node, which returns a taskid.Wait n8n node pauses the execution, followed by the Crawl4AITask Status node, which checks the status. An If n8n node directs completed tasks to processing or sends pending tasks back to the wait loop, ensuring robust task management. Failed tasks are marked 'error' if they exceed 10 attempts (handled by the Taskid Counter Code n8n node).Remove redundant data from the scraping Code n8n node aggressively cleans the scraped content. Subsequent Code n8n nodes (Quality Filter Node, Content Type Detection, Better Metadata Extraction) validate data integrity, assign content types, and compile rich metadata.documents vector database table. The status in the scrapequeue is updated to 'completed', finalizing the iteration of this comprehensive n8n workflow.To set up this advanced n8n template, follow these steps:
SupabaseN8N AI Agent Assistantmarinextai service, connecting to your Supabase project.vector). You must also configure the Postgres credential (PostgresN8N AI Agent Assistantmarinextai). The two initial Postgres n8n nodes must be run once manually to create the scrapequeue and documents tables.Embeddings OpenAI n8n node, specifically the OpenAiMariela.b.d. credential, which uses the text-embedding-ada-002 model.Crawl4ai_marinextai) needed by the Crawl4AI HTTP Request n8n node steps.When clicking ‘Test workflow’ n8n trigger to start fetching the sitemap and populating the queue. Manual Trigger (When clicking ‘Test workflow’): The initiating n8n trigger for this manual workflow run.
HTTP Request (Sitemap): Fetches the target website’s sitemap.xml file.
XML n8n node: Parses the received XML content from the sitemap into a usable JSON structure.
Supabase n8n node (Check/Insert URL): Used extensively for URL queue management, ensuring that URLs from the sitemap are checked for existence and inserted into the scrapequeue only if they are new or pending.
HTTP Request (Crawl4ai Web Page Scrape): Submits the URL to the external scraping service and retrieves a unique taskid.
Code n8n node (Remove redundant data): A critical step in the n8n workflow that uses custom JavaScript to clean HTML and Markdown noise from the scraped content, optimizing it for RAG.
Code n8n node (Quality Filter/Metadata): Filters out low-quality or non-meaningful pages and extracts comprehensive metadata (title, domain, language).
Character Text Splitter n8n node (LangChain): Splits the large, cleaned text into smaller chunks of 5000 characters suitable for embedding.
Embeddings OpenAI n8n node: Generates 1536-dimensional vector embeddings for each text chunk using OpenAI's API.
Supabase Vector Store n8n node (documents): Inserts the final structured data, including the text chunks, metadata, and the newly generated vector embeddings, into the Supabase vector database. This specialized n8n node is vital for RAG setup.
Automate video uploads from Google Drive to Instagram, TikTok, and YouTube. This powerful n8n workflow uses OpenAI to generate SEO descriptions and Airtable for seamless tracking and monitoring.

Automate YouTube video analysis. This powerful n8n workflow extracts transcripts, uses advanced AI models and a LangChain n8n node to generate structured summaries, and delivers the report via email. Use these n8n templates for swift content review.

Deploy this powerful n8n workflow template to automate AI image generation from chat prompts using Google Gemini for prompt engineering and external services for image creation. This n8n node flow is highly customizable.

Use this advanced n8n workflow to automate full blog creation, from topic research and SEO optimization to Ghost CMS publishing, orchestrated by specialized AI agents (GPT-4, Claude).

Use this robust n8n workflow template to expose a full suite of Instagram API tools (media, user, geo, comments) to an AI agent. Essential for advanced n8n automation and social media management.

🚀 Fractional Head of AI Ops | COO | CTO | I diagnose, fix & ship automations that pay for themselves | The Harden Method™ - Discover→Design→Build→Break→Harden→Launch→Monitor | Founder @ MarinextAI







































