AI AGENTS

Cloudflare bandwidth spike investigator with cache-rule proposal

When Cloudflare egress bandwidth crosses a daily threshold, an agent pulls the top URLs and asset types driving the spike, identifies the worst-cached offender.

CategoryAI Agents
Enginepaperclip
Difficultyintermediate
Triggerschedule
Steps6
Setup~15 min

How it runs

The automated pipeline, trigger to output.

  • TriggerDaily scheduled bandwidth check
  • ActionFetch yesterday's egress vs baseline (Cloudflare GraphQL)CloudflareCloudflare
  • LogicExit unless egress exceeds spike threshold
  • ActionPull top URLs and content types by bytes + cache statusCloudflareCloudflare
  • ActionRank offenders and draft page ruleOpenAI
  • OutputPost root cause + proposed cache rule to SlackSlack

What it does

Watches your Cloudflare bandwidth and, when a daily spike trips, figures out exactly which route or asset is burning egress and why it's missing cache. It then writes a specific page-rule recommendation (path pattern, edge TTL, cache level) instead of a vague "check your caching" alert.

When to use it

When a surprise Cloudflare bill or bandwidth alarm shows up and you want the root-cause URL plus a ready-to-apply fix, not a dashboard you have to dig through yourself.

How it works

  1. 1A scheduled check reads yesterday's Cloudflare bandwidth via the GraphQL Analytics API and compares it to a rolling baseline.
  2. 2A logic gate exits quietly unless egress exceeds the spike threshold.
  3. 3The agent queries Cloudflare for the top URLs and content types by bytes served, plus their cache-status breakdown (HIT vs MISS/DYNAMIC).
  4. 4An OpenAI reasoning step ranks offenders by uncached bytes and drafts a precise page rule for the top one.
  5. 5The root-cause summary and proposed cache rule post to Slack for an engineer to approve.

Set it up

What you configure once, before turning it on.

  1. 1
    Connect CloudflareWorkers, Pages, R2, KV — the edge stack.
  2. 2
    Connect OpenAIModels, embeddings, files.
  3. 3
    Connect SlackChannels, DMs, threads, mentions.
  4. 4
    Set each agent's modelWe leave models unset so you pick the tier — fast + cheap, or top-quality.
  5. 5
    Tune it to your dataEdit the prompts, filters, and field mappings so it matches how your team works.
  6. 6
    Test, then turn it onRun once against a sample, confirm the output, then enable the trigger.

Run this workflow in your colony.

14-day trial. No DevOps. No Sales call. Provisioned in under a minute.