Quick Overview
This workflow runs on a weekly schedule, queries Cloudflare GraphQL Analytics for requests matching known AI crawler user-agents, aggregates request counts per bot, generates a short summary with Anthropic Claude, and optionally delivers the report via SMTP email and Telegram.
How it works
- Runs on a weekly schedule at the configured hour.
- Loads your configuration (zone ID, lookback window, bot list, and notification toggles) and builds a Cloudflare GraphQL query that matches the selected AI crawler user-agents.
- Calls the Cloudflare GraphQL Analytics API to retrieve request groups for the zone within the lookback time range.
- Aggregates the results into exact request totals per tracked bot based on the returned user-agent strings.
- Sends the totals to Anthropic Claude to generate a plain-language report for the configured site and language.
- Formats the report and sends it via SMTP email and/or Telegram depending on which notification options are enabled.
Setup
- Create a Cloudflare API token with Zone → Analytics → Read for your zone and add it as an HTTP Header Auth credential (Authorization: Bearer <token>) on the Cloudflare request step.
- Add an Anthropic credential for the Claude node.
- Configure the CONFIG values, including your Cloudflare Zone ID, site name, lookback days, bot list, report language, and whether email/Telegram delivery is enabled.
- If using email, add SMTP credentials and set the recipient address in ALERT_EMAIL (and adjust the From address if your SMTP server requires a specific sender).
- If using Telegram, add a Telegram bot credential and set TELEGRAM_CHAT_ID to the destination chat or channel.