App doesn't have webhooks? Here are some options.

If you’re building an automation with an app that doesn’t offer webhooks, you may be frustrated about how to trigger the rest of your automation. Don’t give up! There may be some approaches you can consider to get “unstuck”.

Leverage Email Notifications

We have recently been working on an automation with AssetPanda, an app that allows companies to track assets they own at all stages of the asset lifecycle. Unfortunately AssetPanda does not offer webhooks, but it does have support for email notifications that can be customized to automatically be sent at various stages of an asset’s lifecycle.

If you’re using an iPaaS middleware platform like Integromat or Zapier, you may be able to “catch” these email notifications by setting up mailhooks. A mailhook is nothing more than an email address that you can set up to receive email messages and trigger the rest of your workflow automation.

But, what if you’re writing custom code to handle the automation, and you’ve stood up a URL endpoint that is expecting to get called (i.e. from a webhook)? It turns out there are some really interesting things you can do with email parsers. We love Sendgrid, for sending email, but they also have a less-famous feature called inbound parse, and it’s really powerful. Using Inbound parse, you set up a mailhook, which, when it receives an email, will HTTP POST the email message contents to an endpoint you configure. Effectively, you’ve turned an email notification into a webhook!

Poll for changes

If you don’t have an email notification option to use, you can usually use a polling technique. Polling is nothing more than repetitively querying an API to look for changes on a cadence (every 5 minutes or 15 minutes etc). As unglamorous polling is, it may be your best option. Fortunately it’s not too hard to engineer the polling process itself in a language like NodeJS:

let polling_interval = 15*60*60*1000;//every 15 minutes (in milliseconds)
let timer = setInterval( function(){

  //Code to make your polling query goes here.

}, polling_interval);

There are some important things to keep in mind when building a polling process:

Beware of rate limits, and design accordingly. APIs typically have some kind of rate limit. You don’t want your polling process to consume the rate limit just through its normal cycle of polling, so you’ll need to consider that in your design.

You’ll want to keep track of the last time your workflow automation polled. This is as simple as saving a timestamp on your server. It can also be useful to save this “last polled timestamp” on individual entity custom fields (if the app you’re working with supports it) because this can be very helpful when troubleshooting your polling process.