:hedgehog: PostHog is the leading platform for building self-driving products. Our developer tools – AI observability, analytics, session replay, flags, experiments, error tracking, logs, and more – capture all the context agents need to diagnose problems, uncover opportunities, and ship fixes. Steer it all from Slack, web, desktop, or the MCP.
Python ab-testingai-analyticsanalyticscdpdata-warehouseexperimentsfeature-flagsjavascriptproduct-analyticspythonreactsession-replaysurveystypescriptweb-analytics
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"properties": {
"conversion": {
"anyOf": [
{
"properties": {
"bytecode": {
"description": "Compiled server-side from 'filters'. Do not set; ignored if sent."
},
"events": {
"description": "Event-based conversion goals: [{filters: {events: [{id, name, type: 'events'}], ...}}].",
"items": {
"properties": {
"filters": {
"description": "Event/action filters for this conversion event, same shape as trigger filters: {events: [{id, name, type: 'events', properties?: [<cond>]}], actions?: [...], properties?: [<cond>]}. bytecode is compiled server-side.",
"properties": {
"actions": {
"items": {
"additionalProperties": {},
"propertyNames": {
"type": "string"
},
"type": "object"
},
"type": "array"
},
"bytecode": {},
"bytecode_contract": {
"type": "string"
},
"bytecode_error": {
"type": "string"
},
"data_warehouse": {
"items": {
"additionalProperties": {},
"propertyNames": {
"type": "string"
},
"type": "object"
},
"type": "array"
},
"events": {
"items": {
"additionalProperties": {},
"propertyNames": {
"type": "string"
},
"type": "object"
},
"type": "array"
},
"filter_test_accounts": {
"type": "boolean"
},
"properties": {
"items": {
"additionalProperties": {},
"propertyNames": {
"type": "string"
},
"type": "object"
},
"type": "array"
},
"source": {
"default": "events",
"description": "* `events` - events\n* `internal-events` - internal-events\n* `person-updates` - person-updates\n* `data-warehouse-table` - data-warehouse-table\n* `data-warehouse-view` - data-warehouse-view",
"enum": [
"events",
"internal-events",
"person-updates",
"data-warehouse-table",
"data-warehouse-view"
],
"type": "string"
},
"transpiled": {}
},
"type": "object"
}
},
"required": ["filters"],
"type": "object"
},
"type": "array"
},
"filters": {
"description": "Property-based conversion conditions, as an ARRAY of property filters: [{key, value, operator, type: event|person|group}, ...]. Event-based goals do NOT go here — put them in 'events'. Empty array = any event within the window converts.",
"items": {
"additionalProperties": {},
"propertyNames": {
"type": "string"
},
"type": "object"
},
"type": "array"
},
"window": {
"anyOf": [
{
"maxLength": 32,
"pattern": "^(?:[0-9]+(?:\\.[0-9]+)?|\\.[0-9]+)[dhms]$",
"type": "string"
},
{
"type": "null"
}
],
"description": "How long after entering the workflow a conversion still counts, as a duration string: '7d', '12h', '30m', '45s'. Same form the delay steps use. Must be longer than zero, and at most '365d'. Omit it to use the default of 90 days."
}
},
"type": "object"
},
{
"type": "null"
}
],
"description": "Conversion goal. filters: ARRAY of property conditions [{key, value, operator, type: event|person|group}]; events: event-based goals [{filters: {events: [...]}}]; window: how long after entry a conversion counts, as a duration string such as '7d' or '12h', maximum '365d'. Required for exit_on_conversion / exit_on_trigger_not_matched_or_conversion. bytecode compiled server-side."
},
"description": {
"description": "Optional description.",
"type": "string"
},
"email_sending_rate_limit": {
"anyOf": [
{
"properties": {
"count": {
"description": "Maximum number of emails this workflow sends per period.",
"maximum": 1000000,
"minimum": 1,
"type": "number"
},
"period": {
"description": "Window the count applies to. Sends over the limit are delayed until capacity frees up, not dropped.\n\n* `minute` - minute\n* `hour` - hour",
"enum": ["minute", "hour"],
"type": "string"
}
},
"required": ["count", "period"],
"type": "object"
},
{
"type": "null"
}
],
"description": "Optional email pacing for deliverability: {count, period: 'minute' | 'hour'}. The email worker spreads this workflow's sends to stay under the limit; over-limit sends wait for capacity instead of failing. Null disables pacing."
},
"exit_condition": {
"description": "exit_only_at_end: only at exit node (default). exit_on_conversion: also on conversion (needs 'conversion'; silent no-op otherwise). exit_on_trigger_not_matched: also when trigger filter stops matching. exit_on_trigger_not_matched_or_conversion: both (needs 'conversion'). Only event and cohort triggers are re-checked, so on any other trigger these two are stored as exit_only_at_end and exit_on_conversion. A cohort trigger no longer matches once the person leaves the cohort (or rejoins it, for a 'left' trigger).\n\n* `exit_on_conversion` - Conversion\n* `exit_on_trigger_not_matched` - Trigger Not Matched\n* `exit_on_trigger_not_matched_or_conversion` - Trigger Not Matched Or Conversion\n* `exit_only_at_end` - Only At End",
"enum": [
"exit_on_conversion",
"exit_on_trigger_not_matched",
"exit_on_trigger_not_matched_or_conversion",
"exit_only_at_end"
],
"type": "string"
},
"id": {
"description": "A UUID string identifying this hog flow.",
"type": "string"
},
"name": {
"anyOf": [
{
"maxLength": 400,
"type": "string"
},
{
"type": "null"
}
],
"description": "Workflow name."
},
"tags": {
"description": "Tags for organizing workflows, for example by team or use case. Tags are shared with the rest of the project. Omit to keep the current tags, send an empty list to remove them all.",
"items": {
"maxLength": 255,
"type": "string"
},
"maxItems": 10,
"type": "array"
},
"trigger_masking": {
"anyOf": [
{
"properties": {
"bytecode": {
"description": "Auto-compiled from hash. Do not set."
},
"hash": {
"description": "HogQL template defining the dedup/grouping key, e.g. '{person.id}' (once per person) within ttl.",
"type": "string"
},
"threshold": {
"anyOf": [
{
"type": "number"
},
{
"type": "null"
}
],
"description": "Fire once per N matches of the same hash within ttl — a sampler: N=3 fires on the 1st, 4th, 7th… match. Omit to fire on the first match, then suppress repeats within ttl."
},
"ttl": {
"anyOf": [
{
"maximum": 94608000,
"minimum": 60,
"type": "number"
},
{
"type": "null"
}
],
"description": "Seconds (60 to ~94M / 3y) to suppress repeat firings of the same hash."
}
},
"required": ["hash"],
"type": "object"
},
{
"type": "null"
}
],
"description": "Optional dedup/throttle on an already-matched trigger: {hash: <HogQL template>, ttl: <seconds, 60-94608000>, threshold?: <int>}. Without threshold: fire once per hash, then suppress repeats within ttl (hash '{person.id}' = once per person per ttl). With threshold N: fire once per N matches of the same hash — a sampler, the 1st then every Nth. Throttles an already-qualifying trigger; it doesn't decide who enters. Server compiles bytecode from hash; omit to disable."
},
"variables": {
"description": "Workflow vars (key, type, default). Total <5KB.",
"items": {
"additionalProperties": {
"type": "string"
},
"description": "Variable: {key, type: string|number|boolean, default}.",
"propertyNames": {
"type": "string"
},
"type": "object"
},
"type": "array"
}
},
"required": ["id"],
"type": "object"
}