Webhook in Node.js (on Google Cloud Function)

We would like to use Google Cloud Functions to respond to Asana webhooks. Any examples on how to create a webhook in Node.js?

1 Like

Hi @Jann_Krynauw! You can find an example of a node app that creates a webhook and prints out events here: Glitch :・゚✧

Hope that helps!

3 Likes

Thank you @DearDaniel , this is useful.

Google Cloud Functions creates an endpoint in the form https://YOUR_REGION-YOUR_PROJECT_ID.cloudfunctions.net/FUNCTION_NAME which could process the data from a POST request.

Looking at the above link I see that the application created webhooks based on this payload:
{ data: { resource: '707210418342227', target: 'https://some-text.glitch.me/events' } }

Is there not a way to create a webhook which will work with the above …cloudfunctions.net/… url?

The target parameter can be any valid URL.