Incoming webhooks trigger
  • 11 Jul 2022
  • 4 Minutes to read
  • Dark
    Light

Incoming webhooks trigger

  • Dark
    Light

With the incoming webhook trigger for automations, you can connect Airtable with many of the tools and products that you and your team use (whether a third-party service or an internal tool).

Normally, you’d have to write custom code and spin up your own infrastructure in order to handle webhooks, but now, whenever an event fires in another product, you can tap into the full power of Airtable Automations to handle it accordingly.

An introduction to webhooks

The incoming webhook trigger will create a unique URL that you can use to trigger an Airtable automation. You can use this URL with another service’s webhook configuration UI, or use it directly from your own custom code (e.g. from an internal tool). When Airtable receives a request at this URL, we’ll then trigger the automation that you configured (just like our other triggers).

This enables you to integrate with services that Airtable doesn’t currently support, or to programmatically trigger automations, preventing you from having to write custom code or manage your own infrastructure.

360104464473Webhooksflow-Frame1.jpg

your title goes here

Remember that anyone who has the URL for your webhook trigger can trigger your automation. We recommend thinking carefully about how and where this URL might be shared.

Choose the incoming webhooks trigger

To start, click on “Automations” in the upper right corner of your base. Then, click “Create an automation” to begin the setup process. You can then select the “When webhook received” trigger from the list of available options.

Once you’ve selected the trigger you’ll be taken to a new screen that displays your unique webhook URL and other information.

6615685168151whenwebhookreceivedtriggerempty.jpg

Send an example webhook

To set up your webhook you’ll first need to send an example webhook to the unique URL created for you. How you send an example webhook to this address depends on the application that you’re connecting to. We’ve included an example demonstration below if you’d like to a step-by-step guide to sending an example webhook.

Sending an example webhook

Start by visiting https://reqbin.com/. Paste the webhook URL (generated by Airtable) into the textbox near the top of the screen. Then, select the “Post” option. Paste your webhook URL into the text box and select the POST option.

1500003343821enterwebhook.png

Next, click the “Content tab” directly underneath where you pasted your webhook URL.

1500003290382addcontent.png

You can send over any JSON object in the test, but for sake of example we’ll use a simple object: {"Company": "Airtable"}. Once you’ve entered your JSON object you can click the blue “Send” button to send a POST request to the Airtable webhook.

1500003343921sendexample.gif

After you send the example webhook, you should receive a success or failure message.

Successful requests

As noted in the trigger, if your example webhook is successful you should receive a response of {“success”: true}. If you received this success response you can continue on to the next section, Test the webhook.

Failed requests

If your request failed there are a few things things to help troubleshoot:

  • Check that you sent a valid JSON payload. A tool like https://jsonlint.com may be useful.
    • To add multiple variables, make sure you properly format your content as a JSON object ( i.e. {"Company": "Airtable", "Name": "Testing"}).
  • Check that your request was sent with a Content-Type header of "application/json".
  • Check that you made a POST request.

Test the webhook

Once you’ve received a successful response for the example webhook, you need to test the webhook directly in the Airtable automation. Click the “Run test” button to start the test; you’ll receive a “Test ran successfully” message after the test is complete.

360104331313runtest.gif

After running a successful test you can now add an automation action to make use of the data you want to send to the webhook. In our example, we’ll pass along the JSON object received by the webhook into Slack.

Add an automation action

The data you pass to the incoming webhook can now be used in any automation action. As a simple example, we’ll pass along the JSON object setup in the example above to Slack.

Note

For a more in-depth look at our Slack automation actions, see this article.

Start by clicking the “Add action” button below the automation trigger, and select the “Send message” action for Slack.

6615648221079addactionscrollempty.gif

After selecting the your connected Slack account, and picking a channel, you can insert the JSON object into the body of a Slack message.

6615641385367whenwebhookreceivedtriggerconfigureactionexample.gif

After customizing the Slack message and running a test, your automation is now complete.

FAQs

Do you have to send a JSON object in the example webhook?

If the Content-Type header is application/json, yes. The top level of the JSON encoded data must be an object (as opposed to an array).

What request methods can be used in the example webhook?

Currently only POST requests can be made.

Are form encoded payloads supported?

Yes, we support x-www-form-urlencodedpayloads.

Is there a size limit on the payload request?

There's a payload size limit of 100kb per request.

Does Airtable handle signature verification?

We do not currently support signature verification.

What limits do webhooks have?

Each webhook received that results in an automation run will count towards the automation run limits for your workspace plan.


Was this article helpful?