Search code examples
httpgoogle-cloud-platformgoogle-cloud-scheduler

Cron scheduling a HTTP request on GCP that takes ~1 hour to complete


I know that for GCP cloud scheduler the max timeout is around 20 minutes for a HTTP request source.

Is it somehow possible, on GCP (perhaps using a different service) for me to invoke an HTTP endpoint, that takes around 65 minutes to respond, every ~6 hours?


Solution

  • Agreeing with the comments, it would be better if you restructure your application so that it doesn’t have to rely on such a long timeout period. This is due to the drawbacks that John Hanley commented on. As for your actual question, you could combine multiple services. For example, Cloud Run has a maximum timeout of 60 minutes, which you can set up when you deploy your service.

    Now, in order to run this service every 6 hours, you can make use of Cloud Workflows. Workflows is an automation tool which can be used to combine multiple GCP services in a single automated process. It can execute Cloud Run services, and you can in turn schedule this Cloud Workflow to run every 6 hours with Cloud Scheduler.