Want to use EventArc for Firestore events? Not so fast.

Troy
Atomic Robot
Published in
2 min readSep 19, 2022

Hey all, we at Atomic Robot recently discovered something about EventArc that we had to share with others. This will be quick and we hope it helps.

First, some background on how we came about this issue. We were looking into using EventArc to trigger a Cloud Run service to populate BigQuery when documents were created in Firestore. While prototyping this, we noticed that our service would never get triggered when creating a document.

We were testing the flow using the Firestore UI and given that’s not the normal way documents will be created, we decided to try other methods.

We found that using the API Explorer worked, the service would be triggered and method name would be google.firestore.v1.Firestore.CreateDocument.

Using a NodeJS app to create a document, did not trigger the service and method name would be google.firestore.v1.Firestore.Write.

Same for Flutter-based apps on Andriod and iOS, service not triggered and method name google.firestore.v1.Firestore.Write.

The moral of the story, after a fair amount of digging and a Stack Overflow post to confirm, we found that for Firestore events, v1 Cloud Functions is still the best approach.

Of course, if we did more reading, we might have noticed the following blue notes in the Google Documentation. :)

https://cloud.google.com/functions/docs/calling/cloud-firestore
https://cloud.google.com/functions/docs/calling#2nd-gen-triggers

Coding is fun, but the blue starred notes are important in Google Documentation.

About Atomic Robot

Atomic Robot brings together the best developers and creators to deliver custom-crafted mobile solutions for iOS, Android, and emerging technologies.

Please reach out to us at hello@atomicrobot.com or go to https://atomicrobot.com/contact/.

https://atomicrobot.com

--

--