See llms.txt for all machine-readable content.

Back to Templates

Detect sitemap URL changes with HTTP and JSON diffing

Quick overview

Watch a public sitemap and emit added or removed URLs

How it works

  1. Runs when you click “Test workflow” and sets the target SITEMAP_URL plus MAX_URLS and RESET_BASELINE limits.
  2. Fetches the sitemap XML over HTTP with no authentication and continues even if the request fails.
  3. Parses the XML to extract <loc> values (handling CDATA and entities), detects whether the root is a urlset or a sitemap index, and limits the list to MAX_URLS.
  4. Compares the extracted URLs to the previously saved baseline in workflow static data and updates the baseline only if the fetch and parse succeed.
  5. Produces a single JSON result containing added[] and removed[] (or a baseline/unchanged note and any errors), and routes the output to a “changed” or “unchanged/baseline” branch based on whether differences were found.

Setup

  1. Set SITEMAP_URL to a publicly accessible sitemap.xml (urlset) or sitemap index URL.
  2. Adjust MAX_URLS to cap how many <loc> entries are processed, and set RESET_BASELINE to true only when you intentionally want to discard the stored baseline.
  3. Activate the workflow with a production trigger (for example, a Schedule trigger) if you need the baseline in workflow static data to persist reliably between runs.