Product flags
Seven product behaviours are PostHog feature flags (PRO-170; identity verification joined with PRO-184). A flip in the PostHog UI reaches every running service within about a minute. No redeploy, no restart, no Doppler change.
The flags
Section titled “The flags”| PostHog flag key | Type | What it switches | Env key that answers when PostHog does not |
|---|---|---|---|
ai-room-staging | Boolean | New paid room-staging submissions and provider attempts | AI_ROOM_STAGING_ENABLED |
listing-import | Boolean | The spreadsheet importer and the listing-import worker | LISTING_IMPORT_ENABLED |
import-ai-mapping | Boolean | Claude header mapping for off-template spreadsheets | IMPORT_AI_MAPPING_ENABLED |
import-ai-extraction | Boolean | PDF / DOCX document imports and the ai-import worker | IMPORT_AI_EXTRACTION_ENABLED |
identity-verification | Boolean | Identity verification in the apps, its status card on the web and the identity worker (PRO-184; runbook) | IDENTITY_VERIFICATION_ENABLED |
native-purchase-mode | Multivariate: web, checkout, hidden | How the native apps start a purchase (PRO-110) | NATIVE_PURCHASE_MODE |
ai-staging-provider-model | Multivariate: flux-2-pro, flux-3-image | The BFL model for new staging jobs (PRO-107) | AI_STAGING_PROVIDER_MODEL |
The flag key must match exactly. For a multivariate flag the variant key is the value, so name the variants exactly as listed.
What decides a flag
Section titled “What decides a flag”- PostHog, when the flag exists there. If its release conditions do not match the service, the flag is off. A multivariate flag that is off reads as its default (
web,flux-2-pro). - The env key, when PostHog has no answer for the flag: it has not been created yet, the service has no
PUBLIC_POSTHOG_KEY, or PostHog has been unreachable for more than five minutes.
Step 2 is the first-rollout default. Nothing changes on a tier until someone creates the flag in PostHog, and from that moment the env key no longer decides there. The env fallback is planned to go away one release after the flags are live; “no answer” will then read off.
Keep each env key at the value you want during a PostHog outage. For the paid switches that is false.
Targeting a tier or a service
Section titled “Targeting a tier or a service”One PostHog project serves every tier, so a flag with a plain 100% rollout is on everywhere, production included. Each service identifies itself with two person properties:
| Property | Values |
|---|---|
environment | The service’s SENTRY_ENVIRONMENT (development, staging, production, local when unset) |
service | web, api, worker |
Add a release condition on environment to every flag. Add one on service when the order matters: the room-staging runbook turns the worker on before the producers, which is a condition service = worker first and the other two after.
The flags are evaluated for the service, not for a signed-in user. Conditions on user properties, cohorts or a percentage rollout below 100% do not split traffic. Every request from a service gets the same answer.
Creating a flag
Section titled “Creating a flag”All seven flags exist in the PostHog project (the six PRO-170 flags since 2026-11-10, identity-verification since 2026-11-20), each with one release condition for environment = development. The six PRO-170 conditions mirror the Doppler dev values; identity-verification is on for development. To bring another tier under PostHog, add a release condition for that tier to each flag before the tier gets a PUBLIC_POSTHOG_KEY: a tier that polls and matches no condition reads the switches as off and the two choices as their off values. The steps below are for recreating a flag.
- PostHog → Feature flags → New feature flag.
- Key: one from the table. For the two multivariate flags, choose “Multiple variants” and add the variant keys from the table, with the variant you want at 100%.
- Release condition:
environmentequals the tier, rollout 100%. - Save, then check a service log within a minute (next section).
Checking what a service sees
Section titled “Checking what a service sees”Each service logs one line at boot:
[product-flags] api: PostHog answers 2 of 6 flags (listing-import, native-purchase-mode); the rest read their env valuesOther lines to know:
| Log line | Meaning |
|---|---|
PUBLIC_POSTHOG_KEY is not set; product flags read their env values | The service does not poll PostHog at all. |
flags request failed (…); keeping the last answers for up to 5 min | PostHog is unreachable or over quota. Logged once per outage. |
PostHog is answering again | The outage ended. |
PostHog served a variant this build does not know | A variant key is misspelled in PostHog. The env key answers until it is fixed. |
[Worker:listing-import] product flag off — worker paused | The worker saw the flip. Jobs in flight finish, queued jobs wait. |
Behaviour worth knowing
Section titled “Behaviour worth knowing”- Latency. Each service asks PostHog once a minute on a timer. A flip takes up to a minute per service, and the three services do not switch at the same instant.
- Workers. The
listing-importandai-importworkers start the first time their flags read on. While a flag is off they are paused,/healthstays green, and queued jobs wait in Valkey until the flag is back on. - Cost. Three services at one request a minute is about 130,000 flag requests a month per tier, against PostHog’s free allowance of one million.
- Local and CI. The container stack blanks the PostHog vendor keys by default, and CI has none, so both read the env keys and stay deterministic. A workstation on Doppler
dev_localhas noPUBLIC_POSTHOG_KEYeither, so it reads the env keys too. If the key is ever added there it polls asenvironment = development, because that config setsSENTRY_ENVIRONMENT=development, and it then follows the DEV rules. - Tests and scripts never start the poll and always read the env keys.