June 13, 2024

Go SDK v1.27.0

Reset workflow with Updates

The Go SDK now supports reapplying Workflow Updates when resetting a workflow execution.

Note: Support for reapplying updates on workflow reset require a server version ≥1.24.0

Request failure code labeled metrics

gRPC request failure metrics (*request_failure) emitted by the Go SDK now include the error status code as a tag under status_code. This can be disabled by setting DisableErrorCodeMetricTagson client.Options.

See also: #1472

💥 BREAKING CHANGES

This release includes some breaking changes for the experimental features Workflow Update and Worker Versioning. Users of these features should read the release notes carefully before upgrading.

Workflow Update (Experimental)

Based on users feedback this release makes some breaking changes to the Workflow Update API used by client and workflows code.

Client API changes

  • Merged Client.UpdateWorkflowWithOptions and Client.UpdateWorkflow into one API called Client.UpdateWorkflow that takes a client.UpdateWorkflowOptions struct.

  • WaitPolicy in client.UpdateWorkflowOptions was replaced with WaitForStage. WaitForStage is now a required parameter in client.UpdateWorkflowOptions.

  • WaitForStage is now properly respected by Client.UpdateWorkflow. Previously Client.UpdateWorkflow may have returned a handle before the desired WaitForStage was reached.

Workflow API changes

  • workflow.SetUpdateHandler and workflow.SetUpdateHandlerWithOptions Now require update handles to take a workflow.Context as the first argument.

  • workflow.GetUpdateInfo has been renamed to workflow.GetCurrentUpdateInfo

Worker Versioning (Experimental)

Worker Versioning is a pre-release, experimental feature that simplifies managing code changes by allowing you to peg workflows to build versions. This change revamps and improves the API and deprecates the existing experience.

The new APIs introduced with worker versioning are:

  • GetWorkerVersioningRules returns assignment and redirect rules for a given task queue.

  • UpdateWorkerVersioningRules updates assignment and redirect rules for a given task queue.

  • DescribeTaskQueueEnhancedextends the functionality of DescribeTaskQueue with workflow reachability status.

A few APIs associated with legacy worker versioning have been deprecated:

  • UpdateWorkerBuildIdCompatibility replaced by UpdateWorkerVersioningRules.

  • GetWorkerBuildIdCompatibility replaced by GetWorkerVersioningRules.

  • GetWorkerTaskReachability replaced by DescribeTaskQueueEnhanced.

Note: These new Worker Versioning APIs require a server version ≥1.24.0

Internally call grpc.NewClientinstead of grpc.Dial

Internally the SDK now calls grpc.NewClientinstead of grpc.Dialbecause it was deprecated in google.golang.org/grpc

This should be a transparent change to most users, google.golang.org/grpcdoes call out one subtle difference:

One subtle difference between NewClient and Dial and DialContext is that the former uses "dns" as the default name resolver, while the latter use "passthrough" for backward compatibility. This distinction should not matter to most users, but could matter to legacy users that specify a custom dialer and expect it to receive the target string directly.

Some deprecated dial options like WithBlock, WithTimeout, WithReturnConnectionError, and FailOnNonTempDialErrorare now ignored by grpc.NewClient. See https://github.com/grpc/grpc-go/blob/master/Documentation/anti-patterns.md for more context.

See also: #1488

Child workflows now properly Continue-As-New in the TestWorkflowEnvironment

In previous version of the Go SDK when a child workflow running in the test environment tried to continue as new the parent workflow would receive an error from the child workflow. Now the child workflow properly continues as new and the parent workflow will not receive an error.

See also: #1437