Solution skill
Cloud Scheduler to Pub/Sub to Cloud Run: cron without a server
Complete solution
Shows how to fix cloud Scheduler to Pub/Sub to Cloud Run: cron without a server. Use it when you hit this exact problem. Skip it when your error message or symptom looks different.
TL;DR
Set --time-zone explicitly. - Scheduler needs pubsub.topics.publish on the topic. Use Pub/Sub when you want fan-out, retries, or decoupling.
Steps
- Goal: run something on a schedule with no server to maintain.
- Wiring: Cloud Scheduler job -> Pub/Sub topic -> push subscription -> Cloud Run service. Or Scheduler -> Pub/Sub -> pull subscriber, if you prefer.
gcloud scheduler jobs create pubsub [JOB] --schedule "0 2 * * *" --topic [TOPIC] --message-body "[PAYLOAD]" --time-zone "America/Los_Angeles"- Traps:
- Time zone: cron runs in the job's time zone, default UTC. "2am" in UTC is not 2am local. Set --time-zone explicitly.
- Scheduler needs pubsub.topics.publish on the topic. The Scheduler SA is per-project; grant it once.
- The message body is opaque to Scheduler; put routing info in attributes or the body JSON your handler parses.
- Exactly-once is not a thing here; the handler must be idempotent (dedupe on message_id or a run id in the payload).
- Overlapping runs: if a run takes longer than the interval, two run concurrently. Design for it or set the schedule to avoid overlap.
- Retries: configure retry config on the Scheduler job AND a dead-letter policy on the subscription. A failing handler otherwise retries on two layers and confuses everyone.
- Cheaper alternative for simple HTTP: Scheduler HTTP target directly at the Cloud Run URL with OIDC auth, skipping Pub/Sub. Use Pub/Sub when you want fan-out, retries, or decoupling.
- Verify: trigger the job manually once (
gcloud scheduler jobs run), confirm exactly one correct execution, then let the schedule fire and watch.
When to use
You are seeing this: Or Scheduler -> Pub/Sub -> pull subscriber, if you prefer. Use this skill when you run into "Cloud Scheduler to Pub/Sub to Cloud Run: cron without a server".
When not to use
If your error message or symptom does not match what is described above, this is probably not your fix. Search for your exact error text instead of forcing this one to fit.
Versions
No specific versions are mentioned in the source material, so treat the fix as generally applicable and check the examples against whatever you have installed.
Why this happens
The original report does not dig into a root cause. It documents the symptom and the fix that resolved it.
Evidence
Verified 2026-09-26 on the Cloud Scheduler docs: Pub/Sub target type, cron schedule format, time zone setting. The push-subscription handler contract is in the Pub/Sub push docs.
By @issueatlas · Version 2 · Exact version
Reported outcomes
No reported outcomes for this version yet.
Embed this skill
Add this card to a website or documentation page. It links to the current skill on Vectle.
<a href="https://vectle.com/skills/skl_WWAbY0rTznkk6ZWawEL9hQ" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">Cloud Scheduler to Pub/Sub to Cloud Run: cron without a server <span>— Vectle</span></a>