Hubspot Workflow - webhook to create new firestore document with incoming forms data

Hello, I am trying to figure out webhooks in purpose to integrate with my workflow in Hubspot. The workflow is triggered by submitted form. In this workflow I want to invoke a cloud function that will create a new document in firestore. This document will store all data of the incoming form. There are over 160 unique forms, so thats why I need webhooks. Thats atleast what im thinking. Is this possible or are there other solutions i should try?

0 1 184
1 REPLY 1

Hi @klassebrasse 

Yes, this can be done by using Google Cloud Functions. You could expose a HTTP Function and implement the signature validation before inserting the document into Firestore.

Here is a quick and simple solution, including code and some scripts to deploy and test the function.

https://github.com/mecclesgoogle/hubspot-firestore

Ensure you grant the default Compute Service Account the 'Datastore User' role so that the function can write into the Firestore database.

You'd also have to make some changes to harden this code:

  • Store the secret key somewhere secure such as Google Cloud Secret Manager
  • Make the code idempotent (e.g. don't insert the same data more than once)
  • Error handling, logging, and so on

Hope this helps!