How to integrate RudderStack to Knock
Knock is a RudderStack Destination, which means you can use events coming through RudderStack to power actions in Knock, such as triggering a workflow.
You can start routing your RudderStack events to Knock by creating a source of type "RudderStack" in the dashboard. From here, you'll be taken to the environment configuration page for the source which will give you unique URLs for each environment you have configured in Knock.
You'll copy this URL and use it to let RudderStack know where to send events.
You will need to create a RudderStack destination for each Knock environment that you want to receive events from RudderStack.
- In your RudderStack workspace, navigate to the "Destinations" page and click "New destination". Search for and select "Webhook".
- Give the destination a name (e.g. "Knock <environment name>") and click "Continue".
- Optionally, choose the sources you want to route into this destination. Then, click "Continue"
- Paste the URL from the Knock dashboard for the Knock environment you want to receive events from RudderStack. Make sure the "URL Method" selected is POST. No other headers or settings are required. Click "Continue".
- Transformations may be configured as needed, but are typically not required. Click "Continue" to finalize the RudderStack destination.
Once your RudderStack destination is set up all events you trigger from the RudderStack source will be forwarded to Knock. Unique events will appear in your list of events under the Source so that you can set up actions to trigger your workflows.
From the source environment configuration page click the "View in environment" button on one of the source environments. You'll be taken to the RudderStack source in the environment you selected and you should see events sent. If you don't, try clicking the refresh button on the top of the list to refetch any incoming events.
Once you have an event in your source's environment you can click into it to show the list of actions it's connected to. To create a new one, click "Create action", which will bring up a selector showing your available workflows. Choose one that will be triggered when Knock receives this event.
Now you'll be able to map the properties of the incoming RudderStack event to the fields of the workflow. Knock will automatically key Recipients and Actor to be the incoming
userId from the event payload, but you can change this to be any key under the
properties field from the RudderStack event. Similarly, you can set the Tenant and Cancellation key to be any of these fields as well.
data.. For example, if your payload looks like this:and you wanted the commenter from the action to appear as the
data.commenter.idto supply their ID as the actor.
Actions triggered by events in Knock are stored in the commit history, just like workflows and email layouts. Once you're happy with the mapping, save it and you can commit it to your development environment right from the action page or from the commit page. Then you can choose to publish this to your other environments.
Actions are automatically enabled when you create them. If you want to stop an event from triggering an action, you can go to the action page and toggle its status to "Inactive". Keep in mind that this will disable that action for the current environment only. When you're ready to trigger the action again, you can set it back to "Active".
When RudderStack sends identify events, Knock will create and update user information accordingly. Knock will correctly map the
name, and any other custom properties over.
To enable handling of identify events, open the settings for the source in the environment. You can then enable or disable handling identify events accordingly.