Skip to content

Add Cloud Run Id worker sample - #219

Draft
seanbollin wants to merge 9 commits into
mainfrom
cloud-run-worker-id
Draft

seanbollin wants to merge 9 commits into
mainfrom
cloud-run-worker-id

Conversation

@seanbollin

@seanbollin seanbollin commented Aug 25, 2026

Copy link
Copy Markdown

Runs a Temporal Worker on a Google Cloud Run worker pool using the Cloud Run Id plugin (Temporalio.Extensions.Gcp.CloudRun.Id.CloudRunIdPlugin), which sets the Temporal client identity from Cloud Run instance metadata ({instanceId}@{revision}) so each instance is identifiable in Temporal.

Deploy: gcloud run worker-pools deploy "$WORKER_POOL" --image "$WORKER_IMAGE" --region "$REGION". Run: temporal workflow execute --task-queue cloud-run-worker-sample --type SampleWorkflow --input '"Cloud Run"'. See the sample README.

The extension is unreleased on nuget.org, so it is restored from a committed local-packages/ feed until it ships.

@seanbollin seanbollin changed the title Add Google Cloud Run worker sample Add Google Cloud Run worker-identity sample Sep 9, 2026
seanbollin and others added 7 commits September 18, 2026 10:40
Add a long-lived Temporal Worker sample for Google Cloud Run that uses the new
Temporalio.Extensions.Gcp.CloudRun helper to derive the worker identity and a
pinned Worker Deployment Version from Cloud Run metadata. It reads
TEMPORAL_ADDRESS / TEMPORAL_NAMESPACE / TEMPORAL_TASK_QUEUE from the
environment, registers a greeting workflow and activity, and polls until the
container is stopped.

The helper is unreleased, so the project temporarily references the SDK from a
sibling sdk-dotnet checkout via ProjectReference; the README and csproj explain
how to switch to the released package. This is why the PR is a draft.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Register a single CloudRunPlugin on TemporalClientConnectOptions.Plugins
instead of calling the removed ApplyGoogleCloudRunDefaults* helpers. The
plugin sets the client identity at connect time and pins the worker to
the Cloud Run deployment version automatically.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Follows the sdk-dotnet rename: the Cloud Run worker-identity plugin is now
WorkerIdPlugin (Cloud Run can host multiple Temporal plugins, so the generic
CloudRunPlugin name is no longer used). Update the sample's registration,
workflow comment, and README.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The Google Cloud Run worker-ID plugin moved from the root Temporalio.Extensions.Gcp.CloudRun project into a new Temporalio.Extensions.Gcp.CloudRun.WorkerId sibling. Update the project reference, the using directive, and the README to match.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Move src/CloudRunWorker to src/Gcp/CloudRun/WorkerId to mirror the sibling
OpenTelemetry Cloud Run sample, and rename the project and namespace to
TemporalioSamples.Gcp.CloudRun.WorkerId. Register the moved project in the
solution and update the root README sample entry.

Remove all Worker Deployment Versioning content (deployment name, build id,
versioning behavior, pinned) from the code, comments, and README. The sample
now only registers WorkerIdPlugin to set the worker identity from Cloud Run
metadata, and logs GoogleCloudRunMetadata.WorkerIdentity.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@seanbollin seanbollin changed the title Add Google Cloud Run worker-identity sample Add Cloud Run worker identity sample Sep 18, 2026
@seanbollin seanbollin changed the title Add Cloud Run worker identity sample Add Cloud Run Id sample Sep 18, 2026
@seanbollin seanbollin changed the title Add Cloud Run Id sample Add Cloud Run Id worker sample Sep 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants