Skip to main content

Configure a Worker for Versioning

View Markdown

You'll need to add a few additional configuration parameters to your Workers to toggle on Worker Versioning. There are three new parameters, with different names depending on the language:

  • UseVersioning: This enables the Versioning functionality for this Worker.
  • A Version to identify the revision that this Worker will be allowed to execute. This is a combination of a deployment name and a build ID number.
  • (Optional) The Default Versioning Behavior. If unset, you'll be required to specify the behavior on each Workflow. Or you can default to Pinned or Auto-Upgrade.

Follow the example for your SDK below. Select a concept to highlight the matching lines:

Highlight a concept
buildID := mustGetEnv("MY_BUILD_ID")
w := worker.New(c, myTaskQueue, worker.Options{
DeploymentOptions: worker.DeploymentOptions{
UseVersioning: true,
Version: worker.WorkerDeploymentVersion{
DeploymentName: "llm_srv",
BuildID: buildID,
},
DefaultVersioningBehavior: workflow.VersioningBehaviorUnspecified,
},
})