SECOPS

Rotate Cloudflare API tokens on a schedule with audit logging

On a recurring schedule, mints fresh Cloudflare API tokens, revokes the prior ones after a grace window, and records every rotation to a Postgres audit table.

CategorySecOps
Enginesim
Difficultyintermediate
Triggerschedule
Steps6
Setup~15 min

How it runs

The automated pipeline, trigger to output.

  • TriggerScheduled rotation interval fires
  • ActionCreate new scoped Cloudflare tokenCloudflareCloudflare
  • ActionWrite rotation event to Postgres audit tablePostgreSQLPostgres
  • LogicWait for grace window and confirm new token active
  • ActionRevoke previous Cloudflare tokenCloudflareCloudflare
  • OutputPost rotation summary to SlackSlack

What it does

Runs a scheduled rotation of your Cloudflare API tokens. It creates a new scoped token, distributes it, then revokes the previous token after a grace period so in-flight requests do not break. Every step is written to an immutable audit table so you can prove rotation cadence during compliance reviews.

When to use it

Use it when you have long-lived Cloudflare tokens that should be cycled every 30, 60, or 90 days for SOC 2 or internal policy. Manual rotation gets skipped and forgotten; this enforces the cadence and leaves a paper trail.

How it works

  1. 1A schedule trigger fires at your chosen rotation interval.
  2. 2The flow calls Cloudflare to create a new token with the same scopes as the current one.
  3. 3It writes the new token reference and timestamp into a Postgres audit table.
  4. 4A logic step waits for the grace window, then confirms the new token is in active use.
  5. 5It revokes the old Cloudflare token.
  6. 6It posts a rotation summary to Slack for the on-call engineer.

Set it up

What you configure once, before turning it on.

  1. 1
    Connect CloudflareWorkers, Pages, R2, KV — the edge stack.
  2. 2
    Connect PostgresAny Postgres URL — query, write, migrate.
  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.