Skip to content

On a schedule

Get a weekly Cloudflare traffic report

Every Monday you see requests, bandwidth and blocked threats for each site, with the change from the week before.

Runs
On a schedule
Apps
Cloudflare
AI
Not needed
Access
Zone Analytics: Read

Send this to your assistant

Create a ClickRuntime automation: every Monday at 9am, email me last week's Cloudflare requests, bandwidth and threats blocked for example.com and shop.example.com, compared with the previous week.

Paste it into your assistant. It tells you what it will send or change before it runs live.

First time? Adding ClickRuntime to your assistant takes about two minutes.

Why use it

Why teams use this automation

Site owners often discover a traffic problem from a customer complaint. A bot wave inflates requests, bandwidth jumps after a viral post, or a firewall rule starts blocking real visitors, and nobody sees it because Cloudflare's analytics pages are only opened when something already seems wrong.

Every Monday, this queries Cloudflare's GraphQL analytics for the last seven days and the seven before, calculates the changes, and emails you requests, bandwidth and threats blocked for each site. The comparison with the prior week makes it obvious whether something moved.

Agencies with many client sites, and owners of a few busy ones, use it as a quick Monday health check. The figures are queried from Cloudflare's analytics for each zone, so they match what you would see in the dashboard, without opening each site to read them off.

What you get out of it

  • Notice traffic surprises on Monday morning

    A sudden 60% jump in requests or bandwidth shows up in the email on the first day of the week. You can investigate before the hosting bill or the origin server feels the strain.

  • Show that protection is working

    Threats blocked per site gives you a figure to report to clients or leadership. It demonstrates that the firewall is doing real work rather than sitting idle. You can send clients a clear figure for what the firewall stopped, which supports the case for keeping protection switched on.

  • Catch accidental blocking

    If threats blocked climb sharply while requests fall, a rule may be catching genuine visitors. That pattern is much easier to see in a weekly comparison than in a live chart. Threats blocked rising as requests fall is a classic sign of a rule catching real visitors, and the weekly comparison makes it visible.

  • Plan capacity and bandwidth costs

    Week-over-week bandwidth figures let you anticipate when you will pass a plan's allowance. You can adjust caching or upgrade before overage charges arrive. Seeing bandwidth week by week lets you predict when a plan allowance will run out, and choose caching or an upgrade in advance.

  • Report to clients without opening Cloudflare

    Agencies can forward a clean weekly email to clients who want traffic numbers. It saves exporting screenshots and keeps client reporting consistent. Agencies can forward the same tidy email to clients who ask for numbers, which saves them from screenshots and one-off exports.

How it works

What happens, step by step

  1. Every Monday at 9, ClickRuntime pulls Cloudflare traffic for each of your sites.

  2. It gets requests, bandwidth and blocked threats for the last week and the week before.

  3. It works out the percentage change for each figure.

  4. The report arrives in your inbox, one line per site.

Before it runs live

  • Connect Cloudflare

What you get

RunsOn a schedule
Get a weekly Cloudflare traffic reporttoday, 9:00Succeeded
Email · Weekly trafficexample.com: 1,284,300 requests (+8%), 42.6 GB (+5%), 1,912 threats (-12%)

Build your own

Need it to work differently?

This template is a starting point. Copy the prompt and change it, or describe a different automation from scratch, with your own conditions, more apps or an AI step. Your assistant writes it, tests it and runs it on ClickRuntime.
  • Your own rules

    Conditions, thresholds, filters and exceptions, written the way you'd explain them to a colleague.

  • Any number of apps

    One automation can read from one app and update several others. Over 248 apps are ready, and anything with an API works too.

  • AI where it helps

    Summaries, classification, extraction and drafts use ClickRuntime's built-in AI, with no extra key.

  • On a schedule or on each event

    Runs as often as every 5 minutes, or the moment an app sends an event, and keeps track of what it already handled.

Changes you can ask for

  • Run it at a different time, more or less often, or only on weekdays
  • Add an AI step, for example to summarize, sort or draft a reply
  • Add another app, for example also send it to Slack
  • Combine it with other Cloudflare steps into one automation

Under the hood

The code that runs this automation

This is the Python script that runs each time the automation starts. Your AI assistant writes it for you when you send the prompt, and you allow each step in your assistant. To change how the automation works, describe the change to your assistant and it updates the script for you. For every function it can use, see the script reference.
get_a_weekly_traffic_report.pyexample
from datetime import date, timedelta
from clickruntime import on_trigger, credentials, http, notify

CF = "https://api.cloudflare.com/client/v4"

def cf(path, **params):
    resp = http.get(f"{CF}{path}", params=params, headers={"Authorization": f"Bearer {credentials.secret('CLOUDFLARE_API_TOKEN')}"})
    resp.raise_for_status()
    return resp.json()["result"]

ZONES = ["example.com", "shop.example.com"]
QUERY = """query($zone: String!, $from: Date!, $to: Date!) { viewer { zones(filter: {zoneTag: $zone}) {
  httpRequests1dGroups(limit: 7, filter: {date_geq: $from, date_lt: $to}) { sum { requests bytes threats } } } } }"""

def week(zone_id, end):
    body = {"query": QUERY, "variables": {"zone": zone_id, "from": str(end - timedelta(days=7)), "to": str(end)}}
    resp = http.post(f"{CF}/graphql", json=body, headers={"Authorization": f"Bearer {credentials.secret('CLOUDFLARE_API_TOKEN')}"})
    days = resp.json()["data"]["viewer"]["zones"][0]["httpRequests1dGroups"]
    return {k: sum(d["sum"][k] for d in days) for k in ("requests", "bytes", "threats")}

@on_trigger
def run(event):
    today, lines = date.today(), []
    for name in ZONES:
        zone_id = cf("/zones", name=name)[0]["id"]
        cur, prev = week(zone_id, today), week(zone_id, today - timedelta(days=7))
        pct = lambda k: f"{(cur[k] - prev[k]) / prev[k] * 100:+.0f}%" if prev[k] else "n/a"
        lines.append(f"{name}: {cur['requests']:,} requests ({pct('requests')}), {cur['bytes'] / 1e9:.1f} GB ({pct('bytes')}), "
                     f"{cur['threats']:,} threats ({pct('threats')})")
    notify.email_me("Cloudflare traffic last week", "\n".join(lines))
    return {"zones": len(lines)}

FAQ

Common questions

Are the numbers per site or combined?
They are reported per site, so each zone gets its own requests, bandwidth and threats blocked, along with the change from the previous week. A combined total can be added if you ask for it. Each site gets its own figures with its own comparison, and a combined total across all sites can be added on request.
Which Cloudflare plan do I need for analytics?
The GraphQL analytics API is available to Cloudflare accounts, but the datasets and retention you can query vary by plan. Check Cloudflare's documentation if a particular metric returns empty for a zone. Plans differ in what the analytics API returns and how far back it goes, so confirm in Cloudflare's documentation if a metric looks empty.
Can it cover only certain domains?
Yes. Tell your AI assistant which zones to include, such as only production sites, and the shorter list takes effect only after you accept it. Zones you leave out are never queried, so their numbers will not appear in the email.
What permissions does it need?
Zone Analytics: Read. Nothing else in your accounts is used.
Does it need AI?
No. It runs without AI, so it doesn't use your plan's AI allowance.
How many runs does it use?
One run each time it runs (on a schedule). Checks that find nothing to do and stop right away aren't counted.
Can I change how it works?
Yes. Describe the change to your AI assistant, for example a different schedule, channel or filter. It updates the automation, tests it and tells you what changed.

Set up “Get a weekly Cloudflare traffic report” from your assistant

Copy the prompt above, or connect your assistant first. Free plan, no credit card.