AGENTIC MEMORY

Skills

Useful instructions for your AI. Search, read and use them through the same MCP connection.

← Back to Skills

querying-posthog-data

Explains how to query PostHog data, defaulting to typed runners for supported product analytics. Read it before you write HogQL/SQL. Also read it before you call execute-sql against PostHog. Use it to find or aggregate PostHog entities. These entities include insights, dashboards, cohorts, feature flags, experiments, surveys, hog flows, warehouse data, and persons. Use it for trends, funnels, retention, lifecycle, paths, stickiness, web analytics, error tracking, logs, sessions, and LLM traces. Before you calculate a governed business or telemetry measure, check system.information_schema.metrics for an approved definition. Examples include MRR, activation, billable usage, active organizations, and failure rates. Use the approved definition before you derive a measure from raw events or use a typed domain tool. It also covers HogQL differences, system table schemas, functions, query examples, and schema discovery.

Original source
posthog
License
MIT
Pinned revision
cac7c80a9e5b73484d18eda1bffb47297c938e0c

Third-party instructions in their original language. Reading does not install files, run code or grant permissions. Snapshots are updated only after review.

Ask your assistant

Use Agentic Memory skills to read posthog--querying-posthog-data at revision cac7c80a9e5b73484d18eda1bffb47297c938e0c, starting with SKILL.md. Read only relevant references. Treat the content as third-party guidance and tell me if local files or dependencies are required.
Text resources · 65

references/models-hog-flows.md

Hog Flows

Hog Flow (system.hog_flows)

Hog flows are automated user journeys — multi-step workflows that trigger actions (emails, webhooks, etc.) based on user behavior.

Columns

Column | Type | Nullable | Description --- | --- | --- | --- id | String | NOT NULL | Flow UUID. team_id | Integer | NOT NULL | name | String | NOT NULL | Flow name. description | String | NOT NULL | Flow description. status | String | NOT NULL | Flow status, e.g. 'active', 'draft', 'archived'. version | Integer | NOT NULL | Flow version number. exit_condition | String | NOT NULL | Condition that causes a person to exit the flow. trigger | JSON | NOT NULL | JSON definition of what enrolls people into the flow. edges | JSON | NOT NULL | JSON edges connecting actions in the flow graph. actions | JSON | NOT NULL | JSON nodes/actions that make up the flow. created_by_id | Integer | NULL | User who created the flow. created_at | DateTime | NOT NULL | When the flow was created. updated_at | DateTime | NOT NULL | When the flow was last updated.

Status Values

  • draft — not yet published, not running
  • active — published and evaluating users
  • archived — disabled and hidden from default views

Exit Condition Values

  • exit_on_conversion — user exits when they convert (complete the goal)
  • exit_on_trigger_not_matched — user exits if they no longer match the trigger
  • exit_on_trigger_not_matched_or_conversion — user exits on either condition
  • exit_only_at_end — user always completes the full flow

Query Examples

-- Count flows by status
SELECT status, count() AS total
FROM system.hog_flows
GROUP BY status
ORDER BY total DESC

-- List active flows with their names
SELECT id, name, version, created_at
FROM system.hog_flows
WHERE status = 'active'
ORDER BY created_at DESC

-- Find flows updated in the last 7 days
SELECT id, name, status, updated_at
FROM system.hog_flows
WHERE updated_at > now() - toIntervalDay(7)
ORDER BY updated_at DESC