github temporalio/sdk-go v1.51.0

latest release: contrib/aws/secretsmanager/v0.1.0
2 hours ago

Highlights

Added

  • Added client.Options.RPCTimeout to configure the default RPC timeout cap, including raising it above 10 seconds. Shorter caller deadlines still take precedence, and calls with dedicated timeouts (such as long polls) are unchanged.
  • converter.WorkflowTaskFailureError: an opt-in error a PayloadCodec can return from Encode or Decode on a workflow-side payload path to fail the current Workflow Task rather than the Workflow Execution, so the server retries the task and a transient codec failure can recover while the execution stays open. See the WorkflowTaskFailureError docs for the honored paths, exclusions, and retry guidance.
  • Added experimental SignalWithStartWorkflow API to the workflow package.
  • Added opt-in EncodeHeaders tracing options and workflow.CodecContextPropagator for header codec processing using the configured client's codec. Only opted-in producers' output is encoded; user-supplied wire-ready headers are unchanged. Receiving consumers use private decoded views. Custom converter wrappers can expose codec stages through converter.PayloadCodecProvider.
  • Added experimental Event Groups support: workflow.NewEventGroup, workflow.WithEventGroups, and EventGroups on workflow command options. Update handlers get an implicit group. Signal handlers do not.
  • Added client interceptor hooks for Client.GetWorkflow (GetWorkflowRun), WorkflowRun.Get/GetWithOptions (GetWorkflowResult), and Client.GetWorkflowHistory. Handle interception runs before lazy target resolution, allowing workflow IDs to be rewritten before any lookup. Result interception also runs before lazy target resolution, wraps the complete wait including followed runs, and returns the encoded result or workflow error before result decoding; history interception can wrap the lazily fetched iterator.
  • Plugins can report a version in worker heartbeats, with SimplePluginOptions.Version or a Version() string method on the plugin.
  • client.WorkflowExecutionDescription now includes RawResponse, the full workflowservice.DescribeWorkflowExecutionResponse returned by the server.
  • Added experimental temporalnexus.ConvertLinkCallbackToNexusLink and temporalnexus.ConvertNexusLinkToLinkCallback for converting Link_Callback to and from Nexus links.
  • Nexus handlers now propagate NexusSerializationContext to the workflows, workflow updates, and standalone activities they start, which use it for payloads returned to the Nexus caller: results, failures, and standalone activity heartbeat details. When completing or heartbeating such an activity from a client, pass activity.Info.NexusSerializationContext in the options.
  • Poller pools now report their poller target to the server on each poll and in the worker heartbeat: the current target for autoscaling pools, the configured maximum for fixed-size pools. Server will use this count for load balancing pollers between workers, and for creating a per-worker poller count metric

Changed

  • Existing gRPC retries now honor positive google.rpc.RetryInfo delays on ResourceExhausted responses as a minimum wait. Retries are skipped when the delay cannot fit before the call deadline.
  • WorkflowTaskPollerBehavior, ActivityTaskPollerBehavior, and NexusTaskPollerBehavior worker options are no longer marked experimental.
  • Experimental: SignalWorkflow and SignalWithStartWorkflow called through NexusClient.GetWorkflowClient() in a Temporal operation handler now reuse the operation's request ID, so a retried Nexus task no longer delivers the same signal twice. Signals sent through temporalnexus.GetClient keep an independent request ID per call and are not deduplicated.

Deprecated

  • client.Client.DescribeWorkflowExecution is deprecated. Use DescribeWorkflow and access its response's RawResponse field for the full server response instead.

💥 Breaking Changes

  • When reconstructing state for a query delivered without any new history, the SDK no longer applies input events, such as signals, that have not been processed by a completed workflow task. Replay stops at the last completed workflow task advertised with the query, even if fetched history has advanced further. This can change query results for closed workflows with pending signals. Reconstruction fails if the advertised completed task is missing from history.
  • workflow.NewContinueAsNewErrorWithOptions now calls interceptor.WorkflowOutboundInterceptor.NewContinueAsNewErrorWithOptions directly. It previously went through NewContinueAsNewError, then applied ContinueAsNewErrorOptions to the error that hook returned. An interceptor that overrides only NewContinueAsNewError no longer runs for NewContinueAsNewErrorWithOptions calls. Override the new method as well; the SDK tracing interceptors already do. An interceptor that records workflow commands inside NewContinueAsNewError can cause a non-determinism error on replay when the workflow already called NewContinueAsNewErrorWithOptions.
  • Experimental: A Temporal operation handler (temporalnexus.NewTemporalOperation) can now send only one signal per operation invocation through NexusClient.GetWorkflowClient(). SignalWorkflow and SignalWithStartWorkflow count toward the same limit. While the first signal is in flight, or after it succeeds, a second signal to any workflow returns a BAD_REQUEST handler error. If the first signal returns an error, the limit resets and the handler can signal again. Signals sent through temporalnexus.GetClient are not limited.
  • Experimental: SignalWithStartWorkflow called through NexusClient.GetWorkflowClient() in a Temporal operation handler now requires an explicit workflow ID and returns a BAD_REQUEST handler error when it is empty. An empty ID is defaulted to a fresh UUID per call, so the server has no record to deduplicate against and each retried Nexus task would start another workflow.

Fixed

  • Fixed premature activity cancellation on internal heartbeat errors when using a client created with client.NewClientFromExisting and the server supports internal error differentiation.
  • Fixed missing temporal_activity_schedule_to_start_latency samples for eagerly dispatched activities. Like polled activities, eager activities now record this metric on receipt, including during worker shutdown.
  • Fixed a data race between dynamic workflow factory re-registration and workflow definition lookup in workers and TestWorkflowEnvironment.
  • Fixed queries delivered without any new history failing with an invalid state transition when a workflow cache miss fetches history newer than the query task's replay boundary.
  • Fixed premature activity cancellation when a heartbeat RPC returns DeadlineExceeded. The SDK now preserves Temporal service error codes when deciding whether a heartbeat failure should cancel the activity.
  • Fixed concurrent dev-server CLI downloads failing on Windows when another process has already populated and started the cached executable.
  • Fixed a deadlock between data converter deadlock-detector pausing and workflow coroutine cleanup.
  • workflow.DataConverterWithoutDeadlockDetection now also exempts automatic header codec calls and their serialization-context binding from workflow deadlock detection.
  • converter.NewRemotePayloadCodec now handles endpoint URLs with trailing slashes.
  • Fixed race when using log.With without a WithLogger implementation, where logs could overwrite each others' buffers.
  • The default timeout for client and worker RPCs has been extended. Previously, the default timeout was only half the caller's context deadline - now it uses the entire deadline, up to a maximum of ten seconds. RPCs with timeout overrides, like long-poll RPCs, are unchanged.
  • Query tracing now always records inbound spans when serving queries, regardless of IsReplaying state.

What's Changed

New Contributors

Full Changelog: v1.50.0...v1.51.0

Don't miss a new sdk-go release

NewReleases is sending notifications on new releases.