Skip to content

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.

PostHog flag keyTypeWhat it switchesEnv key that answers when PostHog does not
ai-room-stagingBooleanNew paid room-staging submissions and provider attemptsAI_ROOM_STAGING_ENABLED
listing-importBooleanThe spreadsheet importer and the listing-import workerLISTING_IMPORT_ENABLED
import-ai-mappingBooleanClaude header mapping for off-template spreadsheetsIMPORT_AI_MAPPING_ENABLED
import-ai-extractionBooleanPDF / DOCX document imports and the ai-import workerIMPORT_AI_EXTRACTION_ENABLED
identity-verificationBooleanIdentity verification in the apps, its status card on the web and the identity worker (PRO-184; runbook)IDENTITY_VERIFICATION_ENABLED
native-purchase-modeMultivariate: web, checkout, hiddenHow the native apps start a purchase (PRO-110)NATIVE_PURCHASE_MODE
ai-staging-provider-modelMultivariate: flux-2-pro, flux-3-imageThe 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.

  1. 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).
  2. 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.

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:

PropertyValues
environmentThe service’s SENTRY_ENVIRONMENT (development, staging, production, local when unset)
serviceweb, 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.

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.

  1. PostHog → Feature flags → New feature flag.
  2. 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%.
  3. Release condition: environment equals the tier, rollout 100%.
  4. Save, then check a service log within a minute (next section).

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 values

Other lines to know:

Log lineMeaning
PUBLIC_POSTHOG_KEY is not set; product flags read their env valuesThe service does not poll PostHog at all.
flags request failed (…); keeping the last answers for up to 5 minPostHog is unreachable or over quota. Logged once per outage.
PostHog is answering againThe outage ended.
PostHog served a variant this build does not knowA variant key is misspelled in PostHog. The env key answers until it is fixed.
[Worker:listing-import] product flag off — worker pausedThe worker saw the flip. Jobs in flight finish, queued jobs wait.
  • 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-import and ai-import workers start the first time their flags read on. While a flag is off they are paused, /health stays 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_local has no PUBLIC_POSTHOG_KEY either, so it reads the env keys too. If the key is ever added there it polls as environment = development, because that config sets SENTRY_ENVIRONMENT=development, and it then follows the DEV rules.
  • Tests and scripts never start the poll and always read the env keys.