Nightly PostHog feature flag audit log in Google Sheets

By General Input

Every night at 11pm, capture every PostHog feature flag change in a Google Sheet, and get a Slack alert when high-risk flags get touched.

Integrations

  • PostHog
  • Google Sheets
  • Slack

Type

Deterministic Code

Categories

  • Engineering
  • Product

Every night at 11pm in my workspace timezone, run a deterministic audit of every PostHog feature flag change from the previous 24 hours, append the results to a Google Sheet, and ping Slack when a high-blast-radius flag is touched. Build this as a code workflow because every step is a fixed-schema CRUD call with no natural-language synthesis.

Trigger: cron at 23:00 daily.

Step 1. Call PostHog List Feature Flags to enumerate every active flag in the project.

Step 2. For each flag returned, call PostHog Get Feature Flag Activity Log filtered to events with a timestamp in the last 24 hours.

Step 3. For every activity entry, call Google Sheets Append Values on my "Feature Flag Audit" spreadsheet. Write one row per entry with these columns, in order: timestamp, flag key, change type (created, updated, deleted, toggled, archived), rollout percentage before, rollout percentage after, who made the change (name and email when available), and a deep link back to the flag in PostHog.

Step 4. After all rows are appended, scan the new entries for any flag whose rollout percentage moved above 50% in this run, or whose targeting now includes the all-users group. Treat these as high-blast-radius changes.

Step 5. For each high-blast-radius entry, call Slack Send a Message to the #flag-changes channel with the flag key, the user who changed it, the new rollout percentage, and the deep link back to PostHog.

If nothing changed in PostHog in the last 24 hours, the workflow should finish silently. No empty Slack post, no header-only row appended. The Google Sheet is append-only and must never overwrite or delete prior rows.

Related prompts

Explore more prompts
Call overdue Xero customers with an AI collections agentLocal listing health board for every location you manageWin back LiveChat visitors whose chats went unansweredLet support send one-off Loops emails without an engineerStop cold emails to anyone with a live deal in PipedriveCustomer lifecycle inspector for Loops, Stripe and PostHogiMessage campaign console with pre-flight checks and delivery boardChat quality review board for LiveChat support leadsLinkedIn Ads budget pacing dashboard for every client accountFront desk appointment confirmation board for the next 3 days