Skip to content

Releases: temporalio/sdk-go

v1.31.0

10 Dec 21:15
1b21084
Compare
Choose a tag to compare

Nexus Breaking Changes

Add support for full Temporal error rehydration to provide a more consistent experience for Temporal users and on par debugging experience with workflows and activities..
Any Temporal errors returned over the Nexus boundary will now automatically be fully rehydrated on the caller side.

Some notable points:

  • The Nexus SDK was upgraded to v0.1.0, which is a breaking change. Temporal Nexus users should refer to the release notes before upgrading the Temporal SDK.
  • nexus.HandlerError now has a Failure representation and is visible to the caller workflow.
  • Arbitrary errors are translated to ApplicationError as they do in the rest of the Temporal SDK.
  • WorkflowExecutionError, QueryRejectedError, and non retryable ApplicationErrors are no longer translated to bad request handler errors, instead they're translated to OperationErrors.

Update With Start

UpdateWithStartWorkflow issues an update-with-start request. A WorkflowIDConflictPolicy must be set in the options. If the specified workflow execution is not running, then a new workflow execution is started and the update is sent in the first workflow task. Alternatively if the specified workflow execution is running then, if the WorkflowIDConflictPolicy is USE_EXISTING, the update is issued against the specified workflow, and if the WorkflowIDConflictPolicy is FAIL, an error is returned. The call will block until the update has reached the WaitForStage in the options. Note that this means that the call will notreturn successfully until the update has been delivered to a worker.

Changes in this release:

Instead of using the ExecuteWorkflow client method, update-with-start is invoked via a new client method UpdateWithStartWorkflow.
To use this method, you should first use NewWithStartWorkflowOperation to define the start-workflow operation. A workflow ID conflict policy is required. Then call UpdateWithStartWorkflow, passing it an UpdateWithStartWorkflowOptions containing your WithStartWorkflowOperation, together with an UpdateWorkflowOptions defining the update operation. This will return an UpdateHandle. The WithStartWorkflowOperation exposes a blocking .Get(ctx) method to obtain the workflow run targeted by the update.

New Contributors

What's Changed

2024-12-02 - 2c6bc1d - Introduce separate slot supplier for session activities (#1736)
2024-12-03 - 9c4dde8 - Use constant case in Nexus link URL eventType query param (#1741)
2024-12-03 - aa4535d - WorkflowTestSuite.UpdateWorkflow generate an update ID if none (#1738)
2024-12-05 - 01b52a2 - Tweak UpdateWorfklow docs (#1745)
2024-12-05 - 9d59447 - New Update-With-Start API (#1731)
2024-12-06 - 1f35a5b - mock: in order mock calls using new testify mock.InOrder() method (#1743)
2024-12-06 - 7828e06 - Update Godoc for internal structs/funcs to clarify the package they are exposed under (#1735)
2024-12-09 - 41e9b33 - Tweak Update-with-Start error reporting (#1746)
2024-12-10 - 1b21084 - Bump SDKVersion to 1.31.0 (#1753)
2024-12-10 - d21ede2 - Nexus error rehydration (#1751)

Full Changelog: v1.30.1...v1.31.0

v1.30.1

27 Nov 22:15
158b823
Compare
Choose a tag to compare

Breaking Changes

Nexus async Operations backed by ExecuteUntypedWorkflow (i.e. NewWorkflowRunOperation and NewWorkflowRunOperationWithOptions) are now required to set the workflow ID on the StartWorkflowOptions parameter. If workflow ID is unset, the new error ErrMissingWorkflowID will be returned.

What's Changed

New Contributors

Full Changelog: v1.30.0...v1.30.1

v1.30.0

29 Oct 18:24
1f91c83
Compare
Choose a tag to compare

Highlights

Nexus

We have made some improvements in Nexus metrics, nexus_task_execution_failed is now tagged with a failure_reason to help users understand the cause of the task failure.

see also: https://docs.temporal.io/references/sdk-metrics#nexus_task_execution_failed

Test Environment

Improved support for mocking Nexus operations so you won’t need to have access to the operation itself or implementing a dummy operation. You can mock by calling OnNexusOperation and, when appropriate, RegisterNexusAsyncOperationCompletion.

Docs coming soon.

Worker shutdown

When a Go SDK worker s shutting down it will now communicate to the Temporal service through a new ShutdownWorker API that the worker is no longer taking more tasks. If the Temporal service supports this feature all sticky workflow tasks will be assigned back to the normal task queue. This should reduce latency caused by shutting down a worker due to stick task queue timeout.

What's Changed

2024-09-17 - 03e0341 - Use stable CLI for tests (#1637)
2024-09-17 - 8283604 - Remove DISABLE_NEXUS_TESTS env var from test code (#1640)
2024-09-23 - d10e871 - Update workflowcheck and allow it to handle aliased context (#1642)
2024-09-24 - cf3153e - expose ScheduleDescription (#1649)
2024-10-01 - 974ccc0 - Call the ShutdownWorker API as part of workflow worker cleanup (#1645)
2024-10-01 - f0ac2ee - Fix Nexus test env to respect ScheduleToCloseTimeout (#1636)
2024-10-02 - 772bc83 - MultiOperation retries non-durable Update (#1652)
2024-10-03 - 4e8380c - Error for unused Update operation (#1655)
2024-10-03 - cdd3070 - Remove history truncation (#1656)
2024-10-03 - d7a2128 - Enforce nexus request timeout in workflow test suite (#1653)
2024-10-03 - ea60ad5 - Evict the workflow from cache if their is a panic in the SDK (#1654)
2024-10-04 - 7d57a66 - ensure WorkflowTaskExecutionFailureCounter is called with a tag (#1658)
2024-10-08 - 75bd94b - Panic if endpoint or service is empty in NewNexusClient (#1661)
2024-10-08 - b300e50 - Nexus: Fix link not being attached to a workflow started via a Handler function (#1659)
2024-10-08 - b4e934e - Include updateID and updateName in update logger (#1660)
2024-10-08 - c82a8ac - Error if history contains unexpected events after the StartedEventId (#1662)
2024-10-09 - 3671c99 - fix link (#1665)
2024-10-14 - e503995 - Fix nexus_task_execution_failed to include OperationError outcome in start requests (#1664)
2024-10-15 - 7432064 - Add regression test to validate temporal_workflow_task_execution_failed on replay (#1669)
2024-10-16 - 959f581 - Read cgroups for resource tuner limits (#1632)
2024-10-16 - cfc38de - Fix TestNonDeterminismFailureCauseReplay integration test (#1674)
2024-10-18 - 1a13bf3 - Add Nexus failure_reason metric tag (#1671)
2024-10-24 - 5505d04 - Fix failure_reason label for nexus_task_execution_failed metric on task timeout (#1684)
2024-10-24 - 56b601d - Bump Nexus sdk-go to v0.0.11 (#1685)
2024-10-25 - 2bd372c - Upgrade API to v1.40.0 (#1688)
2024-10-25 - c0a1b59 - Translate gRPC Canceled code to Nexus HandlerErrorTypeInternal (#1680)
2024-10-28 - 37d1775 - Support for mocking nexus operations (#1666)
2024-10-28 - 4afb587 - Update-with-Start incompatible options (#1690)

v1.29.1

11 Sep 18:53
592ae12
Compare
Choose a tag to compare

What's Changed

Full Changelog: v1.29.0...v1.29.1

v1.29.0

05 Sep 21:52
c8cb430
Compare
Choose a tag to compare

Highlights

Workflow Update-With-Start (Private Preview)

Note: This feature requires a server version 1.24+ and must be enabled. For self hosted you can set frontend.enableExecuteMultiOperation for Temporal Cloud please reach out to your Temporal account team orΒ Temporal Support TeamΒ to enable update with start in your namespace.

This release add support for Workflow Update-With-Start. Update-With-Start allows users to send a Workflow Update request along with a Start Workflow request in the same RPC. Users can think of Update-With-Start as analogous to Signal-With-Start except for Updates instead of Signals. To create a Update with start request users call client.NewUpdateWithStartWorkflowOperation and pass it to WorkflowOptions.WithStartOperation .

Slot auto tuning (Private Preview)

  • Added WorkerOptions.Tuner which is a WorkerTuner composed of SlotSupplier s. These interfaces can be used to customize how the worker decides to make slots available for Workflow and Activity Tasks. Some default slot suppliers are included:

  • ResourceBasedSlotSupplier can be used to tune the workers slot count based on available memory and cpu resources. Make a ready-to-go WorkerTuner by using NewResourceBasedTuner. You can set a memory/cpu target and the worker will automatically try to reach those target usage levels.

  • FixedSizeSlotSupplier always hands out slots until an upper bound

  • CompositeTuner can be used to combine different kinds of SlotSuppliers to implement WorkerTuner.

Please give the resource based tuning a try and let us know how it works for you (feedback on community slack is welcome)! It'll work best if the worker is the only thing on your host using significant resources. Try setting the thresholds to a reasonable value like 0.8

Note: Resource based tuning and custom Slot Supplier implementations are currently considered experimental.

User Metadata (Public Preview)

Note: This feature requires a server version 1.25+

This release add support for user metadata inside Workflows. This lets users set custom metadata on Workflow executions and certain APIs inside workflow that will be visible on the UI

Currently the Go SDK support:

  • Fixed "summary" and "details" on workflow start
  • Details on timer names through workflow.NewTimerWithOptions
  • Details on signals, updates and query handlers through workflow.SignalChannelOptions, workflow.QueryHandlerOptions and workflow.UpdateHandlerOptions

See also: temporalio/features#486

What's Changed

2024-07-23 - 9c40461 - Add utility to get metrics handler for a Nexus operation (#1559)
2024-07-25 - bcc623d - Add support for managing schedule search attributes when when updating a schedule (#1562)
2024-07-26 - 1f0296c - Support for WorkflowIdConflictPolicy (#1563)
2024-07-29 - 2baa60e - Test duplicate rejected updates (#1569)
2024-07-29 - 6bb8f99 - Add rule code to warning (#1572)
2024-07-29 - dd28ced - Protect against legacy queries when state is destroyed (#1568)
2024-08-05 - 9b9201f - Use correct branch when not a pull request (#1578)
2024-08-05 - c5b519e - Build omes worker image w/ pending changes (#1577)
2024-08-06 - a1d05a6 - WorkerTuner & Resource based autotuning (#1546)
2024-08-06 - c2ce2e6 - Do not warn on unfinished handlers if workflow failed (#1581)
2024-08-08 - 2927574 - Switch omes to post-merge (#1583)
2024-08-09 - 0b7928d - Fix UpsertTypedSearchAttributes docs typo (#1585)
2024-08-14 - bb42a8b - Fix Go SDK CI (#1590)
2024-08-14 - c3ac511 - Improve docs and tests for HandlerUnfinishedPolicy (#1589)
2024-08-15 - 2a02c48 - Removing wording saying a signal will ignore start delay (#1592)
2024-08-15 - b5db2b7 - Add TaskQueueStats to DescribeTaskQueueEnhanced (#1553)
2024-08-20 - edc3c6c - Allow workflow interceptors to add nexus headers (#1604)
2024-08-21 - 1fe6141 - Support updates in tracing interceptor (#1595)
2024-08-21 - a31f86d - Address flaky tests (#1607)
2024-08-22 - 9bcc1a9 - Minor docstring grammar updates in activity.go (#1608)
2024-08-23 - 94f2100 - Minor correction to TQ stats docs (#1606)
2024-08-28 - 5364a47 - Handle Nexus links (#1605)
2024-08-29 - e85a098 - Update-with-Start operation (#1579)
2024-08-30 - 1b6220d - Mark Nexus link converter functions as experimental (#1615)
2024-08-30 - f47e644 - Experimental user metadata and workflow metadata query support (#1597)
2024-09-03 - 2af8c72 - Narrow scope of used slots lock for tracking slot supplier (#1617)
2024-09-03 - 52ea97f - Mark NewTimerWithOptions as Experimental (#1619)
2024-09-03 - eb41d13 - Expose QueryRejectedError (#1616)

2024-07-23 - 9c40461 - Add utility to get metrics handler for a Nexus operation (#1559)
2024-07-25 - bcc623d - Add support for managing schedule search attributes when when updating a schedule (#1562)
2024-07-26 - 1f0296c - Support for WorkflowIdConflictPolicy (#1563)
2024-07-29 - 2baa60e - Test duplicate rejected updates (#1569)
2024-07-29 - 6bb8f99 - Add rule code to warning (#1572)
2024-07-29 - dd28ced - Protect against legacy queries when state is destroyed (#1568)
2024-08-05 - 9b9201f - Use correct branch when not a pull request (#1578)
2024-08-05 - c5b519e - Build omes worker image w/ pending changes (#1577)
2024-08-06 - a1d05a6 - WorkerTuner & Resource based autotuning (#1546)
2024-08-06 - c2ce2e6 - Do not warn on unfinished handlers if workflow failed (#1581)
2024-08-08 - 2927574 - Switch omes to post-merge (#1583)
2024-08-09 - 0b7928d - Fix UpsertTypedSearchAttributes docs typo (#1585)
2024-08-14 - bb42a8b - Fix Go SDK CI (#1590)
2024-08-14 - c3ac511 - Improve docs and tests for HandlerUnfinishedPolicy (#1589)
2024-08-15 - 2a02c48 - Removing wording saying a signal will ignore start delay (#1592)
2024-08-15 - b5db2b7 - Add TaskQueueStats to DescribeTaskQueueEnhanced (#1553)
2024-08-20 - edc3c6c - Allow workflow interceptors to add nexus headers (#1604)
2024-08-21 - 1fe6141 - Support updates in tracing interceptor (#1595)
2024-08-21 - a31f86d - Address flaky tests (#1607)
2024-08-22 - 9bcc1a9 - Minor docstring grammar updates in activity.go (#1608)
2024-08-23 - 94f2100 - Minor correction to TQ stats docs (#1606)
2024-08-28 - 5364a47 - Handle Nexus links (#1605)
2024-08-29 - e85a098 - Update-with-Start operation (#1579)
2024-08-30 - 1b6220d - Mark Nexus link converter functions as experimental (#1615)
2024-08-30 - f47e644 - Experimental user metadata and workflow metadata query support (#1597)
2024-09-03 - 2af8c72 - Narrow scope of used slots lock for tracking slot supplier (#1617)
2024-09-03 - 52ea97f - Mark NewTimerWithOptions as Experimental (#1619)
2024-09-03 - eb41d13 - Expose QueryRejectedError (#1616)
2024-09-05 - 6f8719a - Improve active task queue definition (#1621)

v1.28.1

22 Jul 23:47
0732f3d
Compare
Choose a tag to compare

Specific Changes

v1.28.0

22 Jul 22:44
50e993e
Compare
Choose a tag to compare

Nexus pre-release

⚠️ EXPERIMENTAL - APIs may change in a future release ⚠️

See the proposal for usage instructions.

Self hosted users can try Nexus out in single cluster deployments with server version 1.25.0-rc.0 - not meant for production use.

Temporal Cloud users may reach out and open a support ticket to request access to the pre-release.

To use Nexus with the temporal CLI dev server:

  1. download CLI 0.14.0-nexus.0 to the current directory:

    curl -sSf https://temporal.download/cli.sh | sh -s -- --version v0.14.0-nexus.0 --dir .
    
  2. run the dev server with the required configs:

    ./temporal server start-dev --dynamic-config-value system.enableNexus=true --http-port 7243
    

Warn on unfinished handlers

The SDK will now WARN by default if a workflow is completed by the SDK with unfinished update handlers. Users can use workflow.AllHandlersFinished to wait for all handlers to be finished or set UnfinishedPolicy in UpdateHandlerOptions.

Add Workflow safe Mutex and Semaphore

This release includes new helper interfaces workflow.Mutex and workflow.Semaphore that are workflow safe versions of a mutex and semaphore. These interfaces are to help users synchronize sensitive business logic across multiple coroutines or update handlers.

What's Changed

v1.27.0

13 Jun 23:33
b376f24
Compare
Choose a tag to compare

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Β DisableErrorCodeMetricTagsΒ onΒ 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.
  • DescribeTaskQueueEnhanced extends 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.NewClientΒ instead ofΒ grpc.Dial

Internally the SDK now callsΒ grpc.NewClientΒ instead ofΒ grpc.DialΒ because it was deprecated inΒ google.golang.org/grpc

This should be a transparent change to most users,Β google.golang.org/grpcΒ does 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 FailOnNonTempDialError are 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

Specific Changes

2024-04-12 - c4bf074 - datadog: Add tracer option to check error eligibility in the span (#1438)
2024-04-17 - 69bc6c3 - Update reapply (#1436)
2024-04-23 - 93c08b0 - Ensure consistent labels for rpc metrics (#1444)
2024-04-24 - 8361067 - Disable UTF8-invalid tests when running CLI dev server (#1448)
2024-04-30 - fe44a47 - Improve error message for missing body (#1451)
2024-05-01 - d051de6 - Option to redirect devserver stdout/stderr to a file (#1452)
2024-05-09 - 386a6d3 - Require update handler to have a context (#1457)
2024-05-09 - ded70a3 - Add support for NextRetryDelay for local activities (#1456)
2024-05-10 - 81cd5dc - Fix QueryRejectCondition parameter in QueryWorkflowWithOptions (#1461)
2024-05-10 - c69831e - Remove DisableStickyExecution (#1464)
2024-05-14 - 3b68c6d - Add request failure code label to metrics (#1472)
2024-05-17 - aa17647 - get-free-port: prevent duplicate ports on Linux (#1478)
2024-05-21 - 06c0ebc - Add SetFailureConverter to the activity and workflow test environments (#1484)
2024-05-21 - 222d4cf - Fix gauge metrics with latest otel SDK (#1482)
2024-05-21 - 725b428 - Only record activity_succeed_endtoend_latency on success (#1481)
2024-05-21 - fb06909 - Send original update request back in response (#1480)
2024-05-22 - bf2c79d - Switch to using Float64Gauge in otel integration (#1485)
2024-05-24 - a6ca6a5 - Replace grpc.Dial with grpc.NewClient (#1488)
2024-05-28 - bcfa85a - Workflow update client API refactor (#1489)
2024-05-31 - 486c233 - Minor logger improovments (#1495)
2024-05-31 - 4dd1ed8 - Fix bugs when using a custom FailureConverter in tests (#1490)
2024-06-06 - 0df7ad5 - Bump GitHub Actions (#1503)
2024-06-06 - 17193aa - Manually copy proxy options (#1502)
2024-06-06 - 5c171b7 - Make backfill tests more robust (#1504)
2024-06-06 - 9ecb2a4 - Change GetUpdateInfo to GetCurrentUpdateInfo (#1505)
2024-06-06 - bf29944 - testsuite.StartDevServer: Respect timeout during dial (#1498)
2024-06-07 - c73a007 - Support the new versioning API (#1494)
2024-06-10 - d4ff1f6 - Fix flake in TestUpdateAdmittedNoWorker (#1506)
2024-06-12 - 38fe879 - Always run all the versioning tests (#1510)
2024-06-12 - a7c8208 - Allow SDK to handle speculative WFT with command events (#1509)
2024-06-13 - 2720358 - Improve CI action (#1512)
2024-06-13 - 30a29ce - Add integration test for reset with update events (#1507)
2024-06-13 - 4c8b9e1 - Update API to v1.34.0 (#1511)

v1.26.1

10 Apr 23:54
5bff6f8
Compare
Choose a tag to compare

Highlights

Bugfixes

Fixes a bug with typed search attributes for child workflows not being properly applied to new child workflow executions.

Specific Changes

2024-03-12 - 9c42221 - Make client Dial context controlable by callers (#1416)
2024-03-13 - 03d7704 - Update readme badge to github action (#1422)
2024-03-18 - 3da09e0 - Switch github runner to macos-14 (m1) (#1421)
2024-03-25 - 00fd4cd - Remove experimental flag from Start Delay (#1428)
2024-04-04 - 0cfdccb - Clarified description of workflow.Now (#1430)
2024-04-08 - 108aac8 - Fix support for typed search attributes in child workflow options (#1434)
2024-04-09 - a02b92e - Add support for unit testing child workflows that call continue-as-new (#1437)
2024-04-10 - 0007eee - Bump api-go to 1.32.0 to include Versioning 2 API changes (#1439)

v1.26.0

11 Mar 21:33
3b9c572
Compare
Choose a tag to compare

Typed search attributes

Previously, search attributes were untyped maps with string keys and interface values. This causes ambiguity on what types a search attribute key represents and leads to errors. Also, the way search attributes were created or upserted allowed mistakes to occur and was not clear to the server exactly what was expected.

  • Added TypedSearchAttributes to client.ScheduleOptions and deprecated SearchAttributes
  • Added GetTypedSearchAttributes to workflow and deprecated WorkflowInfo.SearchAttributes
  • Added UpsertTypedSearchAttributes to workflow and deprecated UpsertSearchAttributes
  • Added TypedSearchAttributes to client.StartWorkflowOptions and deprecated SearchAttributes
  • Added several new things to temporal package including:
    • SearchAttributes collection with methods and constructor
    • SearchAttributeKey and SearchAttributeUpdate interfaces
    • SearchAttributeKeyX types and constructors for typed keys

πŸ’₯ BREAKING CHANGES

gogo/protobuf

gogo/protobuf has been replaced with Google's official proto compiler.

Users may notice:

  • time.Time in proto structs will now be timestamppb.Timestamp
  • time.Duration will now be durationpb.Duration
  • V2-generated structs embed locks, so you cannot dereference them.
  • Proto enums will, when formatted to JSON, now be in SCREAMING_SNAKE_CASE rather than PascalCase.

Note on invalid UTF-8 data stored as proto strings

Prior to SDK version v1.26.0 our protobuf code generator allowed invalid UTF-8 data to be stored as proto strings. This isn't actually allowed by the proto3 spec, so if you're using our SDK and think you may store arbitrary binary data in our strings you should set -tags protolegacy when building against our SDK.
Example:

$ go build -tags protolegacy myworker/main.go

If you see an error like grpc: error unmarshalling request: string field contains invalid UTF-8 then you will need to enable this when building your code.
If you're unsure then you should specify it anyways as there's no harm in doing so unless you relied on the protobuf compiler to ensure all strings were valid UTF-8.

HTTP/2 Keep Alive

HTTP/2 Keep alive is now enabled by default. This should help avoid request timeouts on previously idle connections. If users want to revert to the old behavior they can set ConnectionOptions.DisableKeepAliveCheck to false.

See also: #1299

Typed search attributes

As part of typed search attributes most old untyped search attributes API were deprecated, but will continue to function as they always have been going forward some breaking changes were required.

See also: #1368

Breaking changes include:

  • Added TypedSearchAttributes to client.ScheduleWorkflowAction and πŸ’₯removed SearchAttributes and added UntypedSearchAttributes (needed until temporalio/temporal#4787 is fixed)

Workflow Update (Experimental)

Workflow update handlers are now processed eagerly before the main workflow function instead of after. This means coroutine ordering can change causing non-determinism. When calling workflow.SetUpdateHandler and an update was received during that workflow task, and no other handlers have been set before, workflow.SetUpdateHandler will trigger the queued update handlers to run.

Activity and Workflow mock name collision in Test Suite

Fixed a bug in the workflow test suite that would cause workflow and activity mocks that shared the same name to override each other. If your test was doing this and asserting on the number of times a mock was called you may notice a change in behavior as activity and workflow mocks are now stored in separate maps.

see also: #1371

πŸ’₯ Rollback Note

Due to this change in update processing , rolling back the SDK to a pre v1.26.0 version may cause workflow using workflow update (receiving update requests or registering an update handler) to get stuck with non determinism errors until they roll forward again.

Other changes

  • Tag workflow_task_execution_failed metric with error type to help differentiate workflow task failures caused by non determinism from other task failures

  • Dump coroutine stack on deadlock timeout. When the SDK detects a deadlock it will now try to dump the stack trace of the coroutine it detected as deadlocked.

  • Add deterministic range over map helper. Iterating over Go's standard maps is not deterministic and therefore cannot be done in a workflow context. The SDK now includes helpers DeterministicKeys and DeterministicKeysFunc to get the keys of a map in a deterministic order.

Specific Changes

2023-10-13 - 06c90fb - Propagate Baggage in OTEL tracing interceptor (#1260)
2023-10-26 - 3cccbdd - Fix error documentation typos and enum values (#1276)
2023-10-31 - 0352634 - Add EmitDefault option for ProtoJson converter (#1286)
2023-11-08 - 0e432a9 - Add context propagators to local activity executions through test environments (#1291)
2023-11-08 - 4663bab - Fix typo in documentation (#1288)
2023-11-17 - 8068455 - Delete .github/workflows/semgrep.yml (#1294)
2023-11-21 - f9d73bf - Replace gogo protobuf (#1256)
2023-11-22 - 7db0d87 - Use the official features repo (#1298)
2023-11-27 - 745e948 - Add NotBefore function to testsuite.MockCallWrapper (#1301)
2023-11-27 - f5a0127 - Edit docstrings (#1302)
2023-11-28 - 33e8360 - Multi-platform CI and Makefile removal (#1293)
2023-11-28 - 70c8400 - Fix doc typo (#1305)
2023-11-28 - 8f2a3c8 - Use our new JSON coding stack (#1307)
2023-11-29 - 288a04f - Bump api-go version to fix Payload marshaling (#1308)
2023-11-29 - 89c8dba - Enabled keep alive by default (#1299)
2023-11-30 - 266e049 - Fix race in WaitSignalReturnParam (#1309)
2023-11-30 - 802d32e - Run cloud tests in series to avoid wfID conflict (#1311)
2023-11-30 - a309e59 - Tag workflow_task_execution_failed with error type (#1295)
2023-12-04 - 5fdbecc - Handle updates immediately when registered (#1306)
2023-12-04 - 838121a - Don't run workflowCancelHandler in test harness (#1296)
2023-12-04 - 987379d - Make remoteDataConverter implement PayloadCodec (#1303)
2023-12-04 - eb05747 - Fix flaky test (#1314)
2023-12-07 - 5d5b9c4 - Fix typo in docstring (#1317)
2023-12-14 - 7a9640d - Fix typo in update docstring (#1321)
2023-12-15 - f823b64 - Cleanup dead code and incorrect use of go routine in context pkg (#1320)
2023-12-27 - 95fe6ab - Fix bad Update mock in NamespaceClient (#1328)
2023-12-30 - 5a64898 - Failed Read-Only check causes a WFT failure in validator (#1329)
2024-01-04 - cb1d35e - Update dd-trace-go.v1 (#1332)
2024-01-05 - 2f61d2f - Add last BuildID to workflow info (#1335)
2024-01-07 - 7fc12d3 - Add otel metrics support (#1336)
2024-01-08 - 6244097 - Include update state machine fields in panic (#1327)
2024-01-08 - c1744ee - Bump go-api version to fix protojson vuln (#1333)
2024-01-09 - 1fe10d5 - Fix flaky build id issue (#1338)
2024-01-09 - 5ca9a4d - Add deterministic range over map helper (#1340)
2024-01-13 - fac7f7f - Update WorkflowRun.Get Doc String (#1346)
2024-01-16 - 0f12265 - Replace go.uber.org/atomic with sync/atomic (#1344)
2024-01-16 - 41d2288 - Evict workflow from cache on RespondTaskCompleted failure (#1358)
2024-01-16 - 54e131e - Make dataConverterWithoutDeadlock context aware (#1348)
2024-01-17 - 14103e0 - regenerate mocks with latest mockery (#1361)
2024-01-17 - 50ab40d - regenerate mocks under client to allow dynamic returns based on arguments (#1353)
2024-01-17 - 55c39b5 - Disable eager activities if tq rate limits is set (#1350)
2024-01-17 - b50cce9 - Replace some Sprintfs with string concatenation (#1345)
2024-01-17 - e3a3d95 - Always yield when registering update handles (#1325)
2024-01-19 - 14ddd7b - Dump coroutine stack on deadlock timeout (#1356)
2024-01-22 - 171504d - Fail task on unknown event when HistoryEvent.worker_may_ignore is false (#1363)
2024-01-22 - 30b2681 - Exit coroutine in order (#1362)
2024-01-22 - 94a5f5f - Allow client to suggest delay until next retry (#1319)
2024-01-26 - 536b875 - Exclude codes.DeadlineExceeded from the list of retryable gRPC codes (#1366)
2024-02-01 - 57b6679 - Typed Search Attributes (#1368)
2024-02-01 - 86764f8 - Handle nil valuePtr case in update handler Get (#1373)
2024-02-01 - a7c9528 - Prefix some errors with rule identifiers (#1281)
2024-02-01 - e2bec16 - Fix testing suite name conflict for workflow and activity (#887) (#1371)
2024-02-02 - 5c8c9a3 - Release Go SDK version 1.26.0-RC.1 (#1374)
2024-02-05 - 262766c - Fix data race on desiredWorkflowCacheSize (#1377)
2024-02-08 - 246a7d2 - Rectify the default values for keep-alive timeout (#1381)
2024-02-08 - 72a5b6f - workflowcheck: bump golang.org/x/tools from 0.13.0 to 0.17.0 (#1379)
2024-02-13 - d39fa9d - Add support for typed search attributes to the test suite (#1378)
2024-02-14 - 30da688 - Introduce a new constructor to override retry policy in ContinueAsNewError (#1383)
2024-02-20 - 5621b7f - Clarify OnUpsertTypedSearchAttributes (#1391)
2024-02-20 - 65aae9b - Document GetSearchAttributes is not supported on cloud (#1388)
2024-02-21 - 6d4ec2d - Make it possible to cancel workflows by ID when testing (#1392)
2024-02-22 - a71e4c4 - Update CI to Go lang 1.22 (#1389)
2024-02-27 - 34ef0a7 - Only set SDKPriorityUpdateHandling if workflow update is being used (#1398)
2024-02-27 - 54b2336 - Add note NextRetryDelay is not supported on the ser...

Read more