Quick overview
This workflow tracks SERP changes for one or more keywords by pulling top-100 organic results from a SERP API, storing snapshots in a historical database, analyzing winners/losers and SERP patterns with Anthropic Claude, and sending WhatsApp alerts and a run digest.
How it works
- Runs on a daily schedule, via a manual test run, or when a POST webhook registers a {keyword, targetDomain} to check immediately.
- Builds a processing queue from the single webhook keyword or by fetching all tracked keywords from your historical database endpoint.
- For each queued keyword, calls your SERP API to fetch up to 100 organic results and normalizes them into position, domain, URL, and title fields with a timestamp.
- Fetches the latest previous snapshot for the keyword from the historical database, diffs it against the current snapshot to detect movers/new entrants/dropouts, and saves the new snapshot back to the database.
- Shortlists the top winners and losers, then sends the movement data to Anthropic Claude to infer shared characteristics and notable changes.
- Sends Claude’s analysis plus the tracked domain’s movement back to Anthropic Claude to classify the current SERP pattern and recommend next actions.
- Sends an immediate WhatsApp alert when the tracked domain’s movement is significant, then loops to the next keyword.
- When all keywords are processed (or the per-run cap is reached), compiles a digest across all checked keywords and sends it via WhatsApp, returning the digest JSON for webhook-triggered runs.
Setup
- Create HTTP Header Auth credentials for your SERP provider API and for your historical database API, then update the SERP and database endpoint URLs in the configuration values.
- Add an Anthropic API credential (HTTP Header Auth) with your API key and confirm the model name in the configuration value.
- Add WhatsApp Business Cloud credentials in n8n and set your WhatsApp Business phone number ID and recipient phone number in the configuration values.
- Implement/prepare the historical database endpoints for tracked keywords, fetching the latest snapshot by keyword, and saving snapshots, ensuring the responses contain the keyword list and snapshot results in a compatible JSON shape.
- If using the webhook to register keywords, copy the webhook URL from n8n and configure your source system to POST {keyword, targetDomain} to it.