Workflows
Blocks
Integrations
PostHog

PostHog

The PostHog block connects your workflows to PostHog product analytics — capture events, identify users and groups, evaluate feature flags, and read data back with HogQL queries.

Analytics In, Analytics Out: Track what happens inside your workflows (orders, sign-ups, bot conversations), branch on feature flags, and pull analytics results into agents and reports.

Key Features

  • Event Capture: Send custom events with properties from any workflow step
  • User Identity: Identify users, merge aliases, and set person properties
  • Feature Flags: Evaluate flags per user and branch your workflow on the result
  • Data Read-back: Run HogQL queries and list events, persons, insights, and cohorts
  • Annotations: Mark releases or incidents on your PostHog charts

Operations

Capture & Identity

OperationDescription
Capture EventSend an event for a distinct ID with optional JSON properties and timestamp
Identify UserSet person properties ($set), with optional set-once properties ($set_once)
Create AliasMerge another distinct ID into the same user
Group IdentifySet properties on a group (e.g. group type company, key acme-inc)

Feature Flags

OperationDescription
Evaluate Feature FlagsEvaluate all flags for a user, or one flag key → returns enabled, value, payload
Get Feature Flag PayloadFetch the payload attached to a flag
List Feature FlagsList the project's feature flags

Analytics & Persons

OperationDescription
Query (HogQL)Run a HogQL SQL query → returns columns, results, records, count
List EventsList recent events, filterable by name, distinct ID, and time range
List InsightsList saved insights
List CohortsList cohorts
Create AnnotationAdd an annotation (text + date) to your project
List PersonsList persons, with search
Get PersonFetch one person by person ID or distinct ID
Delete PersonPermanently delete a person

Configuration

ParameterTypeRequiredDescription
CredentialsSelectYesYour saved PostHog connection
ActionSelectYesOne of the operations above
Distinct IDTextFor capture/identity/flagsThe user identifier — supports {{variables}}
Event NameTextFor Capture Evente.g. order_completed
PropertiesJSONNoEvent or person properties, e.g. {"amount": 49, "channel": "whatsapp"}
Flag KeyTextFor flag opsThe feature flag to evaluate
QueryTextFor HogQLThe HogQL SQL query
Limit / Offset / Search / Before / AfterTextNoFilters for list operations

Connecting your PostHog account

  1. In Indite, add the PostHog block and click Connect new.
  2. Fill in the credential fields:
FieldWhere to find itNeeded for
Hosthttps://us.i.posthog.com, https://eu.i.posthog.com, or your self-hosted URLEverything
Project API Key (phc_...)PostHog → Project SettingsCapture, identify, alias, group identify, feature flags
Personal API Key (phx_...)PostHog → Account → Personal API KeysHogQL, events, persons, insights, cohorts, annotations
Project IDThe numeric ID in Project SettingsSame operations as the Personal API Key
⚠️

The Personal API Key and Project ID are optional, but without them the private-API operations (HogQL, persons, insights, cohorts, annotations, list flags) will fail. Capture and flag evaluation work with just the Project API Key.


Output

Reference fields in later blocks with {{<blockId>.<field>}}.

OperationOutput
Capture / Identify / Alias / Group IdentifyThe PostHog API acknowledgment
Evaluate Feature Flags (one key)flagKey, enabled (boolean), value, payload
Evaluate Feature Flags (all)featureFlags, featureFlagPayloads objects
Query (HogQL)columns, results (rows), records (rows as objects), count
Get Person / list operationsThe person object or an array of results

Example: track WhatsApp orders

  1. WhatsApp Trigger — a customer completes an order in your bot.
  2. PostHog → Capture Event — Distinct ID {{whatsapp.from}}, Event Name order_completed, Properties {"amount": {{order.total}}, "channel": "whatsapp"}.
  3. PostHog → Evaluate Feature Flags — flag key new-upsell for the same distinct ID.
  4. Condition — if {{posthog.enabled}} is true, send the new upsell message; otherwise send the standard confirmation.
Indite Documentation v1.7.1
PrivacyTermsSupport