Integrations
Sources
Overview

Sources in Knock

Learn how to connect external services to Knock using incoming webhooks and CDP or reverse ETL integrations.

Sources connect external services to Knock so that events from those services can drive actions such as triggering workflows, identifying users, and managing objects and tenants. Knock supports a few approaches for ingesting events from external services:

  • Incoming webhooks. Receive webhook events from services like Stripe, Clerk, or your own applications and map them to actions in Knock. Knock provides pre-built integrations for popular services and a custom webhook option for any service that can send HTTP callbacks.
  • CDP integrations. Send track and identify events from platforms like Segment and RudderStack into Knock to trigger workflows and keep user data in sync.
  • Reverse ETL integrations. Sync warehouse data from platforms like Hightouch and Census into Knock using direct API calls or embedded destinations.

Incoming webhook sources

#

Incoming webhook sources receive webhook events from external services and map them to actions inside Knock. When Knock receives a webhook event, it verifies the payload signature, identifies the event type, and executes the actions you have configured for that event.

SourceDescription
ClerkAuth and user management events
PostHogProduct analytics action and event webhooks
StripePayment and subscription lifecycle events
SupabaseDatabase webhook events
WorkOSDirectory sync and SSO events
HTTPCustom webhooks from any service

Pre-built integrations vs. custom webhooks

#

Knock offers pre-built integrations for popular services such as Clerk, Stripe, PostHog, Supabase, and WorkOS. These integrations provide automatic signature verification and pre-configured event types. For any service that can send HTTP callbacks, you can use the HTTP source to create a custom webhook integration with full control over event type identification and field mappings.

CDP sources

#

CDP sources send track and identify events from customer data platforms into Knock. Use a CDP source when you already have event instrumentation in a platform like Segment or RudderStack and want to use those events to trigger workflows and keep user data in sync without additional API calls from your application.

SourceDescription
SegmentCustomer data platform
RudderStackCustomer data platform
JitsuOpen-source data pipeline
FreshpaintHealthcare-focused CDP

Reverse ETL sources

#

Reverse ETL sources sync warehouse data into Knock using direct API calls or embedded destinations. Platforms like Hightouch, Census, and Polytomic can push user, object, and tenant data from your data warehouse into Knock on a scheduled basis.

SourceDescription
HightouchReverse ETL
CensusReverse ETL
PolytomicReverse ETL

Need us to support another platform? Let us know.

Configuring sources

#

You can configure sources from the Integrations > Sources page in your account settings. Initial creation of a source is managed at the account level of your Knock account, though you configure specific events and their actions within your Knock environments.

A screenshot of where to find the Integrations - Sources page for your account

Per-environment source configuration

#

Each source has a unique configuration for every Knock environment in your account. This makes it possible to connect your development source environment to your Knock development environment. If you click on a source, you will see each environment configuration for that source.

A view of the environment configurations for a source in a Knock account

Triggering actions from source events

#

When a source event is received, you can configure Knock to execute any of the following actions:

ActionDescription
Trigger workflowStart a workflow run for one or more recipients
Cancel workflowCancel an in-progress workflow run
Identify userCreate or update a user in Knock
Subscribe userAdd a user to an object's subscribers list
Unsubscribe userRemove a user from an object's subscribers list
Set objectCreate or update an object
Delete objectRemove an object
Set tenantCreate or update a tenant
Delete tenantRemove a tenant
Add audience memberAdd a member to an audience
Remove audience memberRemove a member from an audience

Event-to-action mapping

#

After events start flowing into Knock you can configure mappings that tell Knock which action to run and how to populate its parameters. Mappings use dot-notation paths to extract values from the incoming payload and map them to the fields required by each action.

For example, given a payload like:

You could map data.object.customer to the recipients field when triggering a workflow.

For full details on configuring custom event types and field mappings, see the HTTP source page.

Debugging source events

#

In some cases, you may need to debug source event connections to ensure your integration is sending the correct payloads to Knock.

Event logs

#

Event logs show the contents of each event sent into Knock.

Action logs

#

Action logs describe what (if any) action Knock took after receiving an event. Action logs are a helpful starting point when troubleshooting workflows or auditing actions Knock has taken for any given event.

Source event idempotency

#

By default, Knock processes every valid event received from your source. You can enable idempotency checks to deduplicate events that have already been received and processed. This is useful if you know your source may send duplicate events.

Idempotency configuration varies by source type. For pre-built webhook integrations, Knock auto-configures the idempotency key. For CDP sources and custom webhooks, you may need to enable idempotency and verify the key field. See your individual source page for setup details.

Key validation

#

Your idempotency keys must be valid strings no more than 255 characters in length. If an invalid key is found, Knock still ingests your source event but will not attempt to execute your event idempotently. In addition, Knock drops the invalid idempotency key and you will not see it appear in your event logs.

How Knock handles idempotent events

#

When Knock executes a source event with an idempotency key, it first checks whether a preceding execution should be replayed. Knock finds a preceding execution if it is recorded within the idempotency window with the same:

  • Idempotency key value
  • Event type
  • Integration source configuration
  • Knock environment in your account

If no preceding execution is found, Knock executes your event normally and records that execution for future replay by the same idempotency key. However, if Knock fails to execute your source event, it will not record the execution. Knock only records successful event executions for idempotent replay.

If Knock replays an event via an idempotency check, you will still see an event log for that execution. However, the log will not have any actions associated and Knock will label it as idempotent.

New chat