Reference · Tools

PostHog

Send analytics data to PostHog: create events, identify users, create aliases, and track page/screen views.

Action Analytics v1

The PostHog node sends analytics data into PostHog: creating events, identifying users, creating aliases and tracking page or screen views. A typical build is emitting a server-side event when something happens in a backend workflow that browser tracking would never see.

Node type
Action
Parameters
17
Outputs
Output, Error
Credentials
PostHog API

PostHog

Send analytics data to PostHog: events, identities, aliases, page/screen tracking.

Overview

PostHog is an open-source product analytics platform. This tool sends data to the PostHog Capture and Batch APIs. It supports four resources: Alias (create aliases to link user IDs), Event (create custom analytics events), Identity (identify users with custom properties), and Track (track page views and screen views). The API key is sent in the JSON request body. Supports both PostHog Cloud (https://app.posthog.com) and self-hosted instances. Events are batched into a single /capture request; all other resources send individual payloads to /batch.

Category: Analytics
Tool Name: posthog
Version: 1

Appearance: Icon: si-posthog | Color: #1D4AFF

Node Type

Action — processes input items and produces output

Input / Output

DirectionPort(s)
InputInput
OutputOutput, Error

Credentials

This tool requires PostHog API credentials. See the Credentials Guide for setup instructions.

Resources

ResourceValue
Aliasalias
Eventevent
Identityidentity
Tracktrack

Operations

Each resource has its own Operation list, and three resources share the same operation value (create). Pick the resource first, then the operation.

ResourceOperationValueDescription
AliasCreatecreateCreate an alias
EventCreatecreateCreate an event
IdentityCreatecreateCreate an identity
TrackPagepageTrack a page view
TrackScreenscreenTrack a screen view

Parameters

All fields accept expressions, so you can drive them from the incoming item — {{ $json.userId }} in Distinct ID, for example.

The input item can also supply values directly: if an incoming item’s JSON already carries a distinctId, alias, eventName, name or additionalFields property, that value is used and the corresponding node parameter is ignored for that item. Rename those fields upstream if you want the node’s own settings to win.

Alias: Create

ParameterTypeRequiredDefaultDescription
AliasstringYesThe name of the alias to create.
Distinct IDstringYesThe user’s distinct ID.
Additional FieldscollectionNo{}Optional context and timestamp for the alias event.
— Context (contextUi)fixedCollectionNo{}Context properties sent with the event. Add as many key/value pairs as you need.
— — KeystringNoName of the context property.
— — ValuestringNoValue of the context property.
— TimestampstringNoIf not set, it will automatically be set to the current time. Use ISO 8601 format.

Event: Create

ParameterTypeRequiredDefaultDescription
EventstringYesThe name of the event (e.g., “purchase”, “signup”).
Distinct IDstringYesThe user’s distinct ID.
Additional FieldscollectionNo{}Optional event properties and timestamp.
— Properties (propertiesUi)fixedCollectionNo{}Event properties. Add as many key/value pairs as you need.
— — KeystringNoName of the event property.
— — ValuestringNoValue of the event property.
— TimestampstringNoIf not set, it will automatically be set to the current time. Use ISO 8601 format.

Identity: Create

ParameterTypeRequiredDefaultDescription
Distinct IDstringYesThe identity’s distinct ID.
Additional FieldscollectionNo{}Optional person properties, message ID and timestamp.
— Properties (propertiesUi)fixedCollectionNo{}Person properties to set on the identity. Add as many key/value pairs as you need.
— — KeystringNoName of the person property.
— — ValuestringNoValue of the person property.
— Message IDstringNoOptional message identifier.
— TimestampstringNoIf not set, it will automatically be set to the current time. Use ISO 8601 format.

Track: Page

ParameterTypeRequiredDefaultDescription
NamestringYesThe name of the page or screen.
Distinct IDstringYesThe user’s distinct ID.
Additional FieldscollectionNo{}Optional category, context, message ID, properties and timestamp.
— CategorystringNoCategory for the page or screen.
— Context (contextUi)fixedCollectionNo{}Context properties sent with the event. Add as many key/value pairs as you need.
— — KeystringNoName of the context property.
— — ValuestringNoValue of the context property.
— Message IDstringNoOptional message identifier.
— Properties (propertiesUi)fixedCollectionNo{}Event properties. Add as many key/value pairs as you need.
— — KeystringNoName of the event property.
— — ValuestringNoValue of the event property.
— TimestampstringNoIf not set, it will automatically be set to the current time. Use ISO 8601 format.

Track: Screen

ParameterTypeRequiredDefaultDescription
NamestringYesThe name of the page or screen.
Distinct IDstringYesThe user’s distinct ID.
Additional FieldscollectionNo{}Optional category, context, message ID, properties and timestamp.
— CategorystringNoCategory for the page or screen.
— Context (contextUi)fixedCollectionNo{}Context properties sent with the event. Add as many key/value pairs as you need.
— — KeystringNoName of the context property.
— — ValuestringNoValue of the context property.
— Message IDstringNoOptional message identifier.
— Properties (propertiesUi)fixedCollectionNo{}Event properties. Add as many key/value pairs as you need.
— — KeystringNoName of the event property.
— — ValuestringNoValue of the event property.
— TimestampstringNoIf not set, it will automatically be set to the current time. Use ISO 8601 format.

All Operations

ParameterTypeRequiredDefaultDescription
Max ConcurrencynumberNo10Maximum number of items to process concurrently.

Output Data

Every operation produces one output item per input item, and no operation fans out. The PostHog response is merged onto the input item’s JSON at the top level, so the item keeps the fields it arrived with and gains the response fields; a response field with the same name as an existing item field overwrites it. Binary data on the input item is forwarded.

These are ingestion endpoints, so the response is an acknowledgement rather than a record — typically:

{
  "status": 1
}

Use the merged item to carry your own upstream fields forward ({{ $json.userId }} still resolves after the node), not to read anything back from PostHog. Nothing about the created event, identity or alias is returned.

Event: Create collects the events from every input item and sends them as a single batched request. Each input item still gets its own output item, and they all carry the same batch acknowledgement. If that one request fails, every item in the batch fails together.

The Alias, Identity and Track operations send one request per item and succeed or fail independently.

Usage Examples

  • Create a custom event in PostHog for a user action
  • Identify a user with custom properties like name and email
  • Create an alias to link two distinct user IDs
  • Track a page view for a user
  • Track a screen view for a mobile app user

Example Configuration

Link a second identifier to an existing user:

{
  "type": "posthog",
  "parameters": {
    "resource": "alias",
    "operation": "create",
    "alias": "user-alias-123",
    "distinctId": "user-456",
    "additionalFields": {
      "contextUi": {
        "contextValues": [
          { "key": "device", "value": "mobile" }
        ]
      },
      "timestamp": "2026-01-15T10:30:00Z"
    }
  }
}

Record a purchase event with its own properties:

{
  "type": "posthog",
  "parameters": {
    "resource": "event",
    "operation": "create",
    "eventName": "product_purchased",
    "distinctId": "user-789",
    "additionalFields": {
      "propertiesUi": {
        "propertyValues": [
          { "key": "product_id", "value": "prod-123" },
          { "key": "price", "value": "29.99" }
        ]
      },
      "timestamp": "2026-01-15T14:25:00Z"
    }
  }
}

Track a click driven entirely by upstream data:

{
  "type": "posthog",
  "parameters": {
    "resource": "event",
    "operation": "create",
    "eventName": "button_clicked",
    "distinctId": "{{ $json.userId }}",
    "additionalFields": {
      "propertiesUi": {
        "propertyValues": [
          { "key": "button_name", "value": "{{ $json.buttonName }}" }
        ]
      }
    }
  }
}

Set person properties on a user:

{
  "type": "posthog",
  "parameters": {
    "resource": "identity",
    "operation": "create",
    "distinctId": "{{ $json.userId }}",
    "additionalFields": {
      "propertiesUi": {
        "propertyValues": [
          { "key": "email", "value": "{{ $json.email }}" },
          { "key": "plan", "value": "{{ $json.subscriptionPlan }}" }
        ]
      },
      "messageId": "identity-msg-789"
    }
  }
}

Track a web page view:

{
  "type": "posthog",
  "parameters": {
    "resource": "track",
    "operation": "page",
    "name": "{{ $json.pageName }}",
    "distinctId": "{{ $json.userId }}",
    "additionalFields": {
      "category": "Navigation",
      "contextUi": {
        "contextValues": [
          { "key": "referrer", "value": "{{ $json.referrer }}" }
        ]
      },
      "propertiesUi": {
        "propertyValues": [
          { "key": "path", "value": "{{ $json.path }}" },
          { "key": "title", "value": "{{ $json.title }}" }
        ]
      }
    }
  }
}

Track a mobile screen view:

{
  "type": "posthog",
  "parameters": {
    "resource": "track",
    "operation": "screen",
    "name": "Settings Screen",
    "distinctId": "mobile-user-303",
    "additionalFields": {
      "category": "App Navigation",
      "contextUi": {
        "contextValues": [
          { "key": "app_version", "value": "2.1.0" }
        ]
      },
      "messageId": "screen-msg-789",
      "propertiesUi": {
        "propertyValues": [
          { "key": "screen_class", "value": "SettingsViewController" }
        ]
      },
      "timestamp": "2026-01-15T16:20:00Z"
    }
  }
}

Error Handling

ModeBehavior
stopHalts workflow on first error
continueSkips failed items, passes successful ones through
errorPortRoutes failed items to Error output port

Tips

Send analytics events, user identities, aliases, and page/screen tracking data to PostHog.

Frequently asked questions

Why send events from a workflow rather than the client?

Because backend events — a payment settling, a job completing, an approval landing — never happen in a browser, so client-side tracking cannot see them at all.

What is an alias for?

Linking two identifiers for the same person, typically merging an anonymous pre-signup identity with the known user afterwards so their history stays continuous.

Does identifying a user create them?

Identify attaches properties to a distinct ID, which is how PostHog builds the person record — so it both creates and enriches depending on whether the ID is new.

Which credential does it need?

A PostHog API credential for the project you are sending to.

Build with the PostHog node

Drop it into a workflow, wire it to an agent, or call it on a schedule. You'll need PostHog API credentials first.

Open BusyBot

Last updated . Spotted something wrong? Tell us.