Nightly PostHog feature flag audit log in Google Sheets
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.
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.
What does this prompt do?
- Builds an immutable, timestamped record of every PostHog feature flag change from the last 24 hours in a Google Sheet.
- Logs who changed each flag, what the rollout was before and after, and a direct link back to the flag in PostHog.
- Posts a Slack alert when a flag rolls out above 50% or starts targeting all users, so big releases never slip past the team.
- Runs every night at 11pm with no manual work or copy and paste.
What do I need to use this?
- A PostHog account with access to your feature flags.
- A Google account with edit access to the spreadsheet you want to use as the audit log.
- A Slack workspace and a channel to receive the high-risk flag alerts.
How can I customize it?
- Change the 11pm run time if a different cutoff fits your team's day better.
- Swap the Slack channel from #flag-changes to whichever channel your release or platform team watches.
- Adjust the alert threshold (default 50% rollout) or add custom rules, like alerting on any change to flags tagged production.
FAQs
Will this overwrite my existing PostHog flag history?
What happens on nights when nothing changed?
Can I track multiple PostHog projects?
What counts as a high-risk flag change?
Do I need a paid PostHog plan?
Related templates
When your flight moves, your calendar times get corrected automatically and you get a Slack note naming the meetings you're about to miss.
Every 15 minutes, forwarded phishing reports get traced back to the server that really sent them, with a verdict in Slack and the worst senders reported.
Every Monday, check every S3 bucket for public exposure, missing encryption and weak backup settings, then get the risks ranked in Slack.
Every weekday at 7am, sign in to the tender portals you track, filter new notices against your bid criteria, and open a deal for the ones worth chasing.
Every weekday at 4pm, spot the threads that went quiet, stage a ready-to-send nudge in your mailbox, and get a ranked Slack recap.
Every Monday, rank the week's matches by expected demand, put the big ones on your venue calendar, and post a rota-ready summary to Slack.
Stop guessing who shipped what.
Connect PostHog, Google Sheets, and Slack once. Geni runs the audit every night at 11pm and keeps a paper trail your whole team can search.