The Scenario
A data engineering team is three days into a data warehouse setup sprint. The plan: three PostHog batch exports — one to S3, one to BigQuery, one to Redshift — each with different destination configs, all needed before the sprint ends Friday. The configuration for each export is already in a Google Sheet: destination type, settings JSON, interval. The previous approach was to click through PostHog's batch export UI one export at a time, copy-paste the JSON config into each field, and save. Last sprint they did this for two exports and hit a config typo that caused 48 hours of silent failure before anyone noticed.
The bad version:
- Navigate to PostHog's batch exports section, click "New export," select destination type S3, manually enter the settings fields from the spreadsheet (bucket, region, prefix, compression), set the interval, save
- Repeat for BigQuery: pick the right credential format, paste the project ID and dataset, realize the UI field order doesn't match the JSON structure in the spreadsheet so you have to cross-reference manually
- Repeat for Redshift: save, check the config, discover you pasted the wrong port number because the Redshift and BigQuery rows in the sheet look similar and you were moving fast
Three exports, manual field-by-field entry, one typo away from 48 hours of no data flowing to the warehouse.
The Easy Way: One Prompt in SheetXAI
SheetXAI is an AI agent inside your Google Sheet. It reads the export configuration table and calls PostHog's batch export create endpoint for each row — writing the returned export UUIDs back into column D for your records.
Create a PostHog batch export for each row in the 'Export Config' sheet — destination type in column A, destination settings JSON in column B, interval in column C — and write returned export UUID into column D.
What You Get
- PostHog creates one batch export per row using the exact config from the sheet
- Column D receives the export UUID for each row — your reference for monitoring or backfill requests
- Any row that fails (invalid JSON, unsupported destination type) gets an error note in column D instead of a UUID
What If the Data Is Not Quite Ready
Destination settings are not in JSON format yet
Before creating exports, validate each value in column B is valid JSON. Write "Invalid JSON" in column D for any rows that fail JSON parsing, and skip those rows. For valid rows, create the PostHog batch export and write the returned UUID into column D.
You want to retrieve backfill history after creation
For the batch export with UUID in cell A1, retrieve all backfill runs and write start time, end time, and status for each run into the 'Backfill History' sheet starting at row 2.
You want to trigger a backfill after creating an export
Create the PostHog batch export from row 2 of the 'Export Config' sheet (S3, settings from column B, interval from column C). Write the returned UUID into column D. Then immediately trigger a backfill for that export covering the date range in cells F2 (start) and G2 (end).
Create all exports, validate they were created, and fetch initial backfill status
Create PostHog batch exports for each row in the 'Export Config' sheet. Write returned UUIDs into column D. Then for each successfully created export, fetch its current status and last event timestamp and write those into columns E and F. Mark "Inactive - check config" in column G for any export whose status is not 'Running' within 5 minutes of creation.
One prompt to create, verify, and flag anything that isn't healthy.
Try It
Get the 7-day free trial of SheetXAI and open the spreadsheet where your export configurations live, ask it to create the PostHog batch exports, and have all three running before your sprint standup. Also see: Create PostHog Warehouse Saved Queries From a Google Sheet and the PostHog hub.
