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
Stage a batch of filings overnight, then approve each completed form from a screenshot before anything is ever submitted.
Work every partner tier decision from one board, with the revenue and commission numbers, clear promotion thresholds, and AI review briefs.
Open one board at month end to find every closed deal missing a commission, every commission with no deal behind it, and every amount that does not add up.
Review every conversation Fin closed as resolved, judge which ones actually stuck, and see what the gap is worth against your bill.
Work every return, damage and warranty claim in one queue, with the order, the delivery date and a policy-backed recommendation already on screen.
See warmup status, daily send volume, and bounce risk for every sending account in one grid, with the riskiest mailboxes floating to the top.
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.