What This Workflow Does
This n8n workflow template automates the complete pipeline for preparing website content for Retrieval-Augmented Generation (RAG) systems. It starts by crawling a website's sitemap to discover all pages, then systematically processes each page through scraping, cleaning, and validation before storing the prepared content in vector storage.
The workflow solves the critical challenge of maintaining fresh, high-quality data for AI systems. Manual content updates for RAG systems are time-consuming and error-prone. This automation ensures your AI has access to the latest website content while maintaining data quality through deduplication and validation steps.
How It Works
1. Sitemap Crawling
The workflow begins by extracting all URLs from a website's sitemap.xml file. This provides a comprehensive list of pages to process while respecting the site's structure and update frequency signals.
2. URL Deduplication
Discovered URLs are checked against a Supabase database to identify new or updated pages. This prevents redundant processing of unchanged content and saves computational resources.
3. Content Scraping
Using Crawl4AI, the workflow extracts the main content from each page while excluding navigation, ads, and other boilerplate. This focuses on the valuable content needed for RAG systems.
4. Text Processing
Scraped content undergoes cleaning to remove HTML tags, normalize whitespace, and validate text quality. This step ensures only high-quality content proceeds to storage.
5. Vector Storage
Processed content is chunked and stored in vector databases like Pinecone or Weaviate, ready for retrieval by your RAG system. The workflow maintains metadata for traceability and updates.
Who This Is For
This workflow is ideal for AI teams building RAG applications, content managers maintaining knowledge bases, and developers implementing AI-powered search. Companies with documentation sites, knowledge bases, or frequently updated content will benefit most from automating this pipeline.
Pro tip: Combine this workflow with your CI/CD pipeline to automatically update your RAG system whenever website content changes.
What You'll Need
- An n8n instance (cloud or self-hosted)
- Supabase account for URL tracking
- Crawl4AI API access
- Vector database (Pinecone, Weaviate, etc.)
- Website with sitemap.xml
Quick Setup Guide
- Download the JSON template file
- Import into your n8n instance
- Configure the sitemap URL in the first node
- Set up your Supabase connection details
- Add your Crawl4AI API key
- Connect to your vector storage solution
- Test with a small subset of pages
- Schedule regular runs based on your content update frequency
Key Benefits
85% time reduction in preparing content for RAG systems compared to manual processes. Automation eliminates repetitive copying, pasting, and formatting.
Improved AI accuracy through consistent content processing. Automated validation ensures only high-quality text reaches your vector database.
Always-current knowledge for your AI applications. Regular automated updates keep your RAG system informed about the latest content changes.
Scalable processing that grows with your content. The workflow handles thousands of pages as easily as it processes dozens.
Traceable updates with comprehensive logging. Know exactly when each piece of content was last processed and updated.