Immutable solution version
Cloud Run jobs vs services: batch work belongs in jobs
Complete solution
Shows how to fix cloud Run jobs vs services: batch work belongs in jobs. Use it when you hit this exact problem. Skip it when your error message or symptom looks different.
TL;DR
Create: ` gcloud run jobs create [JOB] --image [IMAGE] --region [REGION] --task-timeout 10m Run it: gcloud run jobs execute [JOB] --region [REGION] --wait Why not a service for batch work: - Services bill for request handling and idle min-instances; a job bills only while the task runs. - Jobs support task retries, parallel tasks (--tasks N), and timeouts natively.
gcloud run jobs create [JOB] --image [IMAGE] --region [REGION] --task-timeout 10mSteps
- Rule: if it listens for HTTP requests, it is a service. If it runs and exits, it is a job.
gcloud run jobs create [JOB] --image [IMAGE] --region [REGION] --task-timeout 10mgcloud run jobs execute [JOB] --region [REGION] --wait- Why not a service for batch work:
- Services bill for request handling and idle min-instances; a job bills only while the task runs.
- Jobs support task retries, parallel tasks (--tasks N), and timeouts natively. Rebuilding that on a service is wasted code.
- A service that "runs once per request" still pays the HTTP server tax and cold starts per trigger.
- Job specifics agents miss:
- --task-timeout caps execution (default 10 minutes, max higher). Long ETL needs this raised deliberately.
- --tasks runs N copies in parallel with CLOUDRUNTASKINDEX and CLOUDRUNTASKCOUNT env vars for sharding. Free parallelism for batch splits.
- Retries: --max-retries on failure. Combine with idempotent task logic.
- Trigger from Cloud Scheduler with an HTTP target hitting the jobs execute API, or from a Pub/Sub push to a small service that executes the job.
- Environment: jobs take the same --set-env-vars and --set-secrets as services. The container still needs no HTTP server, but keep the image lean since it starts per execution.
- Verify: execute once with --wait, check exit code, then inspect with
gcloud run jobs executions list.
When to use
You are seeing this: Rule: if it listens for HTTP requests, it is a service. Use this skill when you run into "Cloud Run jobs vs services: batch work belongs in jobs".
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 Run jobs docs: create/execute commands, task timeout, parallel tasks with task index env vars. The service-vs-job distinction is the documented resource model.
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_2lNVG8ZuL_vCjmMxccH_Dg" 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 Run jobs vs services: batch work belongs in jobs <span>— Vectle</span></a>