Quick Overview
This workflow runs weekly to download an XML sitemap (including sitemap indexes), checks each listed page URL for its HTTP status code, and posts a single Slack message listing any non-200 responses or a sitemap fetch failure.
How it works
- Runs every Monday at 09:00 using a schedule trigger.
- Loads the configured sitemap URL via HTTP and, if the request fails, sends a failure notice to Slack.
- Parses the sitemap XML and either extracts URLs directly from a urlset or expands a sitemap index by fetching and parsing each child sitemap.
- Splits the collected URLs into individual items and requests each page in batches of 5 with a 10-second timeout, capturing the HTTP response status.
- Filters to only pages that do not return status code 200 and aggregates them into a single list.
- Builds a summary message with the failing status codes and URLs and posts it to the selected Slack channel.
Setup
- Update the sitemap URL value in the Config step to point to your site’s sitemap.xml or sitemap index.
- Add Slack API credentials with permission to post messages (chat:write) and select the Slack channel ID to notify.
- Adjust the schedule (day/time), HTTP timeout, or batch size if needed for your site’s size and response times.