Index website pages in Google Search with sitemaps and Indexing API
Ready for 3.0What this workflow does
This workflow has 18 nodes and runs on a schedule (every day at 06:00) (plus 1 other trigger). It uses only n8n's built-in nodes. It also calls indexing.googleapis.com over HTTP.
How it runs
Trigger: On a schedule (every day at 06:00) (plus 1 other trigger).
- Config (Edit Fields (Set)): sets 3 fields: sitemap_url, days_back, max_urls_per_run
- Fetch root sitemap (HTTP Request): calls an HTTP API
- Parse root sitemap (XML): converts between XML and JSON
- List child sitemaps (Code): runs custom JavaScript code
- Fetch each sitemap (HTTP Request): calls an HTTP API
- Parse each sitemap (XML): converts between XML and JSON
- Extract page URLs (Code): runs custom JavaScript code
- Loop over URLs (Loop Over Items (Split in Batches)): loops over the items in batches
- Get indexing metadata (HTTP Request): calls an HTTP API
- Route by indexing status (Switch): routes items into 3 branches
…plus 5 more steps. See the full node list below.
HTTP calls to: indexing.googleapis.com
Before you upgrade to n8n 3.0
Nothing in this workflow is removed in n8n 3.0, so it should import and run after the upgrade.
- Code node: the task timeout drops from 300s to 60s. Test with a realistic data volume.
Nodes used (12)
- Schedule Trigger
n8n-nodes-base.scheduleTrigger - Manual Trigger
n8n-nodes-base.manualTrigger - Edit Fields (Set)
n8n-nodes-base.set - HTTP Request
n8n-nodes-base.httpRequest - XML
n8n-nodes-base.xml - Code
n8n-nodes-base.code - Loop Over Items (Split in Batches)
n8n-nodes-base.splitInBatches - Switch
n8n-nodes-base.switch - If
n8n-nodes-base.if - Wait
n8n-nodes-base.wait - No Operation, do nothing
n8n-nodes-base.noOp - Stop and Error
n8n-nodes-base.stopAndError
From the author
Quick overview This workflow runs on a schedule (or manually) to fetch your website’s sitemap URLs, compare each page’s last modified date with Google Indexing API metadata, and submit URLUPDATED requests for new or recently changed pages using Google OAuth2.…