I'm looking for a recommended pattern for a challenge we have with a long running Firestore backup process. The Firestore backup is a Cloud Function triggered to run nightly. This process currently takes about 4 minutes. We'd like a message to be posted to a Pub/sub topic when this process completes so that an additional cloud function that uses the backup as data-source can be triggered. The only issue we have is with the max timeout for Cloud Functions which is currently 540s (9 min). While we are well within this limit currently this might not always be the case.
So, is there recommended GCP design pattern that would handle a long-running process with an unknown finish time, and on completion be able to publish a message to a pub/sub topic? I was thinking that it would be nice to publish a message to the topic and build in some delay (say 1 hour) that would stop the message from being published until the delay is over. I've been researching pub/sub for this ability but so far I don't see much. Even then: is there a better more obvious way to get this done?
Any feedback is appreciated. Thanks