How to set up a Webhook trigger (for is an automation tool that lets you automate actions across Slack, and many other apps.
Slack logo

Add a webhook trigger

🙋 A more generic version of this tutorial can be found here.

First, add a webhook trigger by clicking 'Add trigger' and then 'Incoming webhook'


Copy the webhook URL

Next, we're going to prepare the setup of the Formspark form. You'll want to copy the unique URL that will trigger this playbook. You can find that URL in the Usage section in the side panel.

Every webhook trigger requires a secret token (secretToken) to be sent as part of the request. It is recommended to send this token as part of the JSON body in the POST request. However, it's also possible to provide it as a URL parameter.

Note: it is important to keep this token secret. Everybody with this token and the URL of the playbook will be able to trigger runs of your playbook.

For our Formspark integration, we'll put the token in the URL so that it won't leak to anyone that can view a (potentially public) Formspark form. Click the icon to copy the URL.


Set up a Formspark form - part 1

In the Formspark UI, we'll create a new form. We'll paste our URL in the Webhook URL field.


Set up a Formspark form - part 2

Now it's time to create a form. We're just going to use an example provided by Formspark, which you can find in the How-to tab on top of the page. We'll take the Contact form example, and click Copy to clipboard.


For an alternative (manual) way of configuring a webhook trigger, go to step 5b

The easiest way to set up the Webhook trigger in Relay, is by sending a test request. Relay will automatically infer all the parameters that came with the webhook, and populate them in the webhook configuration. This is by far the recommended way of setting up a webhook trigger.

Note: you can only use this approach if you haven't added any parameters manually (see step 5b) and the playbook is (still) turned Off.

To send a test request, we'll paste the HTML of the example Contact form on, and we'll submit it with some test values. Of course is just one of the many ways how you can submit the example form.

You'll notice back in Relay that the parameters of the webhook have been filled in automagically!


(Alternative) Configure the webhook trigger manually

If sending a test request to the webhook trigger (step 5a) is not possible, you can enter parameters manually.

Make sure to pay attention to the data type and name of each parameter. They should exactly match what you're sending over.


Add the Slack automation

Now that the trigger is set up, let's add a Slack automation that sends the form response to a channel.

Reference data fields from the webhook trigger by clicking the Insert menu using the @-key keyboard shortcut.


Turn on the playbook

Almost done! Now turn on the playbook so that it will start accepting webhook requests


Test the playbook!

And finally, let's test our playbook. We'll just submit the same form again in Codepen, and when you go back to Relay you'll notice in the Runs tab that a run has been kicked off and the Slack message has been sent.

Watch the demo

What will you automate?

Sign up and get started with your first workflow today.
Background imageBackground image