
Google Cloud Run
CertifiedEnterprise EditionRun an existing Google Cloud Run Job
Google Cloud Run
Run an existing Google Cloud Run Job
Enterprise-only task that submits a new execution of an already-existing Cloud Run Job, optionally waits for its completion, and streams its container logs to the task run.
Unlike the runner.CloudRun task runner, this task never creates, updates, or deletes the Job definition: it only submits an execution against a Job that must already exist (run.jobs.run), so it requires the Cloud Run Developer (roles/run.developer) role, plus Logs Viewer (roles/logging.viewer) to stream logs.
Use containerArgs, containerEnvironment, and taskCount to override the Job template for this execution only; any override left unset falls back to the Job template's own configuration.
If the task's timeout elapses while waiting for completion, this task fails but does not cancel the underlying Cloud Run execution — it keeps running (and billing) in GCP. Killing the Kestra task (e.g. via the UI or kill()) does cancel it; only a timeout does not.
type: io.kestra.plugin.ee.gcp.cloudrun.RunExamples
Run an existing Cloud Run Job and wait for its completion.
id: cloud_run_run_existing_job
namespace: company.team
inputs:
- id: gcp_region
type: STRING
defaults: europe-west1
- id: job_name
type: STRING
defaults: prod-etl-job
tasks:
- id: run_existing_job
type: io.kestra.plugin.ee.gcp.cloudrun.Run
projectId: "{{ secret('GCP_PROJECT_ID') }}"
region: "{{ inputs.gcp_region }}"
jobName: "{{ inputs.job_name }}"
serviceAccount: "{{ secret('GOOGLE_SA') }}"
wait: true
completionCheckInterval: PT10S
Override container environment variables for a single execution.
id: cloud_run_run_with_overrides
namespace: company.team
tasks:
- id: run_existing_job
type: io.kestra.plugin.ee.gcp.cloudrun.Run
projectId: "{{ secret('GCP_PROJECT_ID') }}"
region: europe-west1
jobName: prod-etl-job
serviceAccount: "{{ secret('GOOGLE_SA') }}"
containerEnvironment:
RUN_ID: "{{ execution.id }}"
ENVIRONMENT: prod
- id: log_result
type: io.kestra.plugin.core.log.Log
message: "Execution {{ outputs.run_existing_job.executionName }} finished with state {{ outputs.run_existing_job.state }}"
Fire a nightly batch execution without waiting for completion.
id: cloud_run_scheduled_fire_and_forget
namespace: company.team
triggers:
- id: nightly
type: io.kestra.plugin.core.trigger.Schedule
cron: "0 2 * * *"
tasks:
- id: run_existing_job
type: io.kestra.plugin.ee.gcp.cloudrun.Run
projectId: "{{ secret('GCP_PROJECT_ID') }}"
region: europe-west1
jobName: nightly-batch-job
serviceAccount: "{{ secret('GOOGLE_SA') }}"
wait: false
Properties
jobName *Requiredstring
Cloud Run Job name
The existing Cloud Run Job to run. Accepts either the short job name (resolved against projectId and region) or the fully-qualified resource path projects/{project}/locations/{region}/jobs/{job}. The Job must already exist: this task never creates, updates, or deletes it.
region *Requiredstring
GCP region
Region the Cloud Run Job runs in.
completionCheckInterval string
PT5SCompletion poll interval
How often to check execution status while waiting; defaults to PT5S. Lower for short jobs, higher to reduce API calls.
containerArgs array
Container arguments override
Replaces the container's command-line arguments for this execution only; leave unset to use the Job template's own arguments.
containerEnvironment object
Container environment variables override
Environment variables applied to the container for this execution only; leave unset to use the Job template's own environment.
impersonatedServiceAccount string
The GCP service account to impersonate
Service account email to impersonate for API calls.
For Cloud Run runner, this value applies to API calls used to create and run the job (--impersonate-service-account equivalent).
It does not set the job execution identity (--service-account).
pluginDefaultsRef Non-dynamicstring
Reference (ref) of the pluginDefaults to apply to this task.
projectId string
The GCP project ID
scopes array
["https://www.googleapis.com/auth/cloud-platform"]The GCP scopes to be used
serviceAccount string
The GCP service account key
Service account JSON key used to authenticate API calls.
For Cloud Run runner job execution identity, this value is used as a fallback for --service-account
when runtimeServiceAccount is not provided.
taskCount integerstring
Task count override
Number of parallel tasks to run for this execution; must be between 1 and 10000 (Cloud Run Jobs' documented maximum). Leave unset to use the Job template's own task count.
wait booleanstring
trueWait for completion
If true (default), waits for the execution to reach a terminal state and streams its container logs before returning. If false, returns immediately after submitting the execution, leaving state, startedAt, and stoppedAt unset.
Outputs
executionName string
Cloud Run execution resource name
startedAt string
date-timeTime the execution started running
Unset when wait is false.
state string
Terminal execution state
SUCCEEDED or CANCELLED (the latter only when this task's own kill() requested the cancellation). Any other cancellation, or a failure, fails the task instead of being returned here. Unset when wait is false.
stoppedAt string
date-timeTime the execution stopped running
Unset when wait is false.