Skip to content

: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.

331 KB
Raw Blame
{
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "properties": {
        "funnelStep": {
            "description": "Step mode only (source `funnelVizType: \"steps\"`). The 1-based index of the step to drill into.\n**Positive** lists actors who converted through that step; **negative** lists actors who dropped off at it. E.g. `2` = converted through step 2, `-2` = dropped off at step 2. The smallest negative value is `-2` (no one can drop off at the entry step).",
            "maximum": 9007199254740991,
            "minimum": -9007199254740991,
            "type": "integer"
        },
        "funnelStepBreakdown": {
            "description": "Step mode only. Scope the actors to a single breakdown series. Pass the breakdown value(s) from the matching `query-funnel` result row verbatim (an array, e.g. `[\"Chrome\"]`). Omit for the baseline (non-breakdown) series.",
            "items": {
                "type": "string"
            },
            "type": "array"
        },
        "funnelTrendsDropOff": {
            "description": "Trends-dropoff mode only (source `funnelVizType: \"trends\"`). When `true`, list the actors who dropped off; when `false`, list those who converted. Use together with `funnelTrendsEntrancePeriodStart`.",
            "type": "boolean"
        },
        "funnelTrendsEntrancePeriodStart": {
            "description": "Trends-dropoff mode only. The entrance period to drill into, as a `YYYY-MM-DD HH:mm:ss` string (e.g. `'2024-01-15 00:00:00'`), taken from the funnel-trends point the user is asking about. Use together with `funnelTrendsDropOff`.",
            "type": "string"
        },
        "includeRecordings": {
            "default": true,
            "description": "Whether to include matched session recordings for each actor.",
            "type": "boolean"
        },
        "kind": {
            "const": "FunnelsActorsQuery",
            "default": "FunnelsActorsQuery",
            "type": "string"
        },
        "limit": {
            "default": 100,
            "description": "Maximum number of persons to return in one page, from 1 to 1000. Higher values are clamped.",
            "maximum": 9007199254740991,
            "minimum": -9007199254740991,
            "type": "integer"
        },
        "offset": {
            "default": 0,
            "description": "Number of persons to skip before the returned page. Use it with `limit` to walk the whole result set: the response reports `limit`, `offset`, and `hasMore`, so when `hasMore` is true, call again with `offset` raised by `limit`.",
            "maximum": 9007199254740991,
            "minimum": -9007199254740991,
            "type": "integer"
        },
        "output_format": {
            "default": "optimized",
            "description": "Output format. \"optimized\" returns a human-readable summary from server-side formatters (recommended for analysis). \"json\" returns the raw query results as JSON.",
            "enum": ["optimized", "json"],
            "type": "string"
        },
        "source": {
            "description": "The source funnel insight query whose step (or trends point) we are drilling into.",
            "properties": {
                "aggregation_group_type_index": {
                    "description": "Use this field to define the aggregation by a specific group from the provided group mapping, which is NOT users or sessions.",
                    "maximum": 9007199254740991,
                    "minimum": -9007199254740991,
                    "type": "integer"
                },
                "breakdownFilter": {
                    "description": "A breakdown is used to segment data by a single property value. They divide all defined funnel series into multiple subseries based on the values of the property. Include a breakdown **only when it is essential to directly answer the user’s question**. You must not add a breakdown if the question can be addressed without additional segmentation. When using breakdowns, you must:\n- **Identify the property group** and name for a breakdown.\n- **Provide the property name** for a breakdown.\n- **Validate that the property value accurately reflects the intended criteria**. Examples of using a breakdown:\n- page views to sign up funnel by country: you need to find a property such as `$geoip_country_code` and set it as a breakdown.\n- conversion rate of users who have completed onboarding after signing up by an organization: you need to find a property such as `organization name` and set it as a breakdown.",
                    "properties": {
                        "breakdown": {
                            "description": "The entity property to break down by.",
                            "type": "string"
                        },
                        "breakdown_group_type_index": {
                            "anyOf": [
                                {
                                    "maximum": 9007199254740991,
                                    "minimum": -9007199254740991,
                                    "type": "integer"
                                },
                                {
                                    "type": "null"
                                }
                            ],
                            "description": "If `breakdown_type` is `group`, this is the index of the group. Use the index from the group mapping."
                        },
                        "breakdown_limit": {
                            "default": 25,
                            "description": "How many distinct values to show.",
                            "maximum": 9007199254740991,
                            "minimum": -9007199254740991,
                            "type": "integer"
                        },
                        "breakdown_type": {
                            "default": "event",
                            "description": "Type of the entity to break down by. If `group` is used, you must also provide `breakdown_group_type_index` from the group mapping.",
                            "enum": ["person", "event", "group", "session"],
                            "type": "string"
                        }
                    },
                    "required": ["breakdown"],
                    "type": "object"
                },
                "dateRange": {
                    "anyOf": [
                        {
                            "properties": {
                                "date_from": {
                                    "description": "ISO8601 date string.",
                                    "type": "string"
                                },
                                "date_to": {
                                    "anyOf": [
                                        {
                                            "type": "string"
                                        },
                                        {
                                            "type": "null"
                                        }
                                    ],
                                    "description": "ISO8601 date string. A calendar day without a time (`2026-09-01`) is inclusive to the last moment of that day."
                                }
                            },
                            "required": ["date_from"],
                            "type": "object"
                        },
                        {
                            "properties": {
                                "date_from": {
                                    "description": "Duration in the past. Supported units are: `h` (hour), `d` (day), `w` (week), `m` (month), `y` (year), `all` (all time). Use the `Start` suffix to define the exact left date boundary. Examples: `-1d` last day from now, `-180d` last 180 days from now, `mStart` this month start, `-1dStart` yesterday's start.",
                                    "type": "string"
                                }
                            },
                            "required": ["date_from"],
                            "type": "object"
                        }
                    ],
                    "description": "Date range for the query"
                },
                "filterTestAccounts": {
                    "default": false,
                    "description": "Exclude internal and test users by applying the respective filters",
                    "type": "boolean"
                },
                "funnelsFilter": {
                    "description": "Properties specific to the funnels insight",
                    "properties": {
                        "binCount": {
                            "description": "Use this setting only when `funnelVizType` is `time_to_convert`: number of bins to show in histogram.",
                            "maximum": 9007199254740991,
                            "minimum": -9007199254740991,
                            "type": "integer"
                        },
                        "breakdownAttributionType": {
                            "default": "first_touch",
                            "description": "Controls how the breakdown value is attributed to a specific step. `first_touch` - the breakdown value is the first property value found in the entire funnel. `last_touch` - the breakdown value is the last property value found in the entire funnel. `all_events` - the breakdown value must be present in all steps of the funnel. `step` - the breakdown value is the property value found at a specific step defined by `breakdownAttributionValue`.",
                            "enum": ["first_touch", "last_touch", "all_events", "step"],
                            "type": "string"
                        },
                        "breakdownAttributionValue": {
                            "description": "When `breakdownAttributionType` is `step`, this is the step number (0-indexed) to attribute the breakdown value to.",
                            "maximum": 9007199254740991,
                            "minimum": -9007199254740991,
                            "type": "integer"
                        },
                        "exclusions": {
                            "default": [],
                            "description": "Users may want to use exclusion events to filter out conversions in which a particular event occurred between specific steps. These events must not be included in the main sequence. This doesn't exclude users who have completed the event before or after the funnel sequence, but often this is what users want. (If not sure, worth clarifying.) You must include start and end indexes for each exclusion where the minimum index is one and the maximum index is the number of steps in the funnel. For example, there is a sequence with three steps: sign up, finish onboarding, purchase. If the user wants to exclude all conversions in which users left the page before finishing the onboarding, the exclusion step would be the event `$pageleave` with start index 2 and end index 3. When exclusion steps appear needed when you're planning the query, make sure to explicitly state this in the plan.",
                            "items": {
                                "properties": {
                                    "event": {
                                        "type": "string"
                                    },
                                    "funnelFromStep": {
                                        "maximum": 9007199254740991,
                                        "minimum": -9007199254740991,
                                        "type": "integer"
                                    },
                                    "funnelToStep": {
                                        "maximum": 9007199254740991,
                                        "minimum": -9007199254740991,
                                        "type": "integer"
                                    },
                                    "kind": {
                                        "const": "EventsNode",
                                        "default": "EventsNode",
                                        "type": "string"
                                    }
                                },
                                "required": ["event", "funnelFromStep", "funnelToStep"],
                                "type": "object"
                            },
                            "type": "array"
                        },
                        "funnelAggregateByHogQL": {
                            "anyOf": [
                                {
                                    "const": "properties.$session_id",
                                    "type": "string"
                                },
                                {
                                    "const": null,
                                    "type": "null"
                                }
                            ],
                            "default": null,
                            "description": "Use this field only if the user explicitly asks to aggregate the funnel by unique sessions."
                        },
                        "funnelOrderType": {
                            "default": "ordered",
                            "description": "Defines the behavior of event matching between steps. Prefer the `strict` option unless explicitly told to use a different one. `ordered` - defines a sequential funnel. Step B must happen after Step A, but any number of events can happen between A and B. `strict` - defines a funnel where all events must happen in order. Step B must happen directly after Step A without any events in between. `any` - order doesn't matter. Steps can be completed in any sequence.",
                            "enum": ["strict", "unordered", "ordered"],
                            "type": "string"
                        },
                        "funnelStepReference": {
                            "default": "total",
                            "description": "Whether conversion shown in the graph should be across all steps or just relative to the previous step.",
                            "enum": ["total", "previous"],
                            "type": "string"
                        },
                        "funnelVizType": {
                            "default": "steps",
                            "description": "Defines the type of visualization to use. `steps` - one bar per step with the conversion between them (default). Use for \"what's the conversion rate\" and \"where do users drop off\". `trends` - the conversion rate of the whole sequence as a time series. Use whenever the question is about change over time (\"is conversion improving\", \"conversion per week\", \"since we shipped X\"); a `steps` chart cannot show that. `time_to_convert` - a histogram of how long users took to complete the funnel.",
                            "enum": ["steps", "time_to_convert", "trends", "flow"],
                            "type": "string"
                        },
                        "funnelWindowInterval": {
                            "default": 14,
                            "description": "Controls a time frame value for a conversion to be considered. Select a reasonable value based on the user's query. If needed, this can be practically unlimited by setting a large value, though it's rare to need that. Use in combination with `funnelWindowIntervalUnit`. The default value is 14 days.",
                            "maximum": 9007199254740991,
                            "minimum": -9007199254740991,
                            "type": "integer"
                        },
                        "funnelWindowIntervalUnit": {
                            "default": "day",
                            "description": "Controls a time frame interval for a conversion to be considered. Select a reasonable value based on the user's query. Use in combination with `funnelWindowInterval`. The default value is 14 days.",
                            "enum": ["second", "minute", "hour", "day", "week", "month"],
                            "type": "string"
                        },
                        "layout": {
                            "default": "vertical",
                            "description": "Controls how the funnel chart is displayed: vertically (preferred) or horizontally.",
                            "enum": ["horizontal", "vertical"],
                            "type": "string"
                        }
                    },
                    "type": "object"
                },
                "interval": {
                    "description": "Granularity of the response. Can be one of `hour`, `day`, `week` or `month`",
                    "enum": ["second", "minute", "hour", "day", "week", "month", "quarter", "year"],
                    "type": "string"
                },
                "kind": {
                    "const": "FunnelsQuery",
                    "default": "FunnelsQuery",
                    "type": "string"
                },
                "properties": {
                    "default": [],
                    "description": "Property filters for all series",
                    "items": {
                        "anyOf": [
                            {
                                "anyOf": [
                                    {
                                        "anyOf": [
                                            {
                                                "properties": {
                                                    "key": {
                                                        "description": "Use one of the properties the user has provided in the plan.",
                                                        "type": "string"
                                                    },
                                                    "operator": {
                                                        "description": "`icontains` - case insensitive contains. `not_icontains` - case insensitive does not contain. `regex` - matches the regex pattern. `not_regex` - does not match the regex pattern.",
                                                        "enum": [
                                                            "exact",
                                                            "is_not",
                                                            "icontains",
                                                            "not_icontains",
                                                            "regex",
                                                            "not_regex"
                                                        ],
                                                        "type": "string"
                                                    },
                                                    "type": {
                                                        "enum": ["event", "person", "session", "feature"],
                                                        "type": "string"
                                                    },
                                                    "value": {
                                                        "description": "Only use property values from the plan. If the operator is `regex` or `not_regex`, the value must be a valid ClickHouse regex pattern to match against. Otherwise, the value must be a substring that will be matched against the property value. Use the string values `true` or `false` for boolean properties.",
                                                        "type": "string"
                                                    }
                                                },
                                                "required": ["key", "operator", "type", "value"],
                                                "type": "object"
                                            },
                                            {
                                                "properties": {
                                                    "key": {
                                                        "description": "Use one of the properties the user has provided in the plan.",
                                                        "type": "string"
                                                    },
                                                    "operator": {
                                                        "enum": ["exact", "gt", "lt"],
                                                        "type": "string"
                                                    },
                                                    "type": {
                                                        "enum": ["event", "person", "session", "feature"],
                                                        "type": "string"
                                                    },
                                                    "value": {
                                                        "type": "number"
                                                    }
                                                },
                                                "required": ["key", "operator", "type", "value"],
                                                "type": "object"
                                            },
                                            {
                                                "properties": {
                                                    "key": {
                                                        "description": "Use one of the properties the user has provided in the plan.",
                                                        "type": "string"
                                                    },
                                                    "operator": {
                                                        "description": "`exact` - exact match of any of the values. `is_not` - does not match any of the values.",
                                                        "enum": ["exact", "is_not"],
                                                        "type": "string"
                                                    },
                                                    "type": {
                                                        "enum": ["event", "person", "session", "feature"],
                                                        "type": "string"
                                                    },
                                                    "value": {
                                                        "description": "Only use property values from the plan. Always use strings as values. If you have a number, convert it to a string first. If you have a boolean, convert it to a string \"true\" or \"false\".",
                                                        "items": {
                                                            "type": "string"
                                                        },
                                                        "type": "array"
                                                    }
                                                },
                                                "required": ["key", "operator", "type", "value"],
                                                "type": "object"
                                            },
                                            {
                                                "properties": {
                                                    "key": {
                                                        "description": "Use one of the properties the user has provided in the plan.",
                                                        "type": "string"
                                                    },
                                                    "operator": {
                                                        "enum": ["is_date_exact", "is_date_before", "is_date_after"],
                                                        "type": "string"
                                                    },
                                                    "type": {
                                                        "enum": ["event", "person", "session", "feature"],
                                                        "type": "string"
                                                    },
                                                    "value": {
                                                        "description": "Value must be a date in ISO 8601 format.",
                                                        "type": "string"
                                                    }
                                                },
                                                "required": ["key", "operator", "type", "value"],
                                                "type": "object"
                                            },
                                            {
                                                "properties": {
                                                    "key": {
                                                        "description": "Use one of the properties the user has provided in the plan.",
                                                        "type": "string"
                                                    },
                                                    "operator": {
                                                        "description": "`is_set` - the property has any value. `is_not_set` - the property doesn't have a value or wasn't collected.",
                                                        "enum": ["is_set", "is_not_set"],
                                                        "type": "string"
                                                    },
                                                    "type": {
                                                        "enum": ["event", "person", "session", "feature"],
                                                        "type": "string"
                                                    }
                                                },
                                                "required": ["key", "operator", "type"],
                                                "type": "object"
                                            }
                                        ]
                                    },
                                    {
                                        "anyOf": [
                                            {
                                                "properties": {
                                                    "group_type_index": {
                                                        "description": "Index of the group type from the group mapping.",
                                                        "maximum": 9007199254740991,
                                                        "minimum": -9007199254740991,
                                                        "type": "integer"
                                                    },
                                                    "key": {
                                                        "description": "Use one of the properties the user has provided in the plan.",
                                                        "type": "string"
                                                    },
                                                    "operator": {
                                                        "description": "`icontains` - case insensitive contains. `not_icontains` - case insensitive does not contain. `regex` - matches the regex pattern. `not_regex` - does not match the regex pattern.",
                                                        "enum": [
                                                            "exact",
                                                            "is_not",
                                                            "icontains",
                                                            "not_icontains",
                                                            "regex",
                                                            "not_regex"
                                                        ],
                                                        "type": "string"
                                                    },
                                                    "type": {
                                                        "const": "group",
                                                        "default": "group",
                                                        "type": "string"
                                                    },
                                                    "value": {
                                                        "description": "Only use property values from the plan. If the operator is `regex` or `not_regex`, the value must be a valid ClickHouse regex pattern to match against. Otherwise, the value must be a substring that will be matched against the property value. Use the string values `true` or `false` for boolean properties.",
                                                        "type": "string"
                                                    }
                                                },
                                                "required": ["group_type_index", "key", "operator", "value"],
                                                "type": "object"
                                            },
                                            {
                                                "properties": {
                                                    "group_type_index": {
                                                        "description": "Index of the group type from the group mapping.",
                                                        "maximum": 9007199254740991,
                                                        "minimum": -9007199254740991,
                                                        "type": "integer"
                                                    },
                                                    "key": {
                                                        "description": "Use one of the properties the user has provided in the plan.",
                                                        "type": "string"
                                                    },
                                                    "operator": {
                                                        "enum": ["exact", "gt", "lt"],
                                                        "type": "string"
                                                    },
                                                    "type": {
                                                        "const": "group",
                                                        "default": "group",
                                                        "type": "string"
                                                    },
                                                    "value": {
                                                        "type": "number"
                                                    }
                                                },
                                                "required": ["group_type_index", "key", "operator", "value"],
                                                "type": "object"
                                            },
                                            {
                                                "properties": {
                                                    "group_type_index": {
                                                        "description": "Index of the group type from the group mapping.",
                                                        "maximum": 9007199254740991,
                                                        "minimum": -9007199254740991,
                                                        "type": "integer"
                                                    },
                                                    "key": {
                                                        "description": "Use one of the properties the user has provided in the plan.",
                                                        "type": "string"
                                                    },
                                                    "operator": {
                                                        "description": "`exact` - exact match of any of the values. `is_not` - does not match any of the values.",
                                                        "enum": ["exact", "is_not"],
                                                        "type": "string"
                                                    },
                                                    "type": {
                                                        "const": "group",
                                                        "default": "group",
                                                        "type": "string"
                                                    },
                                                    "value": {
                                                        "description": "Only use property values from the plan. Always use strings as values. If you have a number, convert it to a string first. If you have a boolean, convert it to a string \"true\" or \"false\".",
                                                        "items": {
                                                            "type": "string"
                                                        },
                                                        "type": "array"
                                                    }
                                                },
                                                "required": ["group_type_index", "key", "operator", "value"],
                                                "type": "object"
                                            },
                                            {
                                                "properties": {
                                                    "group_type_index": {
                                                        "description": "Index of the group type from the group mapping.",
                                                        "maximum": 9007199254740991,
                                                        "minimum": -9007199254740991,
                                                        "type": "integer"
                                                    },
                                                    "key": {
                                                        "description": "Use one of the properties the user has provided in the plan.",
                                                        "type": "string"
                                                    },
                                                    "operator": {
                                                        "enum": ["is_date_exact", "is_date_before", "is_date_after"],
                                                        "type": "string"
                                                    },
                                                    "type": {
                                                        "const": "group",
                                                        "default": "group",
                                                        "type": "string"
                                                    },
                                                    "value": {
                                                        "description": "Value must be a date in ISO 8601 format.",
                                                        "type": "string"
                                                    }
                                                },
                                                "required": ["group_type_index", "key", "operator", "value"],
                                                "type": "object"
                                            },
                                            {
                                                "properties": {
                                                    "group_type_index": {
                                                        "description": "Index of the group type from the group mapping.",
                                                        "maximum": 9007199254740991,
                                                        "minimum": -9007199254740991,
                                                        "type": "integer"
                                                    },
                                                    "key": {
                                                        "description": "Use one of the properties the user has provided in the plan.",
                                                        "type": "string"
                                                    },
                                                    "operator": {
                                                        "description": "`is_set` - the property has any value. `is_not_set` - the property doesn't have a value or wasn't collected.",
                                                        "enum": ["is_set", "is_not_set"],
                                                        "type": "string"
                                                    },
                                                    "type": {
                                                        "const": "group",
                                                        "default": "group",
                                                        "type": "string"
                                                    }
                                                },
                                                "required": ["group_type_index", "key", "operator"],
                                                "type": "object"
                                            }
                                        ]
                                    },
                                    {
                                        "properties": {
                                            "key": {
                                                "const": "id",
                                                "default": "id",
                                                "type": "string"
                                            },
                                            "operator": {
                                                "default": "in",
                                                "enum": ["in", "not_in"],
                                                "type": "string"
                                            },
                                            "type": {
                                                "const": "cohort",
                                                "default": "cohort",
                                                "description": "Filter events by cohort membership. Use this to narrow down results to persons belonging to a specific cohort. Use `operator: \"in\"` to include cohort members, or `operator: \"not_in\"` to exclude them. Examples:\n- Include: `{ type: \"cohort\", key: \"id\", value: 42, operator: \"in\" }`\n- Exclude: `{ type: \"cohort\", key: \"id\", value: 42, operator: \"not_in\" }`",
                                                "type": "string"
                                            },
                                            "value": {
                                                "description": "The cohort ID to filter by.",
                                                "maximum": 9007199254740991,
                                                "minimum": -9007199254740991,
                                                "type": "integer"
                                            }
                                        },
                                        "required": ["value"],
                                        "type": "object"
                                    },
                                    {
                                        "anyOf": [
                                            {
                                                "properties": {
                                                    "key": {
                                                        "description": "The element property to filter on. `tag_name` — HTML tag (e.g., `button`, `a`, `input`). `text` — visible text content of the element. `href` — the `href` attribute for links. `selector` — a CSS selector matching the element (e.g., `div.main > button.cta`).",
                                                        "enum": ["tag_name", "text", "href", "selector"],
                                                        "type": "string"
                                                    },
                                                    "operator": {
                                                        "description": "`icontains` - case insensitive contains. `not_icontains` - case insensitive does not contain. `regex` - matches the regex pattern. `not_regex` - does not match the regex pattern.",
                                                        "enum": [
                                                            "exact",
                                                            "is_not",
                                                            "icontains",
                                                            "not_icontains",
                                                            "regex",
                                                            "not_regex"
                                                        ],
                                                        "type": "string"
                                                    },
                                                    "type": {
                                                        "const": "element",
                                                        "default": "element",
                                                        "description": "Filter by autocaptured HTML element properties (`$autocapture`, `$rageclick`). Example: `{ type: \"element\", key: \"text\", value: \"Sign Up\", operator: \"exact\" }`",
                                                        "type": "string"
                                                    },
                                                    "value": {
                                                        "description": "Only use property values from the plan. If the operator is `regex` or `not_regex`, the value must be a valid ClickHouse regex pattern to match against. Otherwise, the value must be a substring that will be matched against the property value. Use the string values `true` or `false` for boolean properties.",
                                                        "type": "string"
                                                    }
                                                },
                                                "required": ["key", "operator", "value"],
                                                "type": "object"
                                            },
                                            {
                                                "properties": {
                                                    "key": {
                                                        "description": "The element property to filter on. `tag_name` — HTML tag (e.g., `button`, `a`, `input`). `text` — visible text content of the element. `href` — the `href` attribute for links. `selector` — a CSS selector matching the element (e.g., `div.main > button.cta`).",
                                                        "enum": ["tag_name", "text", "href", "selector"],
                                                        "type": "string"
                                                    },
                                                    "operator": {
                                                        "enum": ["exact", "gt", "lt"],
                                                        "type": "string"
                                                    },
                                                    "type": {
                                                        "const": "element",
                                                        "default": "element",
                                                        "description": "Filter by autocaptured HTML element properties (`$autocapture`, `$rageclick`). Example: `{ type: \"element\", key: \"text\", value: \"Sign Up\", operator: \"exact\" }`",
                                                        "type": "string"
                                                    },
                                                    "value": {
                                                        "type": "number"
                                                    }
                                                },
                                                "required": ["key", "operator", "value"],
                                                "type": "object"
                                            },
                                            {
                                                "properties": {
                                                    "key": {
                                                        "description": "The element property to filter on. `tag_name` — HTML tag (e.g., `button`, `a`, `input`). `text` — visible text content of the element. `href` — the `href` attribute for links. `selector` — a CSS selector matching the element (e.g., `div.main > button.cta`).",
                                                        "enum": ["tag_name", "text", "href", "selector"],
                                                        "type": "string"
                                                    },
                                                    "operator": {
                                                        "description": "`exact` - exact match of any of the values. `is_not` - does not match any of the values.",
                                                        "enum": ["exact", "is_not"],
                                                        "type": "string"
                                                    },
                                                    "type": {
                                                        "const": "element",
                                                        "default": "element",
                                                        "description": "Filter by autocaptured HTML element properties (`$autocapture`, `$rageclick`). Example: `{ type: \"element\", key: \"text\", value: \"Sign Up\", operator: \"exact\" }`",
                                                        "type": "string"
                                                    },
                                                    "value": {
                                                        "description": "Only use property values from the plan. Always use strings as values. If you have a number, convert it to a string first. If you have a boolean, convert it to a string \"true\" or \"false\".",
                                                        "items": {
                                                            "type": "string"
                                                        },
                                                        "type": "array"
                                                    }
                                                },
                                                "required": ["key", "operator", "value"],
                                                "type": "object"
                                            },
                                            {
                                                "properties": {
                                                    "key": {
                                                        "description": "The element property to filter on. `tag_name` — HTML tag (e.g., `button`, `a`, `input`). `text` — visible text content of the element. `href` — the `href` attribute for links. `selector` — a CSS selector matching the element (e.g., `div.main > button.cta`).",
                                                        "enum": ["tag_name", "text", "href", "selector"],
                                                        "type": "string"
                                                    },
                                                    "operator": {
                                                        "enum": ["is_date_exact", "is_date_before", "is_date_after"],
                                                        "type": "string"
                                                    },
                                                    "type": {
                                                        "const": "element",
                                                        "default": "element",
                                                        "description": "Filter by autocaptured HTML element properties (`$autocapture`, `$rageclick`). Example: `{ type: \"element\", key: \"text\", value: \"Sign Up\", operator: \"exact\" }`",
                                                        "type": "string"
                                                    },
                                                    "value": {
                                                        "description": "Value must be a date in ISO 8601 format.",
                                                        "type": "string"
                                                    }
                                                },
                                                "required": ["key", "operator", "value"],
                                                "type": "object"
                                            },
                                            {
                                                "properties": {
                                                    "key": {
                                                        "description": "The element property to filter on. `tag_name` — HTML tag (e.g., `button`, `a`, `input`). `text` — visible text content of the element. `href` — the `href` attribute for links. `selector` — a CSS selector matching the element (e.g., `div.main > button.cta`).",
                                                        "enum": ["tag_name", "text", "href", "selector"],
                                                        "type": "string"
                                                    },
                                                    "operator": {
                                                        "description": "`is_set` - the property has any value. `is_not_set` - the property doesn't have a value or wasn't collected.",
                                                        "enum": ["is_set", "is_not_set"],
                                                        "type": "string"
                                                    },
                                                    "type": {
                                                        "const": "element",
                                                        "default": "element",
                                                        "description": "Filter by autocaptured HTML element properties (`$autocapture`, `$rageclick`). Example: `{ type: \"element\", key: \"text\", value: \"Sign Up\", operator: \"exact\" }`",
                                                        "type": "string"
                                                    }
                                                },
                                                "required": ["key", "operator"],
                                                "type": "object"
                                            }
                                        ]
                                    },
                                    {
                                        "properties": {
                                            "key": {
                                                "description": "A HogQL boolean expression used as a filter condition.\n\nExamples:\n- Filter where a property exceeds a threshold: `toFloat(properties.load_time) > 5.0`\n- Filter with string matching: `properties.$current_url LIKE '%/pricing%'`\n- Filter with multiple conditions: `properties.$browser = 'Chrome' AND toFloat(properties.duration) > 30`",
                                                "type": "string"
                                            },
                                            "type": {
                                                "const": "hogql",
                                                "default": "hogql",
                                                "description": "Filter by a HogQL boolean expression for advanced filtering that can't be expressed with standard property filters.",
                                                "type": "string"
                                            }
                                        },
                                        "required": ["key"],
                                        "type": "object"
                                    },
                                    {
                                        "properties": {
                                            "key": {
                                                "description": "The feature flag key.",
                                                "type": "string"
                                            },
                                            "operator": {
                                                "const": "flag_evaluates_to",
                                                "default": "flag_evaluates_to",
                                                "type": "string"
                                            },
                                            "type": {
                                                "const": "flag",
                                                "default": "flag",
                                                "description": "Filter events by feature flag state — only include events where a specific flag evaluated to a given value. Examples:\n- Flag enabled: `{ type: \"flag\", key: \"new-onboarding\", operator: \"flag_evaluates_to\", value: true }`\n- Specific variant: `{ type: \"flag\", key: \"checkout-experiment\", operator: \"flag_evaluates_to\", value: \"variant-a\" }`",
                                                "type": "string"
                                            },
                                            "value": {
                                                "anyOf": [
                                                    {
                                                        "type": "boolean"
                                                    },
                                                    {
                                                        "type": "string"
                                                    }
                                                ],
                                                "description": "`true`/`false` for boolean flags, or a variant name string for multivariate flags."
                                            }
                                        },
                                        "required": ["key", "value"],
                                        "type": "object"
                                    }
                                ]
                            },
                            {
                                "properties": {
                                    "event_filters": {
                                        "description": "Extra property filters the matching events must satisfy. Deliberately excludes nested behavioral/cohort filters and groups",
                                        "items": {
                                            "anyOf": [
                                                {
                                                    "properties": {
                                                        "key": {
                                                            "type": "string"
                                                        },
                                                        "label": {
                                                            "type": "string"
                                                        },
                                                        "operator": {
                                                            "default": "exact",
                                                            "enum": [
                                                                "exact",
                                                                "is_not",
                                                                "icontains",
                                                                "not_icontains",
                                                                "starts_with",
                                                                "not_starts_with",
                                                                "ends_with",
                                                                "not_ends_with",
                                                                "regex",
                                                                "not_regex",
                                                                "gt",
                                                                "gte",
                                                                "lt",
                                                                "lte",
                                                                "is_set",
                                                                "is_not_set",
                                                                "is_date_exact",
                                                                "is_date_before",
                                                                "is_date_after",
                                                                "between",
                                                                "not_between",
                                                                "min",
                                                                "max",
                                                                "in",
                                                                "not_in",
                                                                "is_cleaned_path_exact",
                                                                "is_cleaned_path_not_exact",
                                                                "flag_evaluates_to",
                                                                "semver_eq",
                                                                "semver_neq",
                                                                "semver_gt",
                                                                "semver_gte",
                                                                "semver_lt",
                                                                "semver_lte",
                                                                "semver_tilde",
                                                                "semver_caret",
                                                                "semver_wildcard",
                                                                "icontains_multi",
                                                                "not_icontains_multi"
                                                            ],
                                                            "type": "string"
                                                        },
                                                        "type": {
                                                            "const": "event",
                                                            "default": "event",
                                                            "description": "Event properties",
                                                            "type": "string"
                                                        },
                                                        "value": {
                                                            "anyOf": [
                                                                {
                                                                    "anyOf": [
                                                                        {
                                                                            "type": "string"
                                                                        },
                                                                        {
                                                                            "type": "number"
                                                                        },
                                                                        {
                                                                            "type": "boolean"
                                                                        }
                                                                    ]
                                                                },
                                                                {
                                                                    "items": {
                                                                        "anyOf": [
                                                                            {
                                                                                "type": "string"
                                                                            },
                                                                            {
                                                                                "type": "number"
                                                                            },
                                                                            {
                                                                                "type": "boolean"
                                                                            }
                                                                        ]
                                                                    },
                                                                    "type": "array"
                                                                },
                                                                {
                                                                    "type": "null"
                                                                }
                                                            ]
                                                        }
                                                    },
                                                    "required": ["key"],
                                                    "type": "object"
                                                },
                                                {
                                                    "properties": {
                                                        "key": {
                                                            "type": "string"
                                                        },
                                                        "label": {
                                                            "type": "string"
                                                        },
                                                        "operator": {
                                                            "enum": [
                                                                "exact",
                                                                "is_not",
                                                                "icontains",
                                                                "not_icontains",
                                                                "starts_with",
                                                                "not_starts_with",
                                                                "ends_with",
                                                                "not_ends_with",
                                                                "regex",
                                                                "not_regex",
                                                                "gt",
                                                                "gte",
                                                                "lt",
                                                                "lte",
                                                                "is_set",
                                                                "is_not_set",
                                                                "is_date_exact",
                                                                "is_date_before",
                                                                "is_date_after",
                                                                "between",
                                                                "not_between",
                                                                "min",
                                                                "max",
                                                                "in",
                                                                "not_in",
                                                                "is_cleaned_path_exact",
                                                                "is_cleaned_path_not_exact",
                                                                "flag_evaluates_to",
                                                                "semver_eq",
                                                                "semver_neq",
                                                                "semver_gt",
                                                                "semver_gte",
                                                                "semver_lt",
                                                                "semver_lte",
                                                                "semver_tilde",
                                                                "semver_caret",
                                                                "semver_wildcard",
                                                                "icontains_multi",
                                                                "not_icontains_multi"
                                                            ],
                                                            "type": "string"
                                                        },
                                                        "type": {
                                                            "const": "person",
                                                            "default": "person",
                                                            "description": "Person properties",
                                                            "type": "string"
                                                        },
                                                        "value": {
                                                            "anyOf": [
                                                                {
                                                                    "anyOf": [
                                                                        {
                                                                            "type": "string"
                                                                        },
                                                                        {
                                                                            "type": "number"
                                                                        },
                                                                        {
                                                                            "type": "boolean"
                                                                        }
                                                                    ]
                                                                },
                                                                {
                                                                    "items": {
                                                                        "anyOf": [
                                                                            {
                                                                                "type": "string"
                                                                            },
                                                                            {
                                                                                "type": "number"
                                                                            },
                                                                            {
                                                                                "type": "boolean"
                                                                            }
                                                                        ]
                                                                    },
                                                                    "type": "array"
                                                                },
                                                                {
                                                                    "type": "null"
                                                                }
                                                            ]
                                                        }
                                                    },
                                                    "required": ["key", "operator"],
                                                    "type": "object"
                                                },
                                                {
                                                    "properties": {
                                                        "key": {
                                                            "enum": ["tag_name", "text", "href", "selector"],
                                                            "type": "string"
                                                        },
                                                        "label": {
                                                            "type": "string"
                                                        },
                                                        "operator": {
                                                            "enum": [
                                                                "exact",
                                                                "is_not",
                                                                "icontains",
                                                                "not_icontains",
                                                                "starts_with",
                                                                "not_starts_with",
                                                                "ends_with",
                                                                "not_ends_with",
                                                                "regex",
                                                                "not_regex",
                                                                "gt",
                                                                "gte",
                                                                "lt",
                                                                "lte",
                                                                "is_set",
                                                                "is_not_set",
                                                                "is_date_exact",
                                                                "is_date_before",
                                                                "is_date_after",
                                                                "between",
                                                                "not_between",
                                                                "min",
                                                                "max",
                                                                "in",
                                                                "not_in",
                                                                "is_cleaned_path_exact",
                                                                "is_cleaned_path_not_exact",
                                                                "flag_evaluates_to",
                                                                "semver_eq",
                                                                "semver_neq",
                                                                "semver_gt",
                                                                "semver_gte",
                                                                "semver_lt",
                                                                "semver_lte",
                                                                "semver_tilde",
                                                                "semver_caret",
                                                                "semver_wildcard",
                                                                "icontains_multi",
                                                                "not_icontains_multi"
                                                            ],
                                                            "type": "string"
                                                        },
                                                        "type": {
                                                            "const": "element",
                                                            "default": "element",
                                                            "type": "string"
                                                        },
                                                        "value": {
                                                            "anyOf": [
                                                                {
                                                                    "anyOf": [
                                                                        {
                                                                            "type": "string"
                                                                        },
                                                                        {
                                                                            "type": "number"
                                                                        },
                                                                        {
                                                                            "type": "boolean"
                                                                        }
                                                                    ]
                                                                },
                                                                {
                                                                    "items": {
                                                                        "anyOf": [
                                                                            {
                                                                                "type": "string"
                                                                            },
                                                                            {
                                                                                "type": "number"
                                                                            },
                                                                            {
                                                                                "type": "boolean"
                                                                            }
                                                                        ]
                                                                    },
                                                                    "type": "array"
                                                                },
                                                                {
                                                                    "type": "null"
                                                                }
                                                            ]
                                                        }
                                                    },
                                                    "required": ["key", "operator"],
                                                    "type": "object"
                                                },
                                                {
                                                    "properties": {
                                                        "key": {
                                                            "type": "string"
                                                        },
                                                        "label": {
                                                            "type": "string"
                                                        },
                                                        "operator": {
                                                            "enum": [
                                                                "exact",
                                                                "is_not",
                                                                "icontains",
                                                                "not_icontains",
                                                                "starts_with",
                                                                "not_starts_with",
                                                                "ends_with",
                                                                "not_ends_with",
                                                                "regex",
                                                                "not_regex",
                                                                "gt",
                                                                "gte",
                                                                "lt",
                                                                "lte",
                                                                "is_set",
                                                                "is_not_set",
                                                                "is_date_exact",
                                                                "is_date_before",
                                                                "is_date_after",
                                                                "between",
                                                                "not_between",
                                                                "min",
                                                                "max",
                                                                "in",
                                                                "not_in",
                                                                "is_cleaned_path_exact",
                                                                "is_cleaned_path_not_exact",
                                                                "flag_evaluates_to",
                                                                "semver_eq",
                                                                "semver_neq",
                                                                "semver_gt",
                                                                "semver_gte",
                                                                "semver_lt",
                                                                "semver_lte",
                                                                "semver_tilde",
                                                                "semver_caret",
                                                                "semver_wildcard",
                                                                "icontains_multi",
                                                                "not_icontains_multi"
                                                            ],
                                                            "type": "string"
                                                        },
                                                        "type": {
                                                            "const": "feature",
                                                            "default": "feature",
                                                            "description": "Event property with \"$feature/\" prepended",
                                                            "type": "string"
                                                        },
                                                        "value": {
                                                            "anyOf": [
                                                                {
                                                                    "anyOf": [
                                                                        {
                                                                            "type": "string"
                                                                        },
                                                                        {
                                                                            "type": "number"
                                                                        },
                                                                        {
                                                                            "type": "boolean"
                                                                        }
                                                                    ]
                                                                },
                                                                {
                                                                    "items": {
                                                                        "anyOf": [
                                                                            {
                                                                                "type": "string"
                                                                            },
                                                                            {
                                                                                "type": "number"
                                                                            },
                                                                            {
                                                                                "type": "boolean"
                                                                            }
                                                                        ]
                                                                    },
                                                                    "type": "array"
                                                                },
                                                                {
                                                                    "type": "null"
                                                                }
                                                            ]
                                                        }
                                                    },
                                                    "required": ["key", "operator"],
                                                    "type": "object"
                                                },
                                                {
                                                    "properties": {
                                                        "key": {
                                                            "type": "string"
                                                        },
                                                        "label": {
                                                            "type": "string"
                                                        },
                                                        "type": {
                                                            "const": "hogql",
                                                            "default": "hogql",
                                                            "type": "string"
                                                        },
                                                        "value": {
                                                            "anyOf": [
                                                                {
                                                                    "anyOf": [
                                                                        {
                                                                            "type": "string"
                                                                        },
                                                                        {
                                                                            "type": "number"
                                                                        },
                                                                        {
                                                                            "type": "boolean"
                                                                        }
                                                                    ]
                                                                },
                                                                {
                                                                    "items": {
                                                                        "anyOf": [
                                                                            {
                                                                                "type": "string"
                                                                            },
                                                                            {
                                                                                "type": "number"
                                                                            },
                                                                            {
                                                                                "type": "boolean"
                                                                            }
                                                                        ]
                                                                    },
                                                                    "type": "array"
                                                                },
                                                                {
                                                                    "type": "null"
                                                                }
                                                            ]
                                                        }
                                                    },
                                                    "required": ["key"],
                                                    "type": "object"
                                                }
                                            ]
                                        },
                                        "type": "array"
                                    },
                                    "event_type": {
                                        "enum": ["events", "actions"],
                                        "type": "string"
                                    },
                                    "explicit_datetime": {
                                        "description": "Absolute or relative (e.g. -30d) lower date bound — alternative to time_value/time_interval",
                                        "type": "string"
                                    },
                                    "explicit_datetime_to": {
                                        "type": "string"
                                    },
                                    "key": {
                                        "description": "Event name, or action id when event_type is 'actions'",
                                        "type": "string"
                                    },
                                    "label": {
                                        "type": "string"
                                    },
                                    "negation": {
                                        "description": "Match persons who did NOT satisfy the criterion. Not the same as a low count — zero-occurrence persons never match count operators",
                                        "type": "boolean"
                                    },
                                    "operator": {
                                        "enum": ["exact", "gt", "gte", "lt", "lte"],
                                        "type": "string"
                                    },
                                    "operator_value": {
                                        "description": "Count threshold for performed_event_multiple",
                                        "maximum": 9007199254740991,
                                        "minimum": -9007199254740991,
                                        "type": "integer"
                                    },
                                    "time_interval": {
                                        "enum": ["day", "week", "month", "year"],
                                        "type": "string"
                                    },
                                    "time_value": {
                                        "description": "Relative time window size, paired with time_interval",
                                        "maximum": 9007199254740991,
                                        "minimum": -9007199254740991,
                                        "type": "integer"
                                    },
                                    "type": {
                                        "const": "behavioral",
                                        "default": "behavioral",
                                        "description": "Person performed (or didn't perform) an event in a time window. ClickHouse-only — not evaluable by flags or CDP",
                                        "type": "string"
                                    },
                                    "value": {
                                        "enum": ["performed_event", "performed_event_multiple"],
                                        "type": "string"
                                    }
                                },
                                "required": ["event_type", "key", "value"],
                                "type": "object"
                            }
                        ]
                    },
                    "type": "array"
                },
                "series": {
                    "description": "Events or actions to include. Prioritize the more popular and fresh events and actions.",
                    "items": {
                        "anyOf": [
                            {
                                "properties": {
                                    "custom_name": {
                                        "description": "Optional custom name for the event if it is needed to be renamed.",
                                        "type": "string"
                                    },
                                    "event": {
                                        "description": "Name of the event.",
                                        "type": "string"
                                    },
                                    "kind": {
                                        "const": "EventsNode",
                                        "default": "EventsNode",
                                        "type": "string"
                                    },
                                    "math": {
                                        "description": "Optional math aggregation type for the series. `total` is the default stored on saved funnels and can be preserved when rerunning one. `first_time_for_user` - counts the number of users who have completed the event for the first time ever. `first_time_for_user_with_filters` - counts the number of users who have completed the event with specified filters for the first time.",
                                        "enum": ["total", "first_time_for_user", "first_time_for_user_with_filters"],
                                        "type": "string"
                                    },
                                    "optionalInFunnel": {
                                        "default": false,
                                        "description": "If true, this step can be skipped without breaking the funnel — conversion between the surrounding required steps still counts even if this step didn't happen. Set this when the user asks for a non-required, skippable, or optional step in the funnel. Do not set it on the first or last step (those must be required).",
                                        "type": "boolean"
                                    },
                                    "properties": {
                                        "items": {
                                            "anyOf": [
                                                {
                                                    "anyOf": [
                                                        {
                                                            "properties": {
                                                                "key": {
                                                                    "description": "Use one of the properties the user has provided in the plan.",
                                                                    "type": "string"
                                                                },
                                                                "operator": {
                                                                    "description": "`icontains` - case insensitive contains. `not_icontains` - case insensitive does not contain. `regex` - matches the regex pattern. `not_regex` - does not match the regex pattern.",
                                                                    "enum": [
                                                                        "exact",
                                                                        "is_not",
                                                                        "icontains",
                                                                        "not_icontains",
                                                                        "regex",
                                                                        "not_regex"
                                                                    ],
                                                                    "type": "string"
                                                                },
                                                                "type": {
                                                                    "enum": ["event", "person", "session", "feature"],
                                                                    "type": "string"
                                                                },
                                                                "value": {
                                                                    "description": "Only use property values from the plan. If the operator is `regex` or `not_regex`, the value must be a valid ClickHouse regex pattern to match against. Otherwise, the value must be a substring that will be matched against the property value. Use the string values `true` or `false` for boolean properties.",
                                                                    "type": "string"
                                                                }
                                                            },
                                                            "required": ["key", "operator", "type", "value"],
                                                            "type": "object"
                                                        },
                                                        {
                                                            "properties": {
                                                                "key": {
                                                                    "description": "Use one of the properties the user has provided in the plan.",
                                                                    "type": "string"
                                                                },
                                                                "operator": {
                                                                    "enum": ["exact", "gt", "lt"],
                                                                    "type": "string"
                                                                },
                                                                "type": {
                                                                    "enum": ["event", "person", "session", "feature"],
                                                                    "type": "string"
                                                                },
                                                                "value": {
                                                                    "type": "number"
                                                                }
                                                            },
                                                            "required": ["key", "operator", "type", "value"],
                                                            "type": "object"
                                                        },
                                                        {
                                                            "properties": {
                                                                "key": {
                                                                    "description": "Use one of the properties the user has provided in the plan.",
                                                                    "type": "string"
                                                                },
                                                                "operator": {
                                                                    "description": "`exact` - exact match of any of the values. `is_not` - does not match any of the values.",
                                                                    "enum": ["exact", "is_not"],
                                                                    "type": "string"
                                                                },
                                                                "type": {
                                                                    "enum": ["event", "person", "session", "feature"],
                                                                    "type": "string"
                                                                },
                                                                "value": {
                                                                    "description": "Only use property values from the plan. Always use strings as values. If you have a number, convert it to a string first. If you have a boolean, convert it to a string \"true\" or \"false\".",
                                                                    "items": {
                                                                        "type": "string"
                                                                    },
                                                                    "type": "array"
                                                                }
                                                            },
                                                            "required": ["key", "operator", "type", "value"],
                                                            "type": "object"
                                                        },
                                                        {
                                                            "properties": {
                                                                "key": {
                                                                    "description": "Use one of the properties the user has provided in the plan.",
                                                                    "type": "string"
                                                                },
                                                                "operator": {
                                                                    "enum": [
                                                                        "is_date_exact",
                                                                        "is_date_before",
                                                                        "is_date_after"
                                                                    ],
                                                                    "type": "string"
                                                                },
                                                                "type": {
                                                                    "enum": ["event", "person", "session", "feature"],
                                                                    "type": "string"
                                                                },
                                                                "value": {
                                                                    "description": "Value must be a date in ISO 8601 format.",
                                                                    "type": "string"
                                                                }
                                                            },
                                                            "required": ["key", "operator", "type", "value"],
                                                            "type": "object"
                                                        },
                                                        {
                                                            "properties": {
                                                                "key": {
                                                                    "description": "Use one of the properties the user has provided in the plan.",
                                                                    "type": "string"
                                                                },
                                                                "operator": {
                                                                    "description": "`is_set` - the property has any value. `is_not_set` - the property doesn't have a value or wasn't collected.",
                                                                    "enum": ["is_set", "is_not_set"],
                                                                    "type": "string"
                                                                },
                                                                "type": {
                                                                    "enum": ["event", "person", "session", "feature"],
                                                                    "type": "string"
                                                                }
                                                            },
                                                            "required": ["key", "operator", "type"],
                                                            "type": "object"
                                                        }
                                                    ]
                                                },
                                                {
                                                    "anyOf": [
                                                        {
                                                            "properties": {
                                                                "group_type_index": {
                                                                    "description": "Index of the group type from the group mapping.",
                                                                    "maximum": 9007199254740991,
                                                                    "minimum": -9007199254740991,
                                                                    "type": "integer"
                                                                },
                                                                "key": {
                                                                    "description": "Use one of the properties the user has provided in the plan.",
                                                                    "type": "string"
                                                                },
                                                                "operator": {
                                                                    "description": "`icontains` - case insensitive contains. `not_icontains` - case insensitive does not contain. `regex` - matches the regex pattern. `not_regex` - does not match the regex pattern.",
                                                                    "enum": [
                                                                        "exact",
                                                                        "is_not",
                                                                        "icontains",
                                                                        "not_icontains",
                                                                        "regex",
                                                                        "not_regex"
                                                                    ],
                                                                    "type": "string"
                                                                },
                                                                "type": {
                                                                    "const": "group",
                                                                    "default": "group",
                                                                    "type": "string"
                                                                },
                                                                "value": {
                                                                    "description": "Only use property values from the plan. If the operator is `regex` or `not_regex`, the value must be a valid ClickHouse regex pattern to match against. Otherwise, the value must be a substring that will be matched against the property value. Use the string values `true` or `false` for boolean properties.",
                                                                    "type": "string"
                                                                }
                                                            },
                                                            "required": [
                                                                "group_type_index",
                                                                "key",
                                                                "operator",
                                                                "value"
                                                            ],
                                                            "type": "object"
                                                        },
                                                        {
                                                            "properties": {
                                                                "group_type_index": {
                                                                    "description": "Index of the group type from the group mapping.",
                                                                    "maximum": 9007199254740991,
                                                                    "minimum": -9007199254740991,
                                                                    "type": "integer"
                                                                },
                                                                "key": {
                                                                    "description": "Use one of the properties the user has provided in the plan.",
                                                                    "type": "string"
                                                                },
                                                                "operator": {
                                                                    "enum": ["exact", "gt", "lt"],
                                                                    "type": "string"
                                                                },
                                                                "type": {
                                                                    "const": "group",
                                                                    "default": "group",
                                                                    "type": "string"
                                                                },
                                                                "value": {
                                                                    "type": "number"
                                                                }
                                                            },
                                                            "required": [
                                                                "group_type_index",
                                                                "key",
                                                                "operator",
                                                                "value"
                                                            ],
                                                            "type": "object"
                                                        },
                                                        {
                                                            "properties": {
                                                                "group_type_index": {
                                                                    "description": "Index of the group type from the group mapping.",
                                                                    "maximum": 9007199254740991,
                                                                    "minimum": -9007199254740991,
                                                                    "type": "integer"
                                                                },
                                                                "key": {
                                                                    "description": "Use one of the properties the user has provided in the plan.",
                                                                    "type": "string"
                                                                },
                                                                "operator": {
                                                                    "description": "`exact` - exact match of any of the values. `is_not` - does not match any of the values.",
                                                                    "enum": ["exact", "is_not"],
                                                                    "type": "string"
                                                                },
                                                                "type": {
                                                                    "const": "group",
                                                                    "default": "group",
                                                                    "type": "string"
                                                                },
                                                                "value": {
                                                                    "description": "Only use property values from the plan. Always use strings as values. If you have a number, convert it to a string first. If you have a boolean, convert it to a string \"true\" or \"false\".",
                                                                    "items": {
                                                                        "type": "string"
                                                                    },
                                                                    "type": "array"
                                                                }
                                                            },
                                                            "required": [
                                                                "group_type_index",
                                                                "key",
                                                                "operator",
                                                                "value"
                                                            ],
                                                            "type": "object"
                                                        },
                                                        {
                                                            "properties": {
                                                                "group_type_index": {
                                                                    "description": "Index of the group type from the group mapping.",
                                                                    "maximum": 9007199254740991,
                                                                    "minimum": -9007199254740991,
                                                                    "type": "integer"
                                                                },
                                                                "key": {
                                                                    "description": "Use one of the properties the user has provided in the plan.",
                                                                    "type": "string"
                                                                },
                                                                "operator": {
                                                                    "enum": [
                                                                        "is_date_exact",
                                                                        "is_date_before",
                                                                        "is_date_after"
                                                                    ],
                                                                    "type": "string"
                                                                },
                                                                "type": {
                                                                    "const": "group",
                                                                    "default": "group",
                                                                    "type": "string"
                                                                },
                                                                "value": {
                                                                    "description": "Value must be a date in ISO 8601 format.",
                                                                    "type": "string"
                                                                }
                                                            },
                                                            "required": [
                                                                "group_type_index",
                                                                "key",
                                                                "operator",
                                                                "value"
                                                            ],
                                                            "type": "object"
                                                        },
                                                        {
                                                            "properties": {
                                                                "group_type_index": {
                                                                    "description": "Index of the group type from the group mapping.",
                                                                    "maximum": 9007199254740991,
                                                                    "minimum": -9007199254740991,
                                                                    "type": "integer"
                                                                },
                                                                "key": {
                                                                    "description": "Use one of the properties the user has provided in the plan.",
                                                                    "type": "string"
                                                                },
                                                                "operator": {
                                                                    "description": "`is_set` - the property has any value. `is_not_set` - the property doesn't have a value or wasn't collected.",
                                                                    "enum": ["is_set", "is_not_set"],
                                                                    "type": "string"
                                                                },
                                                                "type": {
                                                                    "const": "group",
                                                                    "default": "group",
                                                                    "type": "string"
                                                                }
                                                            },
                                                            "required": ["group_type_index", "key", "operator"],
                                                            "type": "object"
                                                        }
                                                    ]
                                                },
                                                {
                                                    "properties": {
                                                        "key": {
                                                            "const": "id",
                                                            "default": "id",
                                                            "type": "string"
                                                        },
                                                        "operator": {
                                                            "default": "in",
                                                            "enum": ["in", "not_in"],
                                                            "type": "string"
                                                        },
                                                        "type": {
                                                            "const": "cohort",
                                                            "default": "cohort",
                                                            "description": "Filter events by cohort membership. Use this to narrow down results to persons belonging to a specific cohort. Use `operator: \"in\"` to include cohort members, or `operator: \"not_in\"` to exclude them. Examples:\n- Include: `{ type: \"cohort\", key: \"id\", value: 42, operator: \"in\" }`\n- Exclude: `{ type: \"cohort\", key: \"id\", value: 42, operator: \"not_in\" }`",
                                                            "type": "string"
                                                        },
                                                        "value": {
                                                            "description": "The cohort ID to filter by.",
                                                            "maximum": 9007199254740991,
                                                            "minimum": -9007199254740991,
                                                            "type": "integer"
                                                        }
                                                    },
                                                    "required": ["value"],
                                                    "type": "object"
                                                },
                                                {
                                                    "anyOf": [
                                                        {
                                                            "properties": {
                                                                "key": {
                                                                    "description": "The element property to filter on. `tag_name` — HTML tag (e.g., `button`, `a`, `input`). `text` — visible text content of the element. `href` — the `href` attribute for links. `selector` — a CSS selector matching the element (e.g., `div.main > button.cta`).",
                                                                    "enum": ["tag_name", "text", "href", "selector"],
                                                                    "type": "string"
                                                                },
                                                                "operator": {
                                                                    "description": "`icontains` - case insensitive contains. `not_icontains` - case insensitive does not contain. `regex` - matches the regex pattern. `not_regex` - does not match the regex pattern.",
                                                                    "enum": [
                                                                        "exact",
                                                                        "is_not",
                                                                        "icontains",
                                                                        "not_icontains",
                                                                        "regex",
                                                                        "not_regex"
                                                                    ],
                                                                    "type": "string"
                                                                },
                                                                "type": {
                                                                    "const": "element",
                                                                    "default": "element",
                                                                    "description": "Filter by autocaptured HTML element properties (`$autocapture`, `$rageclick`). Example: `{ type: \"element\", key: \"text\", value: \"Sign Up\", operator: \"exact\" }`",
                                                                    "type": "string"
                                                                },
                                                                "value": {
                                                                    "description": "Only use property values from the plan. If the operator is `regex` or `not_regex`, the value must be a valid ClickHouse regex pattern to match against. Otherwise, the value must be a substring that will be matched against the property value. Use the string values `true` or `false` for boolean properties.",
                                                                    "type": "string"
                                                                }
                                                            },
                                                            "required": ["key", "operator", "value"],
                                                            "type": "object"
                                                        },
                                                        {
                                                            "properties": {
                                                                "key": {
                                                                    "description": "The element property to filter on. `tag_name` — HTML tag (e.g., `button`, `a`, `input`). `text` — visible text content of the element. `href` — the `href` attribute for links. `selector` — a CSS selector matching the element (e.g., `div.main > button.cta`).",
                                                                    "enum": ["tag_name", "text", "href", "selector"],
                                                                    "type": "string"
                                                                },
                                                                "operator": {
                                                                    "enum": ["exact", "gt", "lt"],
                                                                    "type": "string"
                                                                },
                                                                "type": {
                                                                    "const": "element",
                                                                    "default": "element",
                                                                    "description": "Filter by autocaptured HTML element properties (`$autocapture`, `$rageclick`). Example: `{ type: \"element\", key: \"text\", value: \"Sign Up\", operator: \"exact\" }`",
                                                                    "type": "string"
                                                                },
                                                                "value": {
                                                                    "type": "number"
                                                                }
                                                            },
                                                            "required": ["key", "operator", "value"],
                                                            "type": "object"
                                                        },
                                                        {
                                                            "properties": {
                                                                "key": {
                                                                    "description": "The element property to filter on. `tag_name` — HTML tag (e.g., `button`, `a`, `input`). `text` — visible text content of the element. `href` — the `href` attribute for links. `selector` — a CSS selector matching the element (e.g., `div.main > button.cta`).",
                                                                    "enum": ["tag_name", "text", "href", "selector"],
                                                                    "type": "string"
                                                                },
                                                                "operator": {
                                                                    "description": "`exact` - exact match of any of the values. `is_not` - does not match any of the values.",
                                                                    "enum": ["exact", "is_not"],
                                                                    "type": "string"
                                                                },
                                                                "type": {
                                                                    "const": "element",
                                                                    "default": "element",
                                                                    "description": "Filter by autocaptured HTML element properties (`$autocapture`, `$rageclick`). Example: `{ type: \"element\", key: \"text\", value: \"Sign Up\", operator: \"exact\" }`",
                                                                    "type": "string"
                                                                },
                                                                "value": {
                                                                    "description": "Only use property values from the plan. Always use strings as values. If you have a number, convert it to a string first. If you have a boolean, convert it to a string \"true\" or \"false\".",
                                                                    "items": {
                                                                        "type": "string"
                                                                    },
                                                                    "type": "array"
                                                                }
                                                            },
                                                            "required": ["key", "operator", "value"],
                                                            "type": "object"
                                                        },
                                                        {
                                                            "properties": {
                                                                "key": {
                                                                    "description": "The element property to filter on. `tag_name` — HTML tag (e.g., `button`, `a`, `input`). `text` — visible text content of the element. `href` — the `href` attribute for links. `selector` — a CSS selector matching the element (e.g., `div.main > button.cta`).",
                                                                    "enum": ["tag_name", "text", "href", "selector"],
                                                                    "type": "string"
                                                                },
                                                                "operator": {
                                                                    "enum": [
                                                                        "is_date_exact",
                                                                        "is_date_before",
                                                                        "is_date_after"
                                                                    ],
                                                                    "type": "string"
                                                                },
                                                                "type": {
                                                                    "const": "element",
                                                                    "default": "element",
                                                                    "description": "Filter by autocaptured HTML element properties (`$autocapture`, `$rageclick`). Example: `{ type: \"element\", key: \"text\", value: \"Sign Up\", operator: \"exact\" }`",
                                                                    "type": "string"
                                                                },
                                                                "value": {
                                                                    "description": "Value must be a date in ISO 8601 format.",
                                                                    "type": "string"
                                                                }
                                                            },
                                                            "required": ["key", "operator", "value"],
                                                            "type": "object"
                                                        },
                                                        {
                                                            "properties": {
                                                                "key": {
                                                                    "description": "The element property to filter on. `tag_name` — HTML tag (e.g., `button`, `a`, `input`). `text` — visible text content of the element. `href` — the `href` attribute for links. `selector` — a CSS selector matching the element (e.g., `div.main > button.cta`).",
                                                                    "enum": ["tag_name", "text", "href", "selector"],
                                                                    "type": "string"
                                                                },
                                                                "operator": {
                                                                    "description": "`is_set` - the property has any value. `is_not_set` - the property doesn't have a value or wasn't collected.",
                                                                    "enum": ["is_set", "is_not_set"],
                                                                    "type": "string"
                                                                },
                                                                "type": {
                                                                    "const": "element",
                                                                    "default": "element",
                                                                    "description": "Filter by autocaptured HTML element properties (`$autocapture`, `$rageclick`). Example: `{ type: \"element\", key: \"text\", value: \"Sign Up\", operator: \"exact\" }`",
                                                                    "type": "string"
                                                                }
                                                            },
                                                            "required": ["key", "operator"],
                                                            "type": "object"
                                                        }
                                                    ]
                                                },
                                                {
                                                    "properties": {
                                                        "key": {
                                                            "description": "A HogQL boolean expression used as a filter condition.\n\nExamples:\n- Filter where a property exceeds a threshold: `toFloat(properties.load_time) > 5.0`\n- Filter with string matching: `properties.$current_url LIKE '%/pricing%'`\n- Filter with multiple conditions: `properties.$browser = 'Chrome' AND toFloat(properties.duration) > 30`",
                                                            "type": "string"
                                                        },
                                                        "type": {
                                                            "const": "hogql",
                                                            "default": "hogql",
                                                            "description": "Filter by a HogQL boolean expression for advanced filtering that can't be expressed with standard property filters.",
                                                            "type": "string"
                                                        }
                                                    },
                                                    "required": ["key"],
                                                    "type": "object"
                                                },
                                                {
                                                    "properties": {
                                                        "key": {
                                                            "description": "The feature flag key.",
                                                            "type": "string"
                                                        },
                                                        "operator": {
                                                            "const": "flag_evaluates_to",
                                                            "default": "flag_evaluates_to",
                                                            "type": "string"
                                                        },
                                                        "type": {
                                                            "const": "flag",
                                                            "default": "flag",
                                                            "description": "Filter events by feature flag state — only include events where a specific flag evaluated to a given value. Examples:\n- Flag enabled: `{ type: \"flag\", key: \"new-onboarding\", operator: \"flag_evaluates_to\", value: true }`\n- Specific variant: `{ type: \"flag\", key: \"checkout-experiment\", operator: \"flag_evaluates_to\", value: \"variant-a\" }`",
                                                            "type": "string"
                                                        },
                                                        "value": {
                                                            "anyOf": [
                                                                {
                                                                    "type": "boolean"
                                                                },
                                                                {
                                                                    "type": "string"
                                                                }
                                                            ],
                                                            "description": "`true`/`false` for boolean flags, or a variant name string for multivariate flags."
                                                        }
                                                    },
                                                    "required": ["key", "value"],
                                                    "type": "object"
                                                }
                                            ]
                                        },
                                        "type": "array"
                                    },
                                    "version": {
                                        "description": "version of the node, used for schema migrations",
                                        "type": "number"
                                    }
                                },
                                "required": ["event"],
                                "type": "object"
                            },
                            {
                                "properties": {
                                    "id": {
                                        "description": "Action ID from the plan.",
                                        "type": "number"
                                    },
                                    "kind": {
                                        "const": "ActionsNode",
                                        "default": "ActionsNode",
                                        "type": "string"
                                    },
                                    "math": {
                                        "description": "Optional math aggregation type for the series. `total` is the default stored on saved funnels and can be preserved when rerunning one. `first_time_for_user` - counts the number of users who have completed the event for the first time ever. `first_time_for_user_with_filters` - counts the number of users who have completed the event with specified filters for the first time.",
                                        "enum": ["total", "first_time_for_user", "first_time_for_user_with_filters"],
                                        "type": "string"
                                    },
                                    "name": {
                                        "description": "Action name from the plan.",
                                        "type": "string"
                                    },
                                    "optionalInFunnel": {
                                        "default": false,
                                        "description": "If true, this step can be skipped without breaking the funnel — conversion between the surrounding required steps still counts even if this step didn't happen. Set this when the user asks for a non-required, skippable, or optional step in the funnel. Do not set it on the first or last step (those must be required).",
                                        "type": "boolean"
                                    },
                                    "properties": {
                                        "items": {
                                            "anyOf": [
                                                {
                                                    "anyOf": [
                                                        {
                                                            "properties": {
                                                                "key": {
                                                                    "description": "Use one of the properties the user has provided in the plan.",
                                                                    "type": "string"
                                                                },
                                                                "operator": {
                                                                    "description": "`icontains` - case insensitive contains. `not_icontains` - case insensitive does not contain. `regex` - matches the regex pattern. `not_regex` - does not match the regex pattern.",
                                                                    "enum": [
                                                                        "exact",
                                                                        "is_not",
                                                                        "icontains",
                                                                        "not_icontains",
                                                                        "regex",
                                                                        "not_regex"
                                                                    ],
                                                                    "type": "string"
                                                                },
                                                                "type": {
                                                                    "enum": ["event", "person", "session", "feature"],
                                                                    "type": "string"
                                                                },
                                                                "value": {
                                                                    "description": "Only use property values from the plan. If the operator is `regex` or `not_regex`, the value must be a valid ClickHouse regex pattern to match against. Otherwise, the value must be a substring that will be matched against the property value. Use the string values `true` or `false` for boolean properties.",
                                                                    "type": "string"
                                                                }
                                                            },
                                                            "required": ["key", "operator", "type", "value"],
                                                            "type": "object"
                                                        },
                                                        {
                                                            "properties": {
                                                                "key": {
                                                                    "description": "Use one of the properties the user has provided in the plan.",
                                                                    "type": "string"
                                                                },
                                                                "operator": {
                                                                    "enum": ["exact", "gt", "lt"],
                                                                    "type": "string"
                                                                },
                                                                "type": {
                                                                    "enum": ["event", "person", "session", "feature"],
                                                                    "type": "string"
                                                                },
                                                                "value": {
                                                                    "type": "number"
                                                                }
                                                            },
                                                            "required": ["key", "operator", "type", "value"],
                                                            "type": "object"
                                                        },
                                                        {
                                                            "properties": {
                                                                "key": {
                                                                    "description": "Use one of the properties the user has provided in the plan.",
                                                                    "type": "string"
                                                                },
                                                                "operator": {
                                                                    "description": "`exact` - exact match of any of the values. `is_not` - does not match any of the values.",
                                                                    "enum": ["exact", "is_not"],
                                                                    "type": "string"
                                                                },
                                                                "type": {
                                                                    "enum": ["event", "person", "session", "feature"],
                                                                    "type": "string"
                                                                },
                                                                "value": {
                                                                    "description": "Only use property values from the plan. Always use strings as values. If you have a number, convert it to a string first. If you have a boolean, convert it to a string \"true\" or \"false\".",
                                                                    "items": {
                                                                        "type": "string"
                                                                    },
                                                                    "type": "array"
                                                                }
                                                            },
                                                            "required": ["key", "operator", "type", "value"],
                                                            "type": "object"
                                                        },
                                                        {
                                                            "properties": {
                                                                "key": {
                                                                    "description": "Use one of the properties the user has provided in the plan.",
                                                                    "type": "string"
                                                                },
                                                                "operator": {
                                                                    "enum": [
                                                                        "is_date_exact",
                                                                        "is_date_before",
                                                                        "is_date_after"
                                                                    ],
                                                                    "type": "string"
                                                                },
                                                                "type": {
                                                                    "enum": ["event", "person", "session", "feature"],
                                                                    "type": "string"
                                                                },
                                                                "value": {
                                                                    "description": "Value must be a date in ISO 8601 format.",
                                                                    "type": "string"
                                                                }
                                                            },
                                                            "required": ["key", "operator", "type", "value"],
                                                            "type": "object"
                                                        },
                                                        {
                                                            "properties": {
                                                                "key": {
                                                                    "description": "Use one of the properties the user has provided in the plan.",
                                                                    "type": "string"
                                                                },
                                                                "operator": {
                                                                    "description": "`is_set` - the property has any value. `is_not_set` - the property doesn't have a value or wasn't collected.",
                                                                    "enum": ["is_set", "is_not_set"],
                                                                    "type": "string"
                                                                },
                                                                "type": {
                                                                    "enum": ["event", "person", "session", "feature"],
                                                                    "type": "string"
                                                                }
                                                            },
                                                            "required": ["key", "operator", "type"],
                                                            "type": "object"
                                                        }
                                                    ]
                                                },
                                                {
                                                    "anyOf": [
                                                        {
                                                            "properties": {
                                                                "group_type_index": {
                                                                    "description": "Index of the group type from the group mapping.",
                                                                    "maximum": 9007199254740991,
                                                                    "minimum": -9007199254740991,
                                                                    "type": "integer"
                                                                },
                                                                "key": {
                                                                    "description": "Use one of the properties the user has provided in the plan.",
                                                                    "type": "string"
                                                                },
                                                                "operator": {
                                                                    "description": "`icontains` - case insensitive contains. `not_icontains` - case insensitive does not contain. `regex` - matches the regex pattern. `not_regex` - does not match the regex pattern.",
                                                                    "enum": [
                                                                        "exact",
                                                                        "is_not",
                                                                        "icontains",
                                                                        "not_icontains",
                                                                        "regex",
                                                                        "not_regex"
                                                                    ],
                                                                    "type": "string"
                                                                },
                                                                "type": {
                                                                    "const": "group",
                                                                    "default": "group",
                                                                    "type": "string"
                                                                },
                                                                "value": {
                                                                    "description": "Only use property values from the plan. If the operator is `regex` or `not_regex`, the value must be a valid ClickHouse regex pattern to match against. Otherwise, the value must be a substring that will be matched against the property value. Use the string values `true` or `false` for boolean properties.",
                                                                    "type": "string"
                                                                }
                                                            },
                                                            "required": [
                                                                "group_type_index",
                                                                "key",
                                                                "operator",
                                                                "value"
                                                            ],
                                                            "type": "object"
                                                        },
                                                        {
                                                            "properties": {
                                                                "group_type_index": {
                                                                    "description": "Index of the group type from the group mapping.",
                                                                    "maximum": 9007199254740991,
                                                                    "minimum": -9007199254740991,
                                                                    "type": "integer"
                                                                },
                                                                "key": {
                                                                    "description": "Use one of the properties the user has provided in the plan.",
                                                                    "type": "string"
                                                                },
                                                                "operator": {
                                                                    "enum": ["exact", "gt", "lt"],
                                                                    "type": "string"
                                                                },
                                                                "type": {
                                                                    "const": "group",
                                                                    "default": "group",
                                                                    "type": "string"
                                                                },
                                                                "value": {
                                                                    "type": "number"
                                                                }
                                                            },
                                                            "required": [
                                                                "group_type_index",
                                                                "key",
                                                                "operator",
                                                                "value"
                                                            ],
                                                            "type": "object"
                                                        },
                                                        {
                                                            "properties": {
                                                                "group_type_index": {
                                                                    "description": "Index of the group type from the group mapping.",
                                                                    "maximum": 9007199254740991,
                                                                    "minimum": -9007199254740991,
                                                                    "type": "integer"
                                                                },
                                                                "key": {
                                                                    "description": "Use one of the properties the user has provided in the plan.",
                                                                    "type": "string"
                                                                },
                                                                "operator": {
                                                                    "description": "`exact` - exact match of any of the values. `is_not` - does not match any of the values.",
                                                                    "enum": ["exact", "is_not"],
                                                                    "type": "string"
                                                                },
                                                                "type": {
                                                                    "const": "group",
                                                                    "default": "group",
                                                                    "type": "string"
                                                                },
                                                                "value": {
                                                                    "description": "Only use property values from the plan. Always use strings as values. If you have a number, convert it to a string first. If you have a boolean, convert it to a string \"true\" or \"false\".",
                                                                    "items": {
                                                                        "type": "string"
                                                                    },
                                                                    "type": "array"
                                                                }
                                                            },
                                                            "required": [
                                                                "group_type_index",
                                                                "key",
                                                                "operator",
                                                                "value"
                                                            ],
                                                            "type": "object"
                                                        },
                                                        {
                                                            "properties": {
                                                                "group_type_index": {
                                                                    "description": "Index of the group type from the group mapping.",
                                                                    "maximum": 9007199254740991,
                                                                    "minimum": -9007199254740991,
                                                                    "type": "integer"
                                                                },
                                                                "key": {
                                                                    "description": "Use one of the properties the user has provided in the plan.",
                                                                    "type": "string"
                                                                },
                                                                "operator": {
                                                                    "enum": [
                                                                        "is_date_exact",
                                                                        "is_date_before",
                                                                        "is_date_after"
                                                                    ],
                                                                    "type": "string"
                                                                },
                                                                "type": {
                                                                    "const": "group",
                                                                    "default": "group",
                                                                    "type": "string"
                                                                },
                                                                "value": {
                                                                    "description": "Value must be a date in ISO 8601 format.",
                                                                    "type": "string"
                                                                }
                                                            },
                                                            "required": [
                                                                "group_type_index",
                                                                "key",
                                                                "operator",
                                                                "value"
                                                            ],
                                                            "type": "object"
                                                        },
                                                        {
                                                            "properties": {
                                                                "group_type_index": {
                                                                    "description": "Index of the group type from the group mapping.",
                                                                    "maximum": 9007199254740991,
                                                                    "minimum": -9007199254740991,
                                                                    "type": "integer"
                                                                },
                                                                "key": {
                                                                    "description": "Use one of the properties the user has provided in the plan.",
                                                                    "type": "string"
                                                                },
                                                                "operator": {
                                                                    "description": "`is_set` - the property has any value. `is_not_set` - the property doesn't have a value or wasn't collected.",
                                                                    "enum": ["is_set", "is_not_set"],
                                                                    "type": "string"
                                                                },
                                                                "type": {
                                                                    "const": "group",
                                                                    "default": "group",
                                                                    "type": "string"
                                                                }
                                                            },
                                                            "required": ["group_type_index", "key", "operator"],
                                                            "type": "object"
                                                        }
                                                    ]
                                                },
                                                {
                                                    "properties": {
                                                        "key": {
                                                            "const": "id",
                                                            "default": "id",
                                                            "type": "string"
                                                        },
                                                        "operator": {
                                                            "default": "in",
                                                            "enum": ["in", "not_in"],
                                                            "type": "string"
                                                        },
                                                        "type": {
                                                            "const": "cohort",
                                                            "default": "cohort",
                                                            "description": "Filter events by cohort membership. Use this to narrow down results to persons belonging to a specific cohort. Use `operator: \"in\"` to include cohort members, or `operator: \"not_in\"` to exclude them. Examples:\n- Include: `{ type: \"cohort\", key: \"id\", value: 42, operator: \"in\" }`\n- Exclude: `{ type: \"cohort\", key: \"id\", value: 42, operator: \"not_in\" }`",
                                                            "type": "string"
                                                        },
                                                        "value": {
                                                            "description": "The cohort ID to filter by.",
                                                            "maximum": 9007199254740991,
                                                            "minimum": -9007199254740991,
                                                            "type": "integer"
                                                        }
                                                    },
                                                    "required": ["value"],
                                                    "type": "object"
                                                },
                                                {
                                                    "anyOf": [
                                                        {
                                                            "properties": {
                                                                "key": {
                                                                    "description": "The element property to filter on. `tag_name` — HTML tag (e.g., `button`, `a`, `input`). `text` — visible text content of the element. `href` — the `href` attribute for links. `selector` — a CSS selector matching the element (e.g., `div.main > button.cta`).",
                                                                    "enum": ["tag_name", "text", "href", "selector"],
                                                                    "type": "string"
                                                                },
                                                                "operator": {
                                                                    "description": "`icontains` - case insensitive contains. `not_icontains` - case insensitive does not contain. `regex` - matches the regex pattern. `not_regex` - does not match the regex pattern.",
                                                                    "enum": [
                                                                        "exact",
                                                                        "is_not",
                                                                        "icontains",
                                                                        "not_icontains",
                                                                        "regex",
                                                                        "not_regex"
                                                                    ],
                                                                    "type": "string"
                                                                },
                                                                "type": {
                                                                    "const": "element",
                                                                    "default": "element",
                                                                    "description": "Filter by autocaptured HTML element properties (`$autocapture`, `$rageclick`). Example: `{ type: \"element\", key: \"text\", value: \"Sign Up\", operator: \"exact\" }`",
                                                                    "type": "string"
                                                                },
                                                                "value": {
                                                                    "description": "Only use property values from the plan. If the operator is `regex` or `not_regex`, the value must be a valid ClickHouse regex pattern to match against. Otherwise, the value must be a substring that will be matched against the property value. Use the string values `true` or `false` for boolean properties.",
                                                                    "type": "string"
                                                                }
                                                            },
                                                            "required": ["key", "operator", "value"],
                                                            "type": "object"
                                                        },
                                                        {
                                                            "properties": {
                                                                "key": {
                                                                    "description": "The element property to filter on. `tag_name` — HTML tag (e.g., `button`, `a`, `input`). `text` — visible text content of the element. `href` — the `href` attribute for links. `selector` — a CSS selector matching the element (e.g., `div.main > button.cta`).",
                                                                    "enum": ["tag_name", "text", "href", "selector"],
                                                                    "type": "string"
                                                                },
                                                                "operator": {
                                                                    "enum": ["exact", "gt", "lt"],
                                                                    "type": "string"
                                                                },
                                                                "type": {
                                                                    "const": "element",
                                                                    "default": "element",
                                                                    "description": "Filter by autocaptured HTML element properties (`$autocapture`, `$rageclick`). Example: `{ type: \"element\", key: \"text\", value: \"Sign Up\", operator: \"exact\" }`",
                                                                    "type": "string"
                                                                },
                                                                "value": {
                                                                    "type": "number"
                                                                }
                                                            },
                                                            "required": ["key", "operator", "value"],
                                                            "type": "object"
                                                        },
                                                        {
                                                            "properties": {
                                                                "key": {
                                                                    "description": "The element property to filter on. `tag_name` — HTML tag (e.g., `button`, `a`, `input`). `text` — visible text content of the element. `href` — the `href` attribute for links. `selector` — a CSS selector matching the element (e.g., `div.main > button.cta`).",
                                                                    "enum": ["tag_name", "text", "href", "selector"],
                                                                    "type": "string"
                                                                },
                                                                "operator": {
                                                                    "description": "`exact` - exact match of any of the values. `is_not` - does not match any of the values.",
                                                                    "enum": ["exact", "is_not"],
                                                                    "type": "string"
                                                                },
                                                                "type": {
                                                                    "const": "element",
                                                                    "default": "element",
                                                                    "description": "Filter by autocaptured HTML element properties (`$autocapture`, `$rageclick`). Example: `{ type: \"element\", key: \"text\", value: \"Sign Up\", operator: \"exact\" }`",
                                                                    "type": "string"
                                                                },
                                                                "value": {
                                                                    "description": "Only use property values from the plan. Always use strings as values. If you have a number, convert it to a string first. If you have a boolean, convert it to a string \"true\" or \"false\".",
                                                                    "items": {
                                                                        "type": "string"
                                                                    },
                                                                    "type": "array"
                                                                }
                                                            },
                                                            "required": ["key", "operator", "value"],
                                                            "type": "object"
                                                        },
                                                        {
                                                            "properties": {
                                                                "key": {
                                                                    "description": "The element property to filter on. `tag_name` — HTML tag (e.g., `button`, `a`, `input`). `text` — visible text content of the element. `href` — the `href` attribute for links. `selector` — a CSS selector matching the element (e.g., `div.main > button.cta`).",
                                                                    "enum": ["tag_name", "text", "href", "selector"],
                                                                    "type": "string"
                                                                },
                                                                "operator": {
                                                                    "enum": [
                                                                        "is_date_exact",
                                                                        "is_date_before",
                                                                        "is_date_after"
                                                                    ],
                                                                    "type": "string"
                                                                },
                                                                "type": {
                                                                    "const": "element",
                                                                    "default": "element",
                                                                    "description": "Filter by autocaptured HTML element properties (`$autocapture`, `$rageclick`). Example: `{ type: \"element\", key: \"text\", value: \"Sign Up\", operator: \"exact\" }`",
                                                                    "type": "string"
                                                                },
                                                                "value": {
                                                                    "description": "Value must be a date in ISO 8601 format.",
                                                                    "type": "string"
                                                                }
                                                            },
                                                            "required": ["key", "operator", "value"],
                                                            "type": "object"
                                                        },
                                                        {
                                                            "properties": {
                                                                "key": {
                                                                    "description": "The element property to filter on. `tag_name` — HTML tag (e.g., `button`, `a`, `input`). `text` — visible text content of the element. `href` — the `href` attribute for links. `selector` — a CSS selector matching the element (e.g., `div.main > button.cta`).",
                                                                    "enum": ["tag_name", "text", "href", "selector"],
                                                                    "type": "string"
                                                                },
                                                                "operator": {
                                                                    "description": "`is_set` - the property has any value. `is_not_set` - the property doesn't have a value or wasn't collected.",
                                                                    "enum": ["is_set", "is_not_set"],
                                                                    "type": "string"
                                                                },
                                                                "type": {
                                                                    "const": "element",
                                                                    "default": "element",
                                                                    "description": "Filter by autocaptured HTML element properties (`$autocapture`, `$rageclick`). Example: `{ type: \"element\", key: \"text\", value: \"Sign Up\", operator: \"exact\" }`",
                                                                    "type": "string"
                                                                }
                                                            },
                                                            "required": ["key", "operator"],
                                                            "type": "object"
                                                        }
                                                    ]
                                                },
                                                {
                                                    "properties": {
                                                        "key": {
                                                            "description": "A HogQL boolean expression used as a filter condition.\n\nExamples:\n- Filter where a property exceeds a threshold: `toFloat(properties.load_time) > 5.0`\n- Filter with string matching: `properties.$current_url LIKE '%/pricing%'`\n- Filter with multiple conditions: `properties.$browser = 'Chrome' AND toFloat(properties.duration) > 30`",
                                                            "type": "string"
                                                        },
                                                        "type": {
                                                            "const": "hogql",
                                                            "default": "hogql",
                                                            "description": "Filter by a HogQL boolean expression for advanced filtering that can't be expressed with standard property filters.",
                                                            "type": "string"
                                                        }
                                                    },
                                                    "required": ["key"],
                                                    "type": "object"
                                                },
                                                {
                                                    "properties": {
                                                        "key": {
                                                            "description": "The feature flag key.",
                                                            "type": "string"
                                                        },
                                                        "operator": {
                                                            "const": "flag_evaluates_to",
                                                            "default": "flag_evaluates_to",
                                                            "type": "string"
                                                        },
                                                        "type": {
                                                            "const": "flag",
                                                            "default": "flag",
                                                            "description": "Filter events by feature flag state — only include events where a specific flag evaluated to a given value. Examples:\n- Flag enabled: `{ type: \"flag\", key: \"new-onboarding\", operator: \"flag_evaluates_to\", value: true }`\n- Specific variant: `{ type: \"flag\", key: \"checkout-experiment\", operator: \"flag_evaluates_to\", value: \"variant-a\" }`",
                                                            "type": "string"
                                                        },
                                                        "value": {
                                                            "anyOf": [
                                                                {
                                                                    "type": "boolean"
                                                                },
                                                                {
                                                                    "type": "string"
                                                                }
                                                            ],
                                                            "description": "`true`/`false` for boolean flags, or a variant name string for multivariate flags."
                                                        }
                                                    },
                                                    "required": ["key", "value"],
                                                    "type": "object"
                                                }
                                            ]
                                        },
                                        "type": "array"
                                    },
                                    "version": {
                                        "description": "version of the node, used for schema migrations",
                                        "type": "number"
                                    }
                                },
                                "required": ["id", "name"],
                                "type": "object"
                            },
                            {
                                "properties": {
                                    "custom_name": {
                                        "type": "string"
                                    },
                                    "kind": {
                                        "const": "GroupNode",
                                        "default": "GroupNode",
                                        "type": "string"
                                    },
                                    "name": {
                                        "description": "Display name for the combined step.",
                                        "type": "string"
                                    },
                                    "nodes": {
                                        "description": "Events and actions combined into the step. Use per-node `properties` to filter each event; there is no step-wide filter on a grouped step.",
                                        "items": {
                                            "anyOf": [
                                                {
                                                    "properties": {
                                                        "custom_name": {
                                                            "description": "Optional custom name for the event if it is needed to be renamed.",
                                                            "type": "string"
                                                        },
                                                        "event": {
                                                            "description": "Name of the event.",
                                                            "type": "string"
                                                        },
                                                        "kind": {
                                                            "const": "EventsNode",
                                                            "default": "EventsNode",
                                                            "type": "string"
                                                        },
                                                        "math": {
                                                            "description": "Optional math aggregation type for the series. `total` is the default stored on saved funnels and can be preserved when rerunning one. `first_time_for_user` - counts the number of users who have completed the event for the first time ever. `first_time_for_user_with_filters` - counts the number of users who have completed the event with specified filters for the first time.",
                                                            "enum": [
                                                                "total",
                                                                "first_time_for_user",
                                                                "first_time_for_user_with_filters"
                                                            ],
                                                            "type": "string"
                                                        },
                                                        "optionalInFunnel": {
                                                            "default": false,
                                                            "description": "If true, this step can be skipped without breaking the funnel — conversion between the surrounding required steps still counts even if this step didn't happen. Set this when the user asks for a non-required, skippable, or optional step in the funnel. Do not set it on the first or last step (those must be required).",
                                                            "type": "boolean"
                                                        },
                                                        "properties": {
                                                            "items": {
                                                                "anyOf": [
                                                                    {
                                                                        "anyOf": [
                                                                            {
                                                                                "properties": {
                                                                                    "key": {
                                                                                        "description": "Use one of the properties the user has provided in the plan.",
                                                                                        "type": "string"
                                                                                    },
                                                                                    "operator": {
                                                                                        "description": "`icontains` - case insensitive contains. `not_icontains` - case insensitive does not contain. `regex` - matches the regex pattern. `not_regex` - does not match the regex pattern.",
                                                                                        "enum": [
                                                                                            "exact",
                                                                                            "is_not",
                                                                                            "icontains",
                                                                                            "not_icontains",
                                                                                            "regex",
                                                                                            "not_regex"
                                                                                        ],
                                                                                        "type": "string"
                                                                                    },
                                                                                    "type": {
                                                                                        "enum": [
                                                                                            "event",
                                                                                            "person",
                                                                                            "session",
                                                                                            "feature"
                                                                                        ],
                                                                                        "type": "string"
                                                                                    },
                                                                                    "value": {
                                                                                        "description": "Only use property values from the plan. If the operator is `regex` or `not_regex`, the value must be a valid ClickHouse regex pattern to match against. Otherwise, the value must be a substring that will be matched against the property value. Use the string values `true` or `false` for boolean properties.",
                                                                                        "type": "string"
                                                                                    }
                                                                                },
                                                                                "required": [
                                                                                    "key",
                                                                                    "operator",
                                                                                    "type",
                                                                                    "value"
                                                                                ],
                                                                                "type": "object"
                                                                            },
                                                                            {
                                                                                "properties": {
                                                                                    "key": {
                                                                                        "description": "Use one of the properties the user has provided in the plan.",
                                                                                        "type": "string"
                                                                                    },
                                                                                    "operator": {
                                                                                        "enum": ["exact", "gt", "lt"],
                                                                                        "type": "string"
                                                                                    },
                                                                                    "type": {
                                                                                        "enum": [
                                                                                            "event",
                                                                                            "person",
                                                                                            "session",
                                                                                            "feature"
                                                                                        ],
                                                                                        "type": "string"
                                                                                    },
                                                                                    "value": {
                                                                                        "type": "number"
                                                                                    }
                                                                                },
                                                                                "required": [
                                                                                    "key",
                                                                                    "operator",
                                                                                    "type",
                                                                                    "value"
                                                                                ],
                                                                                "type": "object"
                                                                            },
                                                                            {
                                                                                "properties": {
                                                                                    "key": {
                                                                                        "description": "Use one of the properties the user has provided in the plan.",
                                                                                        "type": "string"
                                                                                    },
                                                                                    "operator": {
                                                                                        "description": "`exact` - exact match of any of the values. `is_not` - does not match any of the values.",
                                                                                        "enum": ["exact", "is_not"],
                                                                                        "type": "string"
                                                                                    },
                                                                                    "type": {
                                                                                        "enum": [
                                                                                            "event",
                                                                                            "person",
                                                                                            "session",
                                                                                            "feature"
                                                                                        ],
                                                                                        "type": "string"
                                                                                    },
                                                                                    "value": {
                                                                                        "description": "Only use property values from the plan. Always use strings as values. If you have a number, convert it to a string first. If you have a boolean, convert it to a string \"true\" or \"false\".",
                                                                                        "items": {
                                                                                            "type": "string"
                                                                                        },
                                                                                        "type": "array"
                                                                                    }
                                                                                },
                                                                                "required": [
                                                                                    "key",
                                                                                    "operator",
                                                                                    "type",
                                                                                    "value"
                                                                                ],
                                                                                "type": "object"
                                                                            },
                                                                            {
                                                                                "properties": {
                                                                                    "key": {
                                                                                        "description": "Use one of the properties the user has provided in the plan.",
                                                                                        "type": "string"
                                                                                    },
                                                                                    "operator": {
                                                                                        "enum": [
                                                                                            "is_date_exact",
                                                                                            "is_date_before",
                                                                                            "is_date_after"
                                                                                        ],
                                                                                        "type": "string"
                                                                                    },
                                                                                    "type": {
                                                                                        "enum": [
                                                                                            "event",
                                                                                            "person",
                                                                                            "session",
                                                                                            "feature"
                                                                                        ],
                                                                                        "type": "string"
                                                                                    },
                                                                                    "value": {
                                                                                        "description": "Value must be a date in ISO 8601 format.",
                                                                                        "type": "string"
                                                                                    }
                                                                                },
                                                                                "required": [
                                                                                    "key",
                                                                                    "operator",
                                                                                    "type",
                                                                                    "value"
                                                                                ],
                                                                                "type": "object"
                                                                            },
                                                                            {
                                                                                "properties": {
                                                                                    "key": {
                                                                                        "description": "Use one of the properties the user has provided in the plan.",
                                                                                        "type": "string"
                                                                                    },
                                                                                    "operator": {
                                                                                        "description": "`is_set` - the property has any value. `is_not_set` - the property doesn't have a value or wasn't collected.",
                                                                                        "enum": [
                                                                                            "is_set",
                                                                                            "is_not_set"
                                                                                        ],
                                                                                        "type": "string"
                                                                                    },
                                                                                    "type": {
                                                                                        "enum": [
                                                                                            "event",
                                                                                            "person",
                                                                                            "session",
                                                                                            "feature"
                                                                                        ],
                                                                                        "type": "string"
                                                                                    }
                                                                                },
                                                                                "required": ["key", "operator", "type"],
                                                                                "type": "object"
                                                                            }
                                                                        ]
                                                                    },
                                                                    {
                                                                        "anyOf": [
                                                                            {
                                                                                "properties": {
                                                                                    "group_type_index": {
                                                                                        "description": "Index of the group type from the group mapping.",
                                                                                        "maximum": 9007199254740991,
                                                                                        "minimum": -9007199254740991,
                                                                                        "type": "integer"
                                                                                    },
                                                                                    "key": {
                                                                                        "description": "Use one of the properties the user has provided in the plan.",
                                                                                        "type": "string"
                                                                                    },
                                                                                    "operator": {
                                                                                        "description": "`icontains` - case insensitive contains. `not_icontains` - case insensitive does not contain. `regex` - matches the regex pattern. `not_regex` - does not match the regex pattern.",
                                                                                        "enum": [
                                                                                            "exact",
                                                                                            "is_not",
                                                                                            "icontains",
                                                                                            "not_icontains",
                                                                                            "regex",
                                                                                            "not_regex"
                                                                                        ],
                                                                                        "type": "string"
                                                                                    },
                                                                                    "type": {
                                                                                        "const": "group",
                                                                                        "default": "group",
                                                                                        "type": "string"
                                                                                    },
                                                                                    "value": {
                                                                                        "description": "Only use property values from the plan. If the operator is `regex` or `not_regex`, the value must be a valid ClickHouse regex pattern to match against. Otherwise, the value must be a substring that will be matched against the property value. Use the string values `true` or `false` for boolean properties.",
                                                                                        "type": "string"
                                                                                    }
                                                                                },
                                                                                "required": [
                                                                                    "group_type_index",
                                                                                    "key",
                                                                                    "operator",
                                                                                    "value"
                                                                                ],
                                                                                "type": "object"
                                                                            },
                                                                            {
                                                                                "properties": {
                                                                                    "group_type_index": {
                                                                                        "description": "Index of the group type from the group mapping.",
                                                                                        "maximum": 9007199254740991,
                                                                                        "minimum": -9007199254740991,
                                                                                        "type": "integer"
                                                                                    },
                                                                                    "key": {
                                                                                        "description": "Use one of the properties the user has provided in the plan.",
                                                                                        "type": "string"
                                                                                    },
                                                                                    "operator": {
                                                                                        "enum": ["exact", "gt", "lt"],
                                                                                        "type": "string"
                                                                                    },
                                                                                    "type": {
                                                                                        "const": "group",
                                                                                        "default": "group",
                                                                                        "type": "string"
                                                                                    },
                                                                                    "value": {
                                                                                        "type": "number"
                                                                                    }
                                                                                },
                                                                                "required": [
                                                                                    "group_type_index",
                                                                                    "key",
                                                                                    "operator",
                                                                                    "value"
                                                                                ],
                                                                                "type": "object"
                                                                            },
                                                                            {
                                                                                "properties": {
                                                                                    "group_type_index": {
                                                                                        "description": "Index of the group type from the group mapping.",
                                                                                        "maximum": 9007199254740991,
                                                                                        "minimum": -9007199254740991,
                                                                                        "type": "integer"
                                                                                    },
                                                                                    "key": {
                                                                                        "description": "Use one of the properties the user has provided in the plan.",
                                                                                        "type": "string"
                                                                                    },
                                                                                    "operator": {
                                                                                        "description": "`exact` - exact match of any of the values. `is_not` - does not match any of the values.",
                                                                                        "enum": ["exact", "is_not"],
                                                                                        "type": "string"
                                                                                    },
                                                                                    "type": {
                                                                                        "const": "group",
                                                                                        "default": "group",
                                                                                        "type": "string"
                                                                                    },
                                                                                    "value": {
                                                                                        "description": "Only use property values from the plan. Always use strings as values. If you have a number, convert it to a string first. If you have a boolean, convert it to a string \"true\" or \"false\".",
                                                                                        "items": {
                                                                                            "type": "string"
                                                                                        },
                                                                                        "type": "array"
                                                                                    }
                                                                                },
                                                                                "required": [
                                                                                    "group_type_index",
                                                                                    "key",
                                                                                    "operator",
                                                                                    "value"
                                                                                ],
                                                                                "type": "object"
                                                                            },
                                                                            {
                                                                                "properties": {
                                                                                    "group_type_index": {
                                                                                        "description": "Index of the group type from the group mapping.",
                                                                                        "maximum": 9007199254740991,
                                                                                        "minimum": -9007199254740991,
                                                                                        "type": "integer"
                                                                                    },
                                                                                    "key": {
                                                                                        "description": "Use one of the properties the user has provided in the plan.",
                                                                                        "type": "string"
                                                                                    },
                                                                                    "operator": {
                                                                                        "enum": [
                                                                                            "is_date_exact",
                                                                                            "is_date_before",
                                                                                            "is_date_after"
                                                                                        ],
                                                                                        "type": "string"
                                                                                    },
                                                                                    "type": {
                                                                                        "const": "group",
                                                                                        "default": "group",
                                                                                        "type": "string"
                                                                                    },
                                                                                    "value": {
                                                                                        "description": "Value must be a date in ISO 8601 format.",
                                                                                        "type": "string"
                                                                                    }
                                                                                },
                                                                                "required": [
                                                                                    "group_type_index",
                                                                                    "key",
                                                                                    "operator",
                                                                                    "value"
                                                                                ],
                                                                                "type": "object"
                                                                            },
                                                                            {
                                                                                "properties": {
                                                                                    "group_type_index": {
                                                                                        "description": "Index of the group type from the group mapping.",
                                                                                        "maximum": 9007199254740991,
                                                                                        "minimum": -9007199254740991,
                                                                                        "type": "integer"
                                                                                    },
                                                                                    "key": {
                                                                                        "description": "Use one of the properties the user has provided in the plan.",
                                                                                        "type": "string"
                                                                                    },
                                                                                    "operator": {
                                                                                        "description": "`is_set` - the property has any value. `is_not_set` - the property doesn't have a value or wasn't collected.",
                                                                                        "enum": [
                                                                                            "is_set",
                                                                                            "is_not_set"
                                                                                        ],
                                                                                        "type": "string"
                                                                                    },
                                                                                    "type": {
                                                                                        "const": "group",
                                                                                        "default": "group",
                                                                                        "type": "string"
                                                                                    }
                                                                                },
                                                                                "required": [
                                                                                    "group_type_index",
                                                                                    "key",
                                                                                    "operator"
                                                                                ],
                                                                                "type": "object"
                                                                            }
                                                                        ]
                                                                    },
                                                                    {
                                                                        "properties": {
                                                                            "key": {
                                                                                "const": "id",
                                                                                "default": "id",
                                                                                "type": "string"
                                                                            },
                                                                            "operator": {
                                                                                "default": "in",
                                                                                "enum": ["in", "not_in"],
                                                                                "type": "string"
                                                                            },
                                                                            "type": {
                                                                                "const": "cohort",
                                                                                "default": "cohort",
                                                                                "description": "Filter events by cohort membership. Use this to narrow down results to persons belonging to a specific cohort. Use `operator: \"in\"` to include cohort members, or `operator: \"not_in\"` to exclude them. Examples:\n- Include: `{ type: \"cohort\", key: \"id\", value: 42, operator: \"in\" }`\n- Exclude: `{ type: \"cohort\", key: \"id\", value: 42, operator: \"not_in\" }`",
                                                                                "type": "string"
                                                                            },
                                                                            "value": {
                                                                                "description": "The cohort ID to filter by.",
                                                                                "maximum": 9007199254740991,
                                                                                "minimum": -9007199254740991,
                                                                                "type": "integer"
                                                                            }
                                                                        },
                                                                        "required": ["value"],
                                                                        "type": "object"
                                                                    },
                                                                    {
                                                                        "anyOf": [
                                                                            {
                                                                                "properties": {
                                                                                    "key": {
                                                                                        "description": "The element property to filter on. `tag_name` — HTML tag (e.g., `button`, `a`, `input`). `text` — visible text content of the element. `href` — the `href` attribute for links. `selector` — a CSS selector matching the element (e.g., `div.main > button.cta`).",
                                                                                        "enum": [
                                                                                            "tag_name",
                                                                                            "text",
                                                                                            "href",
                                                                                            "selector"
                                                                                        ],
                                                                                        "type": "string"
                                                                                    },
                                                                                    "operator": {
                                                                                        "description": "`icontains` - case insensitive contains. `not_icontains` - case insensitive does not contain. `regex` - matches the regex pattern. `not_regex` - does not match the regex pattern.",
                                                                                        "enum": [
                                                                                            "exact",
                                                                                            "is_not",
                                                                                            "icontains",
                                                                                            "not_icontains",
                                                                                            "regex",
                                                                                            "not_regex"
                                                                                        ],
                                                                                        "type": "string"
                                                                                    },
                                                                                    "type": {
                                                                                        "const": "element",
                                                                                        "default": "element",
                                                                                        "description": "Filter by autocaptured HTML element properties (`$autocapture`, `$rageclick`). Example: `{ type: \"element\", key: \"text\", value: \"Sign Up\", operator: \"exact\" }`",
                                                                                        "type": "string"
                                                                                    },
                                                                                    "value": {
                                                                                        "description": "Only use property values from the plan. If the operator is `regex` or `not_regex`, the value must be a valid ClickHouse regex pattern to match against. Otherwise, the value must be a substring that will be matched against the property value. Use the string values `true` or `false` for boolean properties.",
                                                                                        "type": "string"
                                                                                    }
                                                                                },
                                                                                "required": [
                                                                                    "key",
                                                                                    "operator",
                                                                                    "value"
                                                                                ],
                                                                                "type": "object"
                                                                            },
                                                                            {
                                                                                "properties": {
                                                                                    "key": {
                                                                                        "description": "The element property to filter on. `tag_name` — HTML tag (e.g., `button`, `a`, `input`). `text` — visible text content of the element. `href` — the `href` attribute for links. `selector` — a CSS selector matching the element (e.g., `div.main > button.cta`).",
                                                                                        "enum": [
                                                                                            "tag_name",
                                                                                            "text",
                                                                                            "href",
                                                                                            "selector"
                                                                                        ],
                                                                                        "type": "string"
                                                                                    },
                                                                                    "operator": {
                                                                                        "enum": ["exact", "gt", "lt"],
                                                                                        "type": "string"
                                                                                    },
                                                                                    "type": {
                                                                                        "const": "element",
                                                                                        "default": "element",
                                                                                        "description": "Filter by autocaptured HTML element properties (`$autocapture`, `$rageclick`). Example: `{ type: \"element\", key: \"text\", value: \"Sign Up\", operator: \"exact\" }`",
                                                                                        "type": "string"
                                                                                    },
                                                                                    "value": {
                                                                                        "type": "number"
                                                                                    }
                                                                                },
                                                                                "required": [
                                                                                    "key",
                                                                                    "operator",
                                                                                    "value"
                                                                                ],
                                                                                "type": "object"
                                                                            },
                                                                            {
                                                                                "properties": {
                                                                                    "key": {
                                                                                        "description": "The element property to filter on. `tag_name` — HTML tag (e.g., `button`, `a`, `input`). `text` — visible text content of the element. `href` — the `href` attribute for links. `selector` — a CSS selector matching the element (e.g., `div.main > button.cta`).",
                                                                                        "enum": [
                                                                                            "tag_name",
                                                                                            "text",
                                                                                            "href",
                                                                                            "selector"
                                                                                        ],
                                                                                        "type": "string"
                                                                                    },
                                                                                    "operator": {
                                                                                        "description": "`exact` - exact match of any of the values. `is_not` - does not match any of the values.",
                                                                                        "enum": ["exact", "is_not"],
                                                                                        "type": "string"
                                                                                    },
                                                                                    "type": {
                                                                                        "const": "element",
                                                                                        "default": "element",
                                                                                        "description": "Filter by autocaptured HTML element properties (`$autocapture`, `$rageclick`). Example: `{ type: \"element\", key: \"text\", value: \"Sign Up\", operator: \"exact\" }`",
                                                                                        "type": "string"
                                                                                    },
                                                                                    "value": {
                                                                                        "description": "Only use property values from the plan. Always use strings as values. If you have a number, convert it to a string first. If you have a boolean, convert it to a string \"true\" or \"false\".",
                                                                                        "items": {
                                                                                            "type": "string"
                                                                                        },
                                                                                        "type": "array"
                                                                                    }
                                                                                },
                                                                                "required": [
                                                                                    "key",
                                                                                    "operator",
                                                                                    "value"
                                                                                ],
                                                                                "type": "object"
                                                                            },
                                                                            {
                                                                                "properties": {
                                                                                    "key": {
                                                                                        "description": "The element property to filter on. `tag_name` — HTML tag (e.g., `button`, `a`, `input`). `text` — visible text content of the element. `href` — the `href` attribute for links. `selector` — a CSS selector matching the element (e.g., `div.main > button.cta`).",
                                                                                        "enum": [
                                                                                            "tag_name",
                                                                                            "text",
                                                                                            "href",
                                                                                            "selector"
                                                                                        ],
                                                                                        "type": "string"
                                                                                    },
                                                                                    "operator": {
                                                                                        "enum": [
                                                                                            "is_date_exact",
                                                                                            "is_date_before",
                                                                                            "is_date_after"
                                                                                        ],
                                                                                        "type": "string"
                                                                                    },
                                                                                    "type": {
                                                                                        "const": "element",
                                                                                        "default": "element",
                                                                                        "description": "Filter by autocaptured HTML element properties (`$autocapture`, `$rageclick`). Example: `{ type: \"element\", key: \"text\", value: \"Sign Up\", operator: \"exact\" }`",
                                                                                        "type": "string"
                                                                                    },
                                                                                    "value": {
                                                                                        "description": "Value must be a date in ISO 8601 format.",
                                                                                        "type": "string"
                                                                                    }
                                                                                },
                                                                                "required": [
                                                                                    "key",
                                                                                    "operator",
                                                                                    "value"
                                                                                ],
                                                                                "type": "object"
                                                                            },
                                                                            {
                                                                                "properties": {
                                                                                    "key": {
                                                                                        "description": "The element property to filter on. `tag_name` — HTML tag (e.g., `button`, `a`, `input`). `text` — visible text content of the element. `href` — the `href` attribute for links. `selector` — a CSS selector matching the element (e.g., `div.main > button.cta`).",
                                                                                        "enum": [
                                                                                            "tag_name",
                                                                                            "text",
                                                                                            "href",
                                                                                            "selector"
                                                                                        ],
                                                                                        "type": "string"
                                                                                    },
                                                                                    "operator": {
                                                                                        "description": "`is_set` - the property has any value. `is_not_set` - the property doesn't have a value or wasn't collected.",
                                                                                        "enum": [
                                                                                            "is_set",
                                                                                            "is_not_set"
                                                                                        ],
                                                                                        "type": "string"
                                                                                    },
                                                                                    "type": {
                                                                                        "const": "element",
                                                                                        "default": "element",
                                                                                        "description": "Filter by autocaptured HTML element properties (`$autocapture`, `$rageclick`). Example: `{ type: \"element\", key: \"text\", value: \"Sign Up\", operator: \"exact\" }`",
                                                                                        "type": "string"
                                                                                    }
                                                                                },
                                                                                "required": ["key", "operator"],
                                                                                "type": "object"
                                                                            }
                                                                        ]
                                                                    },
                                                                    {
                                                                        "properties": {
                                                                            "key": {
                                                                                "description": "A HogQL boolean expression used as a filter condition.\n\nExamples:\n- Filter where a property exceeds a threshold: `toFloat(properties.load_time) > 5.0`\n- Filter with string matching: `properties.$current_url LIKE '%/pricing%'`\n- Filter with multiple conditions: `properties.$browser = 'Chrome' AND toFloat(properties.duration) > 30`",
                                                                                "type": "string"
                                                                            },
                                                                            "type": {
                                                                                "const": "hogql",
                                                                                "default": "hogql",
                                                                                "description": "Filter by a HogQL boolean expression for advanced filtering that can't be expressed with standard property filters.",
                                                                                "type": "string"
                                                                            }
                                                                        },
                                                                        "required": ["key"],
                                                                        "type": "object"
                                                                    },
                                                                    {
                                                                        "properties": {
                                                                            "key": {
                                                                                "description": "The feature flag key.",
                                                                                "type": "string"
                                                                            },
                                                                            "operator": {
                                                                                "const": "flag_evaluates_to",
                                                                                "default": "flag_evaluates_to",
                                                                                "type": "string"
                                                                            },
                                                                            "type": {
                                                                                "const": "flag",
                                                                                "default": "flag",
                                                                                "description": "Filter events by feature flag state — only include events where a specific flag evaluated to a given value. Examples:\n- Flag enabled: `{ type: \"flag\", key: \"new-onboarding\", operator: \"flag_evaluates_to\", value: true }`\n- Specific variant: `{ type: \"flag\", key: \"checkout-experiment\", operator: \"flag_evaluates_to\", value: \"variant-a\" }`",
                                                                                "type": "string"
                                                                            },
                                                                            "value": {
                                                                                "anyOf": [
                                                                                    {
                                                                                        "type": "boolean"
                                                                                    },
                                                                                    {
                                                                                        "type": "string"
                                                                                    }
                                                                                ],
                                                                                "description": "`true`/`false` for boolean flags, or a variant name string for multivariate flags."
                                                                            }
                                                                        },
                                                                        "required": ["key", "value"],
                                                                        "type": "object"
                                                                    }
                                                                ]
                                                            },
                                                            "type": "array"
                                                        },
                                                        "version": {
                                                            "description": "version of the node, used for schema migrations",
                                                            "type": "number"
                                                        }
                                                    },
                                                    "required": ["event"],
                                                    "type": "object"
                                                },
                                                {
                                                    "properties": {
                                                        "id": {
                                                            "description": "Action ID from the plan.",
                                                            "type": "number"
                                                        },
                                                        "kind": {
                                                            "const": "ActionsNode",
                                                            "default": "ActionsNode",
                                                            "type": "string"
                                                        },
                                                        "math": {
                                                            "description": "Optional math aggregation type for the series. `total` is the default stored on saved funnels and can be preserved when rerunning one. `first_time_for_user` - counts the number of users who have completed the event for the first time ever. `first_time_for_user_with_filters` - counts the number of users who have completed the event with specified filters for the first time.",
                                                            "enum": [
                                                                "total",
                                                                "first_time_for_user",
                                                                "first_time_for_user_with_filters"
                                                            ],
                                                            "type": "string"
                                                        },
                                                        "name": {
                                                            "description": "Action name from the plan.",
                                                            "type": "string"
                                                        },
                                                        "optionalInFunnel": {
                                                            "default": false,
                                                            "description": "If true, this step can be skipped without breaking the funnel — conversion between the surrounding required steps still counts even if this step didn't happen. Set this when the user asks for a non-required, skippable, or optional step in the funnel. Do not set it on the first or last step (those must be required).",
                                                            "type": "boolean"
                                                        },
                                                        "properties": {
                                                            "items": {
                                                                "anyOf": [
                                                                    {
                                                                        "anyOf": [
                                                                            {
                                                                                "properties": {
                                                                                    "key": {
                                                                                        "description": "Use one of the properties the user has provided in the plan.",
                                                                                        "type": "string"
                                                                                    },
                                                                                    "operator": {
                                                                                        "description": "`icontains` - case insensitive contains. `not_icontains` - case insensitive does not contain. `regex` - matches the regex pattern. `not_regex` - does not match the regex pattern.",
                                                                                        "enum": [
                                                                                            "exact",
                                                                                            "is_not",
                                                                                            "icontains",
                                                                                            "not_icontains",
                                                                                            "regex",
                                                                                            "not_regex"
                                                                                        ],
                                                                                        "type": "string"
                                                                                    },
                                                                                    "type": {
                                                                                        "enum": [
                                                                                            "event",
                                                                                            "person",
                                                                                            "session",
                                                                                            "feature"
                                                                                        ],
                                                                                        "type": "string"
                                                                                    },
                                                                                    "value": {
                                                                                        "description": "Only use property values from the plan. If the operator is `regex` or `not_regex`, the value must be a valid ClickHouse regex pattern to match against. Otherwise, the value must be a substring that will be matched against the property value. Use the string values `true` or `false` for boolean properties.",
                                                                                        "type": "string"
                                                                                    }
                                                                                },
                                                                                "required": [
                                                                                    "key",
                                                                                    "operator",
                                                                                    "type",
                                                                                    "value"
                                                                                ],
                                                                                "type": "object"
                                                                            },
                                                                            {
                                                                                "properties": {
                                                                                    "key": {
                                                                                        "description": "Use one of the properties the user has provided in the plan.",
                                                                                        "type": "string"
                                                                                    },
                                                                                    "operator": {
                                                                                        "enum": ["exact", "gt", "lt"],
                                                                                        "type": "string"
                                                                                    },
                                                                                    "type": {
                                                                                        "enum": [
                                                                                            "event",
                                                                                            "person",
                                                                                            "session",
                                                                                            "feature"
                                                                                        ],
                                                                                        "type": "string"
                                                                                    },
                                                                                    "value": {
                                                                                        "type": "number"
                                                                                    }
                                                                                },
                                                                                "required": [
                                                                                    "key",
                                                                                    "operator",
                                                                                    "type",
                                                                                    "value"
                                                                                ],
                                                                                "type": "object"
                                                                            },
                                                                            {
                                                                                "properties": {
                                                                                    "key": {
                                                                                        "description": "Use one of the properties the user has provided in the plan.",
                                                                                        "type": "string"
                                                                                    },
                                                                                    "operator": {
                                                                                        "description": "`exact` - exact match of any of the values. `is_not` - does not match any of the values.",
                                                                                        "enum": ["exact", "is_not"],
                                                                                        "type": "string"
                                                                                    },
                                                                                    "type": {
                                                                                        "enum": [
                                                                                            "event",
                                                                                            "person",
                                                                                            "session",
                                                                                            "feature"
                                                                                        ],
                                                                                        "type": "string"
                                                                                    },
                                                                                    "value": {
                                                                                        "description": "Only use property values from the plan. Always use strings as values. If you have a number, convert it to a string first. If you have a boolean, convert it to a string \"true\" or \"false\".",
                                                                                        "items": {
                                                                                            "type": "string"
                                                                                        },
                                                                                        "type": "array"
                                                                                    }
                                                                                },
                                                                                "required": [
                                                                                    "key",
                                                                                    "operator",
                                                                                    "type",
                                                                                    "value"
                                                                                ],
                                                                                "type": "object"
                                                                            },
                                                                            {
                                                                                "properties": {
                                                                                    "key": {
                                                                                        "description": "Use one of the properties the user has provided in the plan.",
                                                                                        "type": "string"
                                                                                    },
                                                                                    "operator": {
                                                                                        "enum": [
                                                                                            "is_date_exact",
                                                                                            "is_date_before",
                                                                                            "is_date_after"
                                                                                        ],
                                                                                        "type": "string"
                                                                                    },
                                                                                    "type": {
                                                                                        "enum": [
                                                                                            "event",
                                                                                            "person",
                                                                                            "session",
                                                                                            "feature"
                                                                                        ],
                                                                                        "type": "string"
                                                                                    },
                                                                                    "value": {
                                                                                        "description": "Value must be a date in ISO 8601 format.",
                                                                                        "type": "string"
                                                                                    }
                                                                                },
                                                                                "required": [
                                                                                    "key",
                                                                                    "operator",
                                                                                    "type",
                                                                                    "value"
                                                                                ],
                                                                                "type": "object"
                                                                            },
                                                                            {
                                                                                "properties": {
                                                                                    "key": {
                                                                                        "description": "Use one of the properties the user has provided in the plan.",
                                                                                        "type": "string"
                                                                                    },
                                                                                    "operator": {
                                                                                        "description": "`is_set` - the property has any value. `is_not_set` - the property doesn't have a value or wasn't collected.",
                                                                                        "enum": [
                                                                                            "is_set",
                                                                                            "is_not_set"
                                                                                        ],
                                                                                        "type": "string"
                                                                                    },
                                                                                    "type": {
                                                                                        "enum": [
                                                                                            "event",
                                                                                            "person",
                                                                                            "session",
                                                                                            "feature"
                                                                                        ],
                                                                                        "type": "string"
                                                                                    }
                                                                                },
                                                                                "required": ["key", "operator", "type"],
                                                                                "type": "object"
                                                                            }
                                                                        ]
                                                                    },
                                                                    {
                                                                        "anyOf": [
                                                                            {
                                                                                "properties": {
                                                                                    "group_type_index": {
                                                                                        "description": "Index of the group type from the group mapping.",
                                                                                        "maximum": 9007199254740991,
                                                                                        "minimum": -9007199254740991,
                                                                                        "type": "integer"
                                                                                    },
                                                                                    "key": {
                                                                                        "description": "Use one of the properties the user has provided in the plan.",
                                                                                        "type": "string"
                                                                                    },
                                                                                    "operator": {
                                                                                        "description": "`icontains` - case insensitive contains. `not_icontains` - case insensitive does not contain. `regex` - matches the regex pattern. `not_regex` - does not match the regex pattern.",
                                                                                        "enum": [
                                                                                            "exact",
                                                                                            "is_not",
                                                                                            "icontains",
                                                                                            "not_icontains",
                                                                                            "regex",
                                                                                            "not_regex"
                                                                                        ],
                                                                                        "type": "string"
                                                                                    },
                                                                                    "type": {
                                                                                        "const": "group",
                                                                                        "default": "group",
                                                                                        "type": "string"
                                                                                    },
                                                                                    "value": {
                                                                                        "description": "Only use property values from the plan. If the operator is `regex` or `not_regex`, the value must be a valid ClickHouse regex pattern to match against. Otherwise, the value must be a substring that will be matched against the property value. Use the string values `true` or `false` for boolean properties.",
                                                                                        "type": "string"
                                                                                    }
                                                                                },
                                                                                "required": [
                                                                                    "group_type_index",
                                                                                    "key",
                                                                                    "operator",
                                                                                    "value"
                                                                                ],
                                                                                "type": "object"
                                                                            },
                                                                            {
                                                                                "properties": {
                                                                                    "group_type_index": {
                                                                                        "description": "Index of the group type from the group mapping.",
                                                                                        "maximum": 9007199254740991,
                                                                                        "minimum": -9007199254740991,
                                                                                        "type": "integer"
                                                                                    },
                                                                                    "key": {
                                                                                        "description": "Use one of the properties the user has provided in the plan.",
                                                                                        "type": "string"
                                                                                    },
                                                                                    "operator": {
                                                                                        "enum": ["exact", "gt", "lt"],
                                                                                        "type": "string"
                                                                                    },
                                                                                    "type": {
                                                                                        "const": "group",
                                                                                        "default": "group",
                                                                                        "type": "string"
                                                                                    },
                                                                                    "value": {
                                                                                        "type": "number"
                                                                                    }
                                                                                },
                                                                                "required": [
                                                                                    "group_type_index",
                                                                                    "key",
                                                                                    "operator",
                                                                                    "value"
                                                                                ],
                                                                                "type": "object"
                                                                            },
                                                                            {
                                                                                "properties": {
                                                                                    "group_type_index": {
                                                                                        "description": "Index of the group type from the group mapping.",
                                                                                        "maximum": 9007199254740991,
                                                                                        "minimum": -9007199254740991,
                                                                                        "type": "integer"
                                                                                    },
                                                                                    "key": {
                                                                                        "description": "Use one of the properties the user has provided in the plan.",
                                                                                        "type": "string"
                                                                                    },
                                                                                    "operator": {
                                                                                        "description": "`exact` - exact match of any of the values. `is_not` - does not match any of the values.",
                                                                                        "enum": ["exact", "is_not"],
                                                                                        "type": "string"
                                                                                    },
                                                                                    "type": {
                                                                                        "const": "group",
                                                                                        "default": "group",
                                                                                        "type": "string"
                                                                                    },
                                                                                    "value": {
                                                                                        "description": "Only use property values from the plan. Always use strings as values. If you have a number, convert it to a string first. If you have a boolean, convert it to a string \"true\" or \"false\".",
                                                                                        "items": {
                                                                                            "type": "string"
                                                                                        },
                                                                                        "type": "array"
                                                                                    }
                                                                                },
                                                                                "required": [
                                                                                    "group_type_index",
                                                                                    "key",
                                                                                    "operator",
                                                                                    "value"
                                                                                ],
                                                                                "type": "object"
                                                                            },
                                                                            {
                                                                                "properties": {
                                                                                    "group_type_index": {
                                                                                        "description": "Index of the group type from the group mapping.",
                                                                                        "maximum": 9007199254740991,
                                                                                        "minimum": -9007199254740991,
                                                                                        "type": "integer"
                                                                                    },
                                                                                    "key": {
                                                                                        "description": "Use one of the properties the user has provided in the plan.",
                                                                                        "type": "string"
                                                                                    },
                                                                                    "operator": {
                                                                                        "enum": [
                                                                                            "is_date_exact",
                                                                                            "is_date_before",
                                                                                            "is_date_after"
                                                                                        ],
                                                                                        "type": "string"
                                                                                    },
                                                                                    "type": {
                                                                                        "const": "group",
                                                                                        "default": "group",
                                                                                        "type": "string"
                                                                                    },
                                                                                    "value": {
                                                                                        "description": "Value must be a date in ISO 8601 format.",
                                                                                        "type": "string"
                                                                                    }
                                                                                },
                                                                                "required": [
                                                                                    "group_type_index",
                                                                                    "key",
                                                                                    "operator",
                                                                                    "value"
                                                                                ],
                                                                                "type": "object"
                                                                            },
                                                                            {
                                                                                "properties": {
                                                                                    "group_type_index": {
                                                                                        "description": "Index of the group type from the group mapping.",
                                                                                        "maximum": 9007199254740991,
                                                                                        "minimum": -9007199254740991,
                                                                                        "type": "integer"
                                                                                    },
                                                                                    "key": {
                                                                                        "description": "Use one of the properties the user has provided in the plan.",
                                                                                        "type": "string"
                                                                                    },
                                                                                    "operator": {
                                                                                        "description": "`is_set` - the property has any value. `is_not_set` - the property doesn't have a value or wasn't collected.",
                                                                                        "enum": [
                                                                                            "is_set",
                                                                                            "is_not_set"
                                                                                        ],
                                                                                        "type": "string"
                                                                                    },
                                                                                    "type": {
                                                                                        "const": "group",
                                                                                        "default": "group",
                                                                                        "type": "string"
                                                                                    }
                                                                                },
                                                                                "required": [
                                                                                    "group_type_index",
                                                                                    "key",
                                                                                    "operator"
                                                                                ],
                                                                                "type": "object"
                                                                            }
                                                                        ]
                                                                    },
                                                                    {
                                                                        "properties": {
                                                                            "key": {
                                                                                "const": "id",
                                                                                "default": "id",
                                                                                "type": "string"
                                                                            },
                                                                            "operator": {
                                                                                "default": "in",
                                                                                "enum": ["in", "not_in"],
                                                                                "type": "string"
                                                                            },
                                                                            "type": {
                                                                                "const": "cohort",
                                                                                "default": "cohort",
                                                                                "description": "Filter events by cohort membership. Use this to narrow down results to persons belonging to a specific cohort. Use `operator: \"in\"` to include cohort members, or `operator: \"not_in\"` to exclude them. Examples:\n- Include: `{ type: \"cohort\", key: \"id\", value: 42, operator: \"in\" }`\n- Exclude: `{ type: \"cohort\", key: \"id\", value: 42, operator: \"not_in\" }`",
                                                                                "type": "string"
                                                                            },
                                                                            "value": {
                                                                                "description": "The cohort ID to filter by.",
                                                                                "maximum": 9007199254740991,
                                                                                "minimum": -9007199254740991,
                                                                                "type": "integer"
                                                                            }
                                                                        },
                                                                        "required": ["value"],
                                                                        "type": "object"
                                                                    },
                                                                    {
                                                                        "anyOf": [
                                                                            {
                                                                                "properties": {
                                                                                    "key": {
                                                                                        "description": "The element property to filter on. `tag_name` — HTML tag (e.g., `button`, `a`, `input`). `text` — visible text content of the element. `href` — the `href` attribute for links. `selector` — a CSS selector matching the element (e.g., `div.main > button.cta`).",
                                                                                        "enum": [
                                                                                            "tag_name",
                                                                                            "text",
                                                                                            "href",
                                                                                            "selector"
                                                                                        ],
                                                                                        "type": "string"
                                                                                    },
                                                                                    "operator": {
                                                                                        "description": "`icontains` - case insensitive contains. `not_icontains` - case insensitive does not contain. `regex` - matches the regex pattern. `not_regex` - does not match the regex pattern.",
                                                                                        "enum": [
                                                                                            "exact",
                                                                                            "is_not",
                                                                                            "icontains",
                                                                                            "not_icontains",
                                                                                            "regex",
                                                                                            "not_regex"
                                                                                        ],
                                                                                        "type": "string"
                                                                                    },
                                                                                    "type": {
                                                                                        "const": "element",
                                                                                        "default": "element",
                                                                                        "description": "Filter by autocaptured HTML element properties (`$autocapture`, `$rageclick`). Example: `{ type: \"element\", key: \"text\", value: \"Sign Up\", operator: \"exact\" }`",
                                                                                        "type": "string"
                                                                                    },
                                                                                    "value": {
                                                                                        "description": "Only use property values from the plan. If the operator is `regex` or `not_regex`, the value must be a valid ClickHouse regex pattern to match against. Otherwise, the value must be a substring that will be matched against the property value. Use the string values `true` or `false` for boolean properties.",
                                                                                        "type": "string"
                                                                                    }
                                                                                },
                                                                                "required": [
                                                                                    "key",
                                                                                    "operator",
                                                                                    "value"
                                                                                ],
                                                                                "type": "object"
                                                                            },
                                                                            {
                                                                                "properties": {
                                                                                    "key": {
                                                                                        "description": "The element property to filter on. `tag_name` — HTML tag (e.g., `button`, `a`, `input`). `text` — visible text content of the element. `href` — the `href` attribute for links. `selector` — a CSS selector matching the element (e.g., `div.main > button.cta`).",
                                                                                        "enum": [
                                                                                            "tag_name",
                                                                                            "text",
                                                                                            "href",
                                                                                            "selector"
                                                                                        ],
                                                                                        "type": "string"
                                                                                    },
                                                                                    "operator": {
                                                                                        "enum": ["exact", "gt", "lt"],
                                                                                        "type": "string"
                                                                                    },
                                                                                    "type": {
                                                                                        "const": "element",
                                                                                        "default": "element",
                                                                                        "description": "Filter by autocaptured HTML element properties (`$autocapture`, `$rageclick`). Example: `{ type: \"element\", key: \"text\", value: \"Sign Up\", operator: \"exact\" }`",
                                                                                        "type": "string"
                                                                                    },
                                                                                    "value": {
                                                                                        "type": "number"
                                                                                    }
                                                                                },
                                                                                "required": [
                                                                                    "key",
                                                                                    "operator",
                                                                                    "value"
                                                                                ],
                                                                                "type": "object"
                                                                            },
                                                                            {
                                                                                "properties": {
                                                                                    "key": {
                                                                                        "description": "The element property to filter on. `tag_name` — HTML tag (e.g., `button`, `a`, `input`). `text` — visible text content of the element. `href` — the `href` attribute for links. `selector` — a CSS selector matching the element (e.g., `div.main > button.cta`).",
                                                                                        "enum": [
                                                                                            "tag_name",
                                                                                            "text",
                                                                                            "href",
                                                                                            "selector"
                                                                                        ],
                                                                                        "type": "string"
                                                                                    },
                                                                                    "operator": {
                                                                                        "description": "`exact` - exact match of any of the values. `is_not` - does not match any of the values.",
                                                                                        "enum": ["exact", "is_not"],
                                                                                        "type": "string"
                                                                                    },
                                                                                    "type": {
                                                                                        "const": "element",
                                                                                        "default": "element",
                                                                                        "description": "Filter by autocaptured HTML element properties (`$autocapture`, `$rageclick`). Example: `{ type: \"element\", key: \"text\", value: \"Sign Up\", operator: \"exact\" }`",
                                                                                        "type": "string"
                                                                                    },
                                                                                    "value": {
                                                                                        "description": "Only use property values from the plan. Always use strings as values. If you have a number, convert it to a string first. If you have a boolean, convert it to a string \"true\" or \"false\".",
                                                                                        "items": {
                                                                                            "type": "string"
                                                                                        },
                                                                                        "type": "array"
                                                                                    }
                                                                                },
                                                                                "required": [
                                                                                    "key",
                                                                                    "operator",
                                                                                    "value"
                                                                                ],
                                                                                "type": "object"
                                                                            },
                                                                            {
                                                                                "properties": {
                                                                                    "key": {
                                                                                        "description": "The element property to filter on. `tag_name` — HTML tag (e.g., `button`, `a`, `input`). `text` — visible text content of the element. `href` — the `href` attribute for links. `selector` — a CSS selector matching the element (e.g., `div.main > button.cta`).",
                                                                                        "enum": [
                                                                                            "tag_name",
                                                                                            "text",
                                                                                            "href",
                                                                                            "selector"
                                                                                        ],
                                                                                        "type": "string"
                                                                                    },
                                                                                    "operator": {
                                                                                        "enum": [
                                                                                            "is_date_exact",
                                                                                            "is_date_before",
                                                                                            "is_date_after"
                                                                                        ],
                                                                                        "type": "string"
                                                                                    },
                                                                                    "type": {
                                                                                        "const": "element",
                                                                                        "default": "element",
                                                                                        "description": "Filter by autocaptured HTML element properties (`$autocapture`, `$rageclick`). Example: `{ type: \"element\", key: \"text\", value: \"Sign Up\", operator: \"exact\" }`",
                                                                                        "type": "string"
                                                                                    },
                                                                                    "value": {
                                                                                        "description": "Value must be a date in ISO 8601 format.",
                                                                                        "type": "string"
                                                                                    }
                                                                                },
                                                                                "required": [
                                                                                    "key",
                                                                                    "operator",
                                                                                    "value"
                                                                                ],
                                                                                "type": "object"
                                                                            },
                                                                            {
                                                                                "properties": {
                                                                                    "key": {
                                                                                        "description": "The element property to filter on. `tag_name` — HTML tag (e.g., `button`, `a`, `input`). `text` — visible text content of the element. `href` — the `href` attribute for links. `selector` — a CSS selector matching the element (e.g., `div.main > button.cta`).",
                                                                                        "enum": [
                                                                                            "tag_name",
                                                                                            "text",
                                                                                            "href",
                                                                                            "selector"
                                                                                        ],
                                                                                        "type": "string"
                                                                                    },
                                                                                    "operator": {
                                                                                        "description": "`is_set` - the property has any value. `is_not_set` - the property doesn't have a value or wasn't collected.",
                                                                                        "enum": [
                                                                                            "is_set",
                                                                                            "is_not_set"
                                                                                        ],
                                                                                        "type": "string"
                                                                                    },
                                                                                    "type": {
                                                                                        "const": "element",
                                                                                        "default": "element",
                                                                                        "description": "Filter by autocaptured HTML element properties (`$autocapture`, `$rageclick`). Example: `{ type: \"element\", key: \"text\", value: \"Sign Up\", operator: \"exact\" }`",
                                                                                        "type": "string"
                                                                                    }
                                                                                },
                                                                                "required": ["key", "operator"],
                                                                                "type": "object"
                                                                            }
                                                                        ]
                                                                    },
                                                                    {
                                                                        "properties": {
                                                                            "key": {
                                                                                "description": "A HogQL boolean expression used as a filter condition.\n\nExamples:\n- Filter where a property exceeds a threshold: `toFloat(properties.load_time) > 5.0`\n- Filter with string matching: `properties.$current_url LIKE '%/pricing%'`\n- Filter with multiple conditions: `properties.$browser = 'Chrome' AND toFloat(properties.duration) > 30`",
                                                                                "type": "string"
                                                                            },
                                                                            "type": {
                                                                                "const": "hogql",
                                                                                "default": "hogql",
                                                                                "description": "Filter by a HogQL boolean expression for advanced filtering that can't be expressed with standard property filters.",
                                                                                "type": "string"
                                                                            }
                                                                        },
                                                                        "required": ["key"],
                                                                        "type": "object"
                                                                    },
                                                                    {
                                                                        "properties": {
                                                                            "key": {
                                                                                "description": "The feature flag key.",
                                                                                "type": "string"
                                                                            },
                                                                            "operator": {
                                                                                "const": "flag_evaluates_to",
                                                                                "default": "flag_evaluates_to",
                                                                                "type": "string"
                                                                            },
                                                                            "type": {
                                                                                "const": "flag",
                                                                                "default": "flag",
                                                                                "description": "Filter events by feature flag state — only include events where a specific flag evaluated to a given value. Examples:\n- Flag enabled: `{ type: \"flag\", key: \"new-onboarding\", operator: \"flag_evaluates_to\", value: true }`\n- Specific variant: `{ type: \"flag\", key: \"checkout-experiment\", operator: \"flag_evaluates_to\", value: \"variant-a\" }`",
                                                                                "type": "string"
                                                                            },
                                                                            "value": {
                                                                                "anyOf": [
                                                                                    {
                                                                                        "type": "boolean"
                                                                                    },
                                                                                    {
                                                                                        "type": "string"
                                                                                    }
                                                                                ],
                                                                                "description": "`true`/`false` for boolean flags, or a variant name string for multivariate flags."
                                                                            }
                                                                        },
                                                                        "required": ["key", "value"],
                                                                        "type": "object"
                                                                    }
                                                                ]
                                                            },
                                                            "type": "array"
                                                        },
                                                        "version": {
                                                            "description": "version of the node, used for schema migrations",
                                                            "type": "number"
                                                        }
                                                    },
                                                    "required": ["id", "name"],
                                                    "type": "object"
                                                }
                                            ]
                                        },
                                        "minItems": 2,
                                        "type": "array"
                                    },
                                    "operator": {
                                        "const": "OR",
                                        "default": "OR",
                                        "description": "Only `OR` is supported.",
                                        "type": "string"
                                    }
                                },
                                "required": ["nodes"],
                                "type": "object"
                            }
                        ]
                    },
                    "type": "array"
                }
            },
            "required": ["series"],
            "type": "object"
        }
    },
    "required": ["source"],
    "type": "object"
}