Member-only story

How to schedule a Google Cloud function to run more frequently than once a minute

A function scheduling itself at sub-minute intervals in Google Tasks queue

Marian C.
5 min readApr 24, 2025

--

A Google Cloud function is a cheap way to execute on demand code that can interact Google Cloud services such as the Storage or Firestore, or use Google Workspace tools such as Sheets or Drive.

A function can be scheduled to run at defined times or regular intervals using the Cloud Scheduler. So besides many use cases, Cloud functions is an excellent tool for monitoring web sites or collecting data from web resources. A function costs nothing if it runs several seconds every minute.

However, the Cloud Scheduler has a limitation — its minimum interval is one minute. So how to launch the function more frequently than once a minute, for example every 15 seconds? Imagine the function monitoring some trading or betting website, in a promising situation it might need to be re-executed sooner than in one minute.

It is possible to use the Cloud Scheduler to launch the function at the maximum once a minute frequency and the code inside the function can schedule a new run after several seconds using a queue in the Cloud Tasks service.

--

--

Marian C.
Marian C.

Written by Marian C.

Java, JavaScript and SQL developer. Interested in data collection and visualization.

Responses (5)