π Generate a hierarchical sitemap from a URL into Google Sheets using Firecrawl
β‘ 1,080 views Β· π Market Research & Insights
π‘ Pro Tip β HTTP Request scraping tends to break when sites update their markup. If youβre scraping a major platform, check if ScraperNode covers it β it has maintained scrapers for LinkedIn, Instagram, TikTok, YouTube, and 20+ other platforms that return structured data.
Description
πΊ Full walkthrough video: https://youtu.be/yjeKYfZP0kU
> β οΈ Self-hosted only β This template uses a community node (@mendable/n8n-nodes-firecrawl) and cannot run on n8n Cloud.
Who itβs for
This workflow is for SEO consultants, web agencies, and technical teams who need to quickly audit or document a websiteβs URL structure and export it into a clean, hierarchical spreadsheet.
How it works
- A chat message is received containing the target website URL.
- Firecrawl maps the website via its sitemap and retrieves all available URLs.
- An IF node checks whether the Firecrawl response was successful; if not, the workflow stops with an error.
- On success, a Google Drive template file is copied to serve as the destination spreadsheet.
- A custom JavaScript node parses the crawled URLs, groups them by domain/subdomain, and structures them into a hierarchical table (up to 6 depth levels: Niv 0 to Niv 5) with HYPERLINK formulas.
- The structured rows are appended to the copied Google Sheet.
How to set up
- Connect your Firecrawl credentials with a valid API key
- Set the Google Drive template file ID to copy for each run
- Connect your Google Sheets credentials and verify the target sheet name (
FR) - Review the Organize URLs into Table Format code node if you need to adjust the depth logic or output columns
Requirements
- Self-hosted n8n instance
- Firecrawl account and API key
- Google Drive and Google Sheets OAuth2 credentials
How to customize
- Modify the JavaScript code node to add URL filtering, deduplication, or category tagging before writing to the sheet.
- Extend the sheet schema beyond 5 depth levels if your website has a deeper URL hierarchy.
- Replace the chat trigger with a form or webhook to allow non-technical users to submit URLs for crawling.
π Nodes Used
Google Sheets, Google Drive, Stop and Error, Chat Trigger
π₯ Import
Download workflow.json and import into n8n:
Workflow menu β Import from File