Integrations
Sources
PostHog

PostHog source

Receive PostHog webhook events in Knock to trigger workflows and automate actions based on product analytics events.

The PostHog source enables you to receive PostHog webhook events directly in Knock. PostHog sends webhook callbacks when actions fire in your product analytics, such as a user completing a key funnel step, a feature flag change, or a custom event you define. Knock verifies each payload, identifies the event type, and executes the actions you configure.

This integration is useful for building notifications triggered by product behavior: reaching out to users who complete onboarding milestones, alerting your team when a feature flag is changed, or triggering re-engagement workflows based on usage patterns.

Knock supports ingesting any of PostHog's supported events, so you can map them to actions as your needs evolve.

Prerequisites

#

Getting started

#
1

Create the source in Knock

Navigate to Platform > Sources in the Knock dashboard. Make sure you're in the correct environment. Select the PostHog template as the source type.

The Sources page in the Knock dashboard
2

Select default action mappings

Once you've selected PostHog as a source, you can select your desired action mappings. The defaults map PostHog events like $identify and $set to identify users in Knock. These are helpful defaults to get you started, but Knock can ingest any event PostHog sends and you can adjust your mappings at any time. Click the Connect PostHog button to continue.

The PostHog source creation modal showing default action mappings for incoming events
3

Copy the webhook URL

After creating the source, copy the event ingestion URL from the setup wizard. You will paste this into PostHog in the next steps.

The PostHog source setup wizard showing the event ingestion URL to copy
4

Create a Knock destination in PostHog

In PostHog, navigate to Data pipelines and click New destination. Search for "Knock" and click Create on the Knock destination.

The PostHog Data pipelines page showing the Knock destination in the new destination search results
5

Configure the Knock destination

On the Knock destination configuration page, paste the Knock event ingestion URL into the Knock.app webhook destination URL field. Set the User ID field to the property that maps to your Knock user IDs (for example, {person.id}). You can optionally configure filters to limit which events are sent, add event matchers to target specific actions, and set up attribute mappings. When ready, click Create & enable.

The PostHog Knock destination configuration page showing webhook URL, User ID, filters, and event matchers

Once configured, PostHog sends events to Knock based on your destination filters and event matchers. You can verify that events are arriving by checking the event logs on the source environment page.

Pre-configured events

#

PostHog webhook events are driven by the actions and events you configure in your PostHog project. Common scenarios include:

Event typeDescription
Action webhooksFired when a PostHog action matches (for example, a user clicks a specific button or views a key page)
Custom eventsFired when your application sends a custom event to PostHog that matches your webhook criteria
Feature flag changesFired when a feature flag is updated

The exact event types depend on how you configure your PostHog actions and webhook destinations. See the PostHog events documentation for more details on available event types and payload formats.

Customization

#

You can modify the default action mappings or add new ones for any event type Knock receives from PostHog. For details on how field mapping works with dot-notation paths, see the custom source page.

If you need to map PostHog events to actions beyond triggering workflows, see the full list of available actions in the sources overview.

Event idempotency

#

Knock automatically configures idempotency for the PostHog source so duplicate events are not processed twice. By default, Knock uses body.messageId from the PostHog webhook payload as the idempotency key.

You can change the idempotency key field or disable idempotency checks from the Settings tab in your source environment configuration. Events without an idempotency key attribute are processed normally.

For details on how Knock handles idempotent events, key validation rules, and the default 24-hour idempotency window, see the source event idempotency section of the sources overview.

New chat