Updated Nov 20, 20266 min read

How to Move Render Cron Jobs to Google Cloud

A step-by-step guide to moving Render cron job services to Google Cloud: what Render guarantees about schedules and runs, the Cloud Scheduler and Cloud Run version, and a Go version where each schedule is declared next to the endpoint it calls.

Illustration for How to Move Render Cron Jobs to Google Cloud

A Render cron job is a separate service that runs one command on a UTC schedule, with its own build and environment variables. Render allows at most one active run per job and stops a run after 12 hours, guarantees code quietly comes to depend on.

Google Cloud splits that into a scheduler and a place for the code to run, and neither carries the single-run guarantee. This guide maps Render cron jobs to GCP and ends with the schedules declared in Go.

How do Render cron jobs map to Google Cloud?

Render cron jobGoogle Cloud
TriggerCron expression in UTCCloud Scheduler, with a time zone per job
What runsA command from your build, in a fresh instanceAn HTTP endpoint on Cloud Run, or a Cloud Run job
Runs per scheduleAt most one active runAt-least-once, so occasionally two
Longest runStopped after 12 hours30 minutes for an HTTP target, 168 hours for a job task
RetriesRerun from the dashboardRetry config on the Scheduler job, --max-retries on a Cloud Run job
ConfigEnvironment variables per cron serviceEnv vars and Secret Manager on the service or job
Price of the triggerPart of the cron serviceBilled per job per month, with a free allowance per billing account

Render's guarantees come from its cron job docs, checked on November 20, 2026. The 30-minute attempt deadline is in the Cloud Scheduler job reference, and the 168-hour task limit in Cloud Run task timeout.

Step 1: List every cron service

For each Render cron job, note the schedule, the command (such as ./bin/send-digests or python manage.py close_month), the environment variables it reads and the slowest run in its logs. Mark the jobs that would cause harm if they ran twice, since those need a guard on GCP, and the jobs that take more than a few minutes, since those decide whether the job becomes an endpoint or a Cloud Run job.

Step 2: Choose a Cloud Run service endpoint or a Cloud Run job

A job that finishes within a few minutes becomes a route on an existing Cloud Run service, and Cloud Scheduler calls it with an OIDC token from a service account that holds roles/run.invoker on that service. That reuses the web service's image and config, and the attempt deadline (3 minutes by default, 30 at most) caps how long the request can run. A longer job becomes a Cloud Run job, a container that runs to completion, and the Scheduler job calls the Cloud Run Admin API to start an execution, with a default task timeout of 10 minutes that you raise per job.

Render's single active run does not carry over, as Cloud Scheduler is built for at-least-once delivery, and its requests carry X-CloudScheduler-JobName and X-CloudScheduler-ScheduleTime headers that a handler can use to recognise a repeat for the same scheduled time. Jobs that send email or move money should record the period they processed in a table with a unique constraint and skip the work when the row already exists.

Step 3: Declare the schedules in code

Encore brings infrastructure from code, and a cron job is declared next to the endpoint it calls, in the service that owns the data. Per the GCP infrastructure docs, services run on Cloud Run in your own project, the database runs on Cloud SQL, and cron jobs need no extra infrastructure, since the Encore platform makes signed calls to the endpoint on schedule. Work that would take longer than a request goes onto a Pub/Sub topic, one message per account, so no single request runs for an hour.

Application code passes through Encore and infrastructure guardrails to resources provisioned in your own AWS or GCP account.
Get started
brew install encoredev/tap/encore &&
encore app create
Copy

Run in your terminal to get started locally.

A Render cron job that ran ./bin/send-digests every morning, split into a short cron endpoint and a subscription that sends each digest once:

// digests/digests.go package digests import ( "context" "time" "encore.dev/cron" "encore.dev/pubsub" "encore.dev/rlog" "encore.dev/storage/sqldb" ) var db = sqldb.NewDatabase("digests", sqldb.DatabaseConfig{ Migrations: "./migrations", }) type DigestDue struct { AccountID int64 Day string // YYYY-MM-DD in UTC } var DigestTopic = pubsub.NewTopic[*DigestDue]("digest-due", pubsub.TopicConfig{ DeliveryGuarantee: pubsub.AtLeastOnce, }) // Was a Render cron job running `./bin/send-digests` at `0 7 * * *`. var _ = cron.NewJob("send-digests", cron.JobConfig{ Title: "Queue the daily digest for every account", Schedule: "0 7 * * *", Endpoint: QueueDigests, }) type QueueResult struct { Queued int } // QueueDigests publishes one message per account and returns quickly. // //encore:api private method=POST path=/internal/queue-digests func QueueDigests(ctx context.Context) (*QueueResult, error) { day := time.Now().UTC().Format("2006-01-02") rows, err := db.Query(ctx, `SELECT id FROM accounts WHERE digest_enabled`) if err != nil { return nil, err } defer rows.Close() n := 0 for rows.Next() { var id int64 if err := rows.Scan(&id); err != nil { return nil, err } if _, err := DigestTopic.Publish(ctx, &DigestDue{AccountID: id, Day: day}); err != nil { return nil, err } n++ } return &QueueResult{Queued: n}, rows.Err() } var _ = pubsub.NewSubscription(DigestTopic, "send-digest", pubsub.SubscriptionConfig[*DigestDue]{ Handler: sendDigest, AckDeadline: 2 * time.Minute, RetryPolicy: &pubsub.RetryPolicy{MaxRetries: 5}, }) func sendDigest(ctx context.Context, msg *DigestDue) error { // The unique (account_id, day) key makes a repeated message or a second // cron call for the same day a no-op. res, err := db.Exec(ctx, ` INSERT INTO digest_runs (account_id, day) VALUES ($1, $2) ON CONFLICT DO NOTHING`, msg.AccountID, msg.Day) if err != nil { return err } if res.RowsAffected() == 0 { return nil } rlog.Info("sending digest", "account", msg.AccountID, "day", msg.Day) // Render and send the email here. If sending fails, delete the row // before returning the error so the retry can claim it again. return nil }
-- digests/migrations/1_init.up.sql CREATE TABLE accounts ( id BIGSERIAL PRIMARY KEY, email TEXT NOT NULL, digest_enabled BOOLEAN NOT NULL DEFAULT true ); CREATE TABLE digest_runs ( account_id BIGINT NOT NULL REFERENCES accounts(id), day DATE NOT NULL, sent_at TIMESTAMPTZ NOT NULL DEFAULT now(), PRIMARY KEY (account_id, day) );

The cron endpoint takes no parameters, which the cron jobs docs require, and the digest_runs key keeps the job safe to call twice, which the same docs ask for. Cron jobs do not run in local development, so with encore run you call POST /internal/queue-digests yourself and watch the subscription handle each message in the local trace view, with encore run starting Postgres locally. On GCP, the Pub/Sub docs describe the topic, retries and the dead-letter topic that collects messages after MaxRetries.

To deploy, connect your GCP project as described in Connect your cloud account and push with git push encore.

The schedule, the queue and the table live in one Go file, so an agent asked to move the digest to 8:00 changes one string and an agent adding a weekly report adds an endpoint and a cron.NewJob next to it, with nothing to create in the GCP console.

Best fit: Backends moving from Render to their own GCP project that want scheduled jobs declared next to their code, with long work fanned out over a queue with retries.

Step 4: Cut over one job at a time

Deploy the GCP version while the Render cron job is still active, then suspend the Render job right before the first run on GCP, so no day is processed in both places. For a job with a run table like digest_runs, you can backfill the last few days from Render's data first, and the unique key turns any overlap into a no-op. Delete the Render service once a full cycle has run cleanly.

Frequently asked questions

What is the Google Cloud equivalent of a Render cron job?

Cloud Scheduler is the trigger, and the target is either an HTTP endpoint on a Cloud Run service or a Cloud Run job that runs a container to completion. Short jobs fit an HTTP endpoint, since Cloud Scheduler waits at most 30 minutes for a response, and longer jobs fit a Cloud Run job, which can run a task for up to 168 hours.

Does Cloud Scheduler run a job only once per schedule?

No. Cloud Scheduler is designed for at-least-once delivery, so a job can occasionally run more than once for the same scheduled time. Make each job idempotent, for example by recording the run's period in a table with a unique constraint before doing the work.

Which time zone do Render and Cloud Scheduler use?

Render interprets cron expressions in UTC, while Cloud Scheduler takes a time zone per job, so either keep UTC to match the old schedules or convert them and check how daylight saving changes affect jobs that run near midnight.

How do I run cron jobs on Cloud Run without managing Cloud Scheduler?

With Encore you declare a cron job in application code that points at an API endpoint, and once deployed the Encore platform calls that endpoint on the schedule, with no Cloud Scheduler jobs in your project. Cron jobs do not run locally, so you test them by calling the endpoint directly.

Deploy to your cloud on AWS and Google Cloud
without managing infrastructure

Encore lets developers and agents define application infrastructure directly in code, then automatically provisions it from local development to production in your AWS or GCP account.

~/orders — claude
Claude Code
Claude Code v2.1.180Opus 5.5~/orders