Add Worker snippets for the SDK Worker pages - #856
Merged
Conversation
Adds snippet regions used by the Run a Worker pages in the docs: - go-versioned-worker - python-create-worker, python-versioned-worker, python-worker-graceful-shutdown - typescript-versioned-worker, typescript-worker-graceful-shutdown Placeholder Workflow and Activity names follow the existing snippets/plugins convention (HelloWorkflow, some_activity).
dplyukhin
approved these changes
Jul 28, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Adds snippet regions to
features/snippets/worker/for the per-SDK Run a Worker documentation pages.New snippet IDs:
python-create-workergo-versioned-workerpython-versioned-workertypescript-versioned-workerpython-worker-graceful-shutdowntypescript-worker-graceful-shutdownWhy
The
run-worker-processdocs pages currently use hand-written inline code, and none of the eight SDK Worker pages document a versioned Worker at all. These snippets give those pages a compile-checked source.Go and TypeScript pull their create-and-run snippet from the hello-world samples instead, so only Python needs one here — its hello sample runs the client inside the Worker's
async withblock, so there's no clean region to mark.Notes
snippets/pluginsconvention:HelloWorkflow,some_activity.*-worker-max-cached-workflowssnippets in these files.worker.goalso picks up a trailing newline it was missing.Verification
go build ./snippets/worker/passes against SDK v1.45.0.temporalio:deployment_configandgraceful_shutdown_timeoutare realWorkerparams, and theWorkerDeploymentConfig/WorkerDeploymentVersionfield names match.workerDeploymentOptionsexists,shutdownGraceTimeaccepts an ms-formatted string, anddefaultVersioningBehavioris required whenuseWorkerVersioning: true. I did not runtsclocally, so CI is the real check there.