Use this powerful n8n workflow to recursively scrape website sitemap and robots.txt files, handle .gz compression, extract all unique links, and save the data to Google Sheets.
Download this n8n workflow template and start using it instantly.
This sophisticated n8n workflow provides a reliable solution for extracting every unique URL contained within a potentially complex, multi-layered sitemap index. Initiated by an external n8n trigger (the Webhook), the automation requires only a domain name to begin its work. It intelligently starts by checking the robots.txt file for explicit sitemap declarations, ensuring maximum link discovery. The n8n workflow is engineered to handle common real-world challenges, such as dealing with binary file responses, decompressing .xml.gz files, and recursively following nested sitemap links using the ScrapingBee n8n node. Custom Code n8n nodes are used to filter and separate the discovered links: sitemap links are fed back into the scraper, while final webpage links are outputted to the target Google Sheet. This makes the n8n workflow an essential tool for comprehensive technical SEO audits.
This recursive n8n workflow template is executed through the following logical sequence:
?domain=example.com)./robots.txt file to find any declared sitemap links.robots.txt. If it contains 'Sitemap:', it proceeds to extract those XML links. If not, the n8n workflow falls back and scrapes the standard /sitemap.xml file..gz. If it is a .gz file, the Compression n8n node decompresses it, and a subsequent Code n8n node prepares the data for parsing..xml links, collecting only the standard web page URLs, which are then passed to the Google Sheets n8n node..xml or .xml.gz links (nested sitemaps). These links are sent back to the ScrapingBee n8n node ('Scrape xml file') to fetch and process the next layer of sitemaps, establishing the recursive nature of this n8n automation.To deploy this powerful n8n workflow template, follow these steps:
links as this is the field the n8n workflow uses for mapping.https://n8nurl>/webhook/1da30868-fbca-4e8e-8580-485afb3fd956?domain=n8n.io to start the link extraction process. Webhook (Domain to scrape): This is the primary n8n trigger. It listens for HTTP requests and extracts the target domain from the query parameters to initiate the recursive scraping n8n workflow.
ScrapingBee (Scrape robots.txt file / Scrape sitemap.xml file / Scrape xml file): A crucial n8n node used throughout the workflow to reliably fetch the contents of robots.txt and various sitemap XML files. It handles the requests needed for this complex n8n automation.
If n8n node (If it's a binary file / If it's a .gz file / If sitemap links are found): These flow control n8n nodes manage the execution path based on data structure (text vs. binary) and file type (.gz vs. .xml), ensuring the correct processing steps are applied.
Compression (Decompress .gz file): This n8n node is essential for handling sitemaps that have been gzipped (.gz extension), decompressing them so the content can be read by the parser.
Extract From File (Load the xml file as JSON): Converts the raw XML data obtained from the ScrapingBee n8n node into a standard, accessible JSON format for easier manipulation in subsequent steps of the n8n workflow.
Code n8n node (Extract non-xml links / Extract xml links): These powerful custom n8n nodes use JavaScript logic to precisely filter the extracted URLs. One path pulls out the final webpage links, while the other pulls out nested sitemap links for recursive iteration.
Use this powerful n8n workflow to automate news scraping using Decodo, structure unstructured data with Gemini AI, and log results directly to Google Sheets for analytics. Perfect n8n template.

Automate pre-call research using this powerful n8n workflow. Scrape the latest company news based on your Google Calendar entries and receive a formatted email digest daily. Download this n8n template for sales enablement.

Automate seamless web scraping using this powerful n8n workflow template. Bypass anti-bot systems with Scrappey, starting from an n8n trigger and handling test data input.

Use this powerful n8n workflow to automatically screen candidate resumes using Google Gemini AI, log results to Google Sheets, and notify HR via Gmail. A highly efficient n8n template for talent acquisition.

Use this powerful n8n workflow to automatically screen job applicants from Jotform submissions using Google Gemini AI, saving results in Notion, and alerting your team via Slack.









































