Trigger Workflow when specific files are written to Cloud Storage?

Task: trigger a GCP workflow when a specific file (e.g., "this_file.txt") is added to a Cloud Storage bucket.

Challenge: It appears that Eventarc triggers for Workflows do now allow filtering of events to specific files in specific buckets (although this can be done for triggering Cloud Run by setting the trigger on audit logs). 100's of 1000's of files are added to the target bucket, so I MUST have filtering of events to just specifically named files; otherwise, the GCP workflow would be triggered 100's of 1000's of times. 

Question1: Why isn't file name filtering directly available for Eventarc triggering of GCP Workflows? 

Question2: Can I use Pub/Sub to filter the Eventarc triggers (in my case 100's of 1000's of events for each file added to the bucket) to just the target files: Eventarc => Pub/Sub => Workflow?

1 2 757
2 REPLIES 2

"As of my lat knowledge update in September 2021" 

I could have just asked ChatGPT4 myself for this answer.

"one common approach is to use Cloud Functions or Cloud Run as an intermediary layer"

I would then have 100's of 1000's of Cloud Function or Cloud Run jobs for each of the 100's of 1000's of files added to the Cloud Storage bucket. I'm trying to avoid this.

"Develop a separate service (such as a Cloud Function or Cloud Run) that listens to the Pub/Sub subscription. This service can perform the necessary filtering based"

Again, this will result in 100's of 1000's of Cloud Function/Run jobs, which I'm trying to avoid.

I used Cloud Run to trigger when new files put into a bucket and to specifically work with any ZIP files sent up. It was not a 1:1 ratio, meaning every file put into bucket did not trigger its own unique Cloud Run.  But I could see how it be worrying or how much might scale up when dealing with a ton of files coming up.