Resources · n8n integration

PostHog n8n integrationAutomate PostHog with n8n.

Product analytics is only as good as the events that reach it. The PostHog n8n integration handles that last hop: 5 operations spread over 4 resources create an event, an alias or an identity, and track a page or a screen. PostHog ships no trigger node, so the workflow starts somewhere else.

Verified Trustpilot reviews · AI, automation & growth agency

Why automate

What does the PostHog n8n integration cover?

The PostHog node is a writer. It takes an item running through your workflow and turns it into something PostHog can store: an event with a name and properties, an identity, an alias, or a tracked page or screen. Each call needs a distinct ID, the value PostHog uses to tell one user from another. The node is built into n8n, and the credential you create for it is reused by every workflow in the instance.

Start with the case most teams hit first: an event that never existed in the browser. A payment confirmed by a backend job, a contract signed inside a CRM, a support ticket closed by an agent. None of that fires from a page, so nothing lands in PostHog. A workflow that already receives the payload calls event.create, names the event, attaches the distinct ID, and the funnel finally shows the step.

Second case: identity work at the edges of your product. The identity.create operation writes an identity from a distinct ID, and alias.create records an alias name against that same distinct ID. Workflows that read from a spreadsheet or an inbox are a natural fit here, since a batch coming from Google Sheets or an alert routed through Slack often carries the identifier long before the product does.

Third case: page and screen tracking driven from the server. track.page and track.screen each take a Name and a distinct ID, which makes them useful when the view happens somewhere a client-side snippet does not run. Teams already sending the same stream to Segment or Google Analytics can fan out from one workflow instead of wiring three integrations by hand.

Now the honest part. The catalog is 5 operations across 4 resources, and that is the whole surface of the node. Anything else in the PostHog API is reached with the HTTP Request node, which calls any endpoint of the tool while reusing the same credential through predefined authentication. It is not a downgrade, just a different node in the same canvas.

The other thing to plan around: PostHog has no trigger node in n8n. A workflow that concerns it starts with a Schedule Trigger on a fixed interval, with the n8n Webhook node called by another service, or with the trigger of another tool. The public n8n library has a template built exactly that way, 968, which creates a PostHog event when a request hits a webhook URL. If you want the wider picture on the platform before wiring anything, there is the n8n review, and the n8n training for building these workflows yourself.

Connect

How do you connect PostHog to n8n?

  1. 01

    Get the API key that matches your endpoints

    You need a PostHog account, or PostHog hosted on your own server. The key depends on what the node will reach. For public POST-only endpoints, take a Project API key from your project's General settings. For private endpoints, take a Personal API key from the Personal API Keys section of your user account settings. They are two different keys from two different screens, so grab the one your workflow actually needs.

  2. 02

    Pick the right API URL

    The credential asks for an URL, and the correct domain depends on where your project lives. On US Cloud, use https://us.i.posthog.com for public POST-only endpoints or https://us.posthog.com for private ones. On EU Cloud, the pair is https://eu.i.posthog.com and https://eu.posthog.com. On a self-hosted instance, use your own domain. Checking the URL of your PostHog instance confirms which one you are on.

  3. 03

    Save the credential once in n8n

    Open the Credentials menu in n8n, create the PostHog credential, and fill the URL and API Key fields. A credential is created once and reused by every workflow in the instance, so you do this on day one and never again. Drop a PostHog node on the canvas and the credential shows up in its dropdown, ready to select. Same steps on n8n Cloud and on a self-hosted instance.

Actions

What can the PostHog node do?

The PostHog node exposes 5 operations across 4 resources. For each one: the node as you configure it in n8n, the required fields, and our field notes.

Resources × operations matrix
ResourceCreatePageScreen
Alias✓
Event✓
Identity✓
Track✓✓

Alias

1 operation
01

Create an alias

alias.create

What you see in n8n

Notes & use cases

Records an alias name against a user you already track by distinct ID. One item in, one alias stored in PostHog.

Key parameters

  • Alias: the name of the alias. Required, and it can be typed in the node or pulled from the incoming item with {{ $json.field }}.
  • Distinct ID: the user's distinct ID. Also required, and a required field left empty stops the node before the call goes out.
  • Timestamp: sits in Additional Fields. Left unset it is automatically set to the current time, which matters when you replay a backlog.
Use cases
an onboarding workflow receiving a new account with two identifiers writes the second one here, right after the account is created.

Event

1 operation
02

Create an event

event.create

What you see in n8n

Notes & use cases

The workhorse of the node. It sends one named event to PostHog for one user, so a step that happens outside the browser still shows up in your funnels.

Key parameters

  • Event: the name of the event, required. This is the label you will look for in PostHog, so keep it stable across runs.
  • Distinct ID: the user's distinct ID, required. It usually comes from the previous node, written as {{ $json.field }}.
  • Properties: an Additional Fields collection with an Add Property button, one row per property you want carried with the event.
Use cases
an invoice marked as paid in a finance workflow becomes an event with the plan and the amount as properties.

Identity

1 operation
03

Create an identity

identity.create

What you see in n8n

Notes & use cases

Only one field is truly needed here: the identity's distinct ID. That makes it the cheapest call of the five, and a good first node when a workflow discovers a person before the product does.

Key parameters

  • Distinct ID: the identity's distinct ID, required and the only mandatory field of the operation.
  • Properties: in Additional Fields, with the same Add Property pattern used elsewhere in the node.
  • Timestamp: also optional. Unset means the current time is used automatically.
Use cases
a nightly import of new records from a CRM creates the identity first, then the rest of the workflow can attach events to it.

Track

2 operations
04

Track a page

track.page

What you see in n8n

Notes & use cases

Registers a page view in PostHog from the workflow instead of from a browser. Useful whenever the page is served somewhere a client-side snippet never runs.

Key parameters

  • Name: required, the name of the page being tracked.
  • Distinct ID: the user's distinct ID, required, so the view is attached to someone rather than floating on its own.
  • Properties: available in Additional Fields through Add Property, one row per property.
Use cases
a gated document served by your own backend gets tracked at delivery time, with the reader's distinct ID taken from the request that asked for it.
05

Track a screen

track.screen

What you see in n8n

Notes & use cases

Same idea, different surface: this one records a screen rather than a page, and takes the screen name plus the person it belongs to.

Key parameters

  • Name: required, the name of the screen being tracked.
  • Distinct ID: the user's distinct ID, required.
  • Timestamp: optional, in Additional Fields. When it is not set, the current time is used, so pass a value when the screen was reached earlier than the workflow run.
Use cases
a batch of app activity arriving through a queue is replayed into PostHog screen by screen, each item carrying its own timestamp.
Need help

Need help automating PostHog with n8n?

A person reads every message.

FAQ

PostHog and n8n, the questions that come up

01Is the PostHog n8n integration free?
Yes on the n8n side. The PostHog node ships with n8n, so there is nothing to install and no extra cost to add it, whether you run n8n Cloud or a self-hosted instance under the Community Edition and its Sustainable Use license. A workflow built on one runs the same way on the other, which means you can prototype on Cloud and move later without rewriting nodes. What you connect to on the PostHog side is your own account or your own server, and that part is between you and PostHog. Inside n8n, the only thing the node costs you is the time to create the credential once.
02What credentials do you need for the PostHog node?
An API key credential, and the right one for the endpoints you call. PostHog credentials in n8n take two values: the API URL and the API Key. For public POST-only endpoints, use a Project API key from your project's General settings. For private endpoints, use a Personal API key from the Personal API Keys section of your user settings. The URL follows the same split: on US Cloud, us.i.posthog.com for public POST-only endpoints and us.posthog.com for private ones, with the eu equivalents on EU Cloud, or your own domain if you host PostHog yourself. You need a PostHog account or a self-hosted instance before any of this.
03What are the limits of the PostHog node in n8n?
The node exposes 5 operations across 4 resources: Alias, Event, Identity and Track. That is what you get out of the box, and every one of those calls needs a distinct ID. When the endpoint you want is not in that catalog, the HTTP Request node calls any endpoint of the PostHog API while reusing the same credential through predefined authentication, so nothing is actually blocked, it just moves to another node. The other limit worth planning for is the absence of a trigger, covered in the next question. Everything else depends on how your own workflow feeds the node.
04Does PostHog have a trigger node in n8n?
No. PostHog has no trigger node in n8n, so a workflow that concerns it always starts somewhere else. Three options cover almost everything. A Schedule Trigger runs the workflow on a fixed interval, which fits imports and nightly batches. The n8n Webhook node gives you a URL that a third-party service calls, which is how template 968 in the n8n library creates a PostHog event when a request reaches that URL. Or you start from the trigger of another tool, and the PostHog node becomes one step further down the workflow. Pick based on who knows first that something happened.
05n8n or Make for PostHog?
It depends on four things, and price is only one of them. Hosting: n8n runs self-hosted with Docker or npm, or on n8n Cloud, while Make is hosted only. Data control follows from that, since a self-hosted n8n keeps the payloads you push to PostHog inside your own infrastructure. Cost model: Make bills per operation, which is worth simulating if your workflow creates one event per item on a large batch. Visual logic: both are canvas tools, and the right answer is usually whichever one your team reads faster. The decision here is about the platform you want to live in, not about this particular integration.