Google Cloud Pub/Sub API – Push E-mail

I’m using node.js to create an app that gets a PUSH from Gmail each time an email is received, checks it against a third party database in a CRM and creates a new field in the CRM if the e-mail is contained there. I’m having trouble using Google’s new Cloud Pub/Sub, which seems to be the only way to get push from Gmail without constant polling.

google cloud pubsub node.js client not compatible with google cloud functions

Architecture: We have an architecture using 2 pubsub topic/subscription pairs: Topic T1 is triggered by a cronjob periodically (every 5 minutes for example). Subscription S1 is the trigger for our cloud function. Topic T2 serves as a queue for background jobs that are published by one of our services. Subscription S2 is read by the … Read more