IT OPS

Cloudflare Pages stale deployment sweeper with Axiom storage log

On a nightly schedule, finds Cloudflare Pages deployments older than a retention window, deletes everything except the live production build.

CategoryIT Ops
Enginesim
Difficultyintermediate
Triggerschedule
Steps5
Setup~15 min

How it runs

The automated pipeline, trigger to output.

  • TriggerNightly schedule fires the sweep
  • ActionList Pages deployments per projectCloudflareCloudflare
  • LogicFlag deployments past retention, keep live production
  • ActionDelete flagged deployments and capture freed bytesCloudflareCloudflare
  • OutputLog reclaimed storage and counts to AxiomAxiom

What it does

Cloudflare Pages keeps every preview and production build you ever shipped, and each one pins its build cache and assets. Over months that quietly bloats your account storage. This template runs nightly, lists all deployments per project, protects the current live production build plus anything inside your retention window, deletes the rest, and writes a structured reclaim record to Axiom so you can chart storage recovered over time.

When to use it

Run this when a busy Pages project accumulates hundreds of preview deployments and you want hands-off cleanup with an audit trail, without ever touching the deployment serving production traffic.

How it works

  1. 1A nightly schedule fires the sweep.
  2. 2Cloudflare returns the deployment list for each configured Pages project.
  3. 3A logic step flags deployments older than the retention window and excludes the live production alias.
  4. 4Cloudflare deletes each flagged deployment and reports freed bytes.
  5. 5The run totals reclaimed storage and deletion counts.
  6. 6Axiom ingests one structured event per run for dashboards and alerting.

Set it up

What you configure once, before turning it on.

  1. 1
    Connect CloudflareWorkers, Pages, R2, KV — the edge stack.
  2. 2
    Connect AxiomLog streams, queries, dashboards.
  3. 3
    Set each agent's modelWe leave models unset so you pick the tier — fast + cheap, or top-quality.
  4. 4
    Tune it to your dataEdit the prompts, filters, and field mappings so it matches how your team works.
  5. 5
    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.