Cloud Scheduler Study Notes
Cloud Scheduler is a fully managed cron job service that runs jobs on a schedule you define, from every minute to once a month. Each job invokes a target such as an HTTP endpoint, a Pub/Sub topic, or an App Engine application when its time arrives. It provides a central, reliable way to trigger recurring work without running your own scheduler server.
Key facts
- A Cloud Scheduler job is defined by a name, a schedule in Unix cron format, a time zone, and exactly one target type to invoke when the job runs.
- Supported targets are HTTP or HTTPS endpoints, Pub/Sub topics, and App Engine HTTP routes, covering serverless, messaging, and application triggers from one service.
- Schedules use standard five-field cron syntax for minute, hour, day of month, month, and day of week, combined with an IANA time zone setting.
- Jobs can be paused, resumed, updated, and forced to run immediately for testing, without waiting for the next scheduled execution time.
- For HTTP targets, Scheduler can attach authentication, including OIDC tokens for Google Cloud services and OAuth tokens for supported endpoints, plus custom headers and a body.
- Retry configuration controls how many times a failed job delivery is retried, with exponential backoff settings and minimum and maximum backoff durations.
- Delivery is at least once, so targets should be idempotent: a retried delivery after a timeout can cause the same work to be triggered twice.
- Scheduler jobs are regional resources, and an App Engine application must exist in the project for Scheduler to be used, because of how the service is provisioned.
- Job execution history and status are visible in the console and through logging, making it possible to audit when a job fired and whether delivery succeeded.
What the exam expects you to know
- The exam tests Cloud Scheduler as the straightforward answer for cron: trigger a Cloud Function, publish to Pub/Sub, or call an endpoint every day at a set time.
- Know the three target types and that one job has one target; fanning out to many services is normally done by targeting a Pub/Sub topic.
- Expect a contrast with Cloud Composer: Scheduler fires a single trigger, while Composer orchestrates a multi-step workflow with dependencies after the trigger.
- Candidates should understand retry and idempotency: a scenario describing duplicate work after retries expects the target to handle repeated deliveries safely.
- Questions may cover time zones and cron syntax at a basic level, such as a job that must run at 2 AM in a specific region's local time.
- Understand that Scheduler can start workflows indirectly, for example by publishing to Pub/Sub or calling an HTTP endpoint that begins a longer process.
Cloud Scheduler vs Cloud Tasks: when to use which
Choose Cloud Scheduler when work must happen on a recurring time schedule, such as every night at midnight, regardless of any external event. Choose Cloud Tasks when work is created dynamically by an application, one task at a time, and needs controlled dispatch rate, de-duplication, or a specific future execution time per task. Scheduler answers when, on a calendar rhythm; Tasks answers how queued work is dispatched to a worker. A common exam pattern combines them: Scheduler triggers a job that enqueues many Cloud Tasks for controlled processing. See also the Cloud Tasks notes.
Useful gcloud commands
gcloud scheduler jobs create pubsub my-job --schedule='0 0 * * *' --topic=my-topic --message-body='run'
gcloud scheduler jobs run my-job --location=us-central1
gcloud scheduler jobs pause my-job --location=us-central1
gcloud scheduler jobs list --location=us-central1Common exam traps
- Cloud Scheduler cannot express dependencies between steps: it fires one target, so a chain where step two waits for step one needs Composer, Workflows, or Tasks.
- Assuming exactly-once execution is wrong: retries mean a target can receive the same scheduled invocation more than once and must cope with duplicates.
- A cron expression is interpreted in the job's configured time zone, not automatically in the user's local time, which causes off-by-hours mistakes in scenarios.
- Scheduler is not a task queue with rate limiting per item: controlling how fast individual units of work hit a worker is the job of Cloud Tasks.
Frequently asked questions
What targets can a Cloud Scheduler job invoke?
A job can invoke one of three target types: an HTTP or HTTPS endpoint, a Pub/Sub topic, or an App Engine HTTP route. Choosing Pub/Sub is common for decoupling, because one published message can then fan out to several subscribers. HTTP targets suit directly calling Cloud Run, Cloud Functions, or an external webhook on a schedule.
How do I run a Scheduler job outside its normal schedule?
You can force a job to run immediately from the Cloud Console or with the gcloud scheduler jobs run command, specifying the job and its location. This is useful for testing the target, headers, and authentication without waiting for the next cron time. The forced run uses the same delivery and retry behaviour as a scheduled run.
What happens when a scheduled delivery fails?
Cloud Scheduler retries failed deliveries according to the job's retry configuration, using exponential backoff between attempts up to the configured maximum count or duration. Because delivery is at least once, a target that processed a request but responded slowly could receive a retry, so targets should check for duplicate work and respond idempotently where correctness matters.
Study aid disclaimer: Cloud Cert Notes is an independent educational study aid. It is not affiliated with, endorsed by, or sponsored by Google, Microsoft, Amazon, Oracle, or Alibaba. Google Cloud, Associate Cloud Engineer, and Cloud Digital Leader are trademarks of Google LLC; all other certification names and product names are trademarks of their respective owners. Always confirm service details against the official provider documentation before sitting an exam.