Releases: temporalio/sdk-typescript
1.12.3
[1.12.3] - 2025-08-19
Bug Fixes
- Fix a recurring "Network error while sending worker heartbeat error due to PermissionDenied" warning messages in worker logs observed by Temporal Cloud users after upgrading to TS SDK 1.12.2 (#1766)
- Fix "Critical dependency: the request of a dependency is an expression" warning message emitted by workflow bundler since TS SDK 1.12.2 (#1767).
- Set default
workflowExecution.runId
to a UUID inMockActivityEnvironment
(#1723, thanks @TastyPi).
Minor features
- [Experimental] Activity pause/unpause (#1729)
Full Changelog: v1.12.2...v1.12.3
1.12.2
[1.12.2] - 2025-08-13
Bug Fixes
- fix for pinned versioning behavior on server version >=1.28.0 (#1754)
Minor features
- Add
RawValue
support for payloads to bypass custom payload converters (#1664) - The
__temporal_
prefix is now reserved for internal entities. The__stack_trace
and__enhanced_stack_trace
are also reserved for internal queries (#1644)
Notable changes
- Experimental notices for Update with Start have now been removed, it is no longer experimental (#1745)
- User metadata allows you to attach arbitrary information to workflows and events. This information can be displayed in the Temporal UI, making it easier to identify and understand workflows and their operations. (#1657)
1.12.1
[1.12.1] - 2025-07-07
Bug Fixes
- Bridge's error conversion logic now uses the
isPromise
node's utility function instead of aninstanceof Promise
check. The latter may give false negatives in Jest, resulting in not converting errors thrown from the Rust side. This has been causing Jest tests to fail withShutdownError: Worker has been shutdown
errors using TS SDK 1.12.0. (#1737)
1.12.0
[1.12.0] - 2025-07-01
Note Worthy Features
-
Add experimental support for Worker Deployment Versioning (#1679)
-
Add support for Typed Search Attributes. (#1612, #1625)
TypedSearchAttributes
are intended to replace the existing (not type-enforced)SearchAttributes
.// Define a typed search attribute; that would generally be done at the top of one's // `workflow.ts` file, or in some shared location, similar to definition of Signals, // Query and Update types const orderStatusSearchAttribute = defineSearchAttributeKey('orderStatus', 'KEYWORD');
-
Add ability to register new Search Attributes when starting a local development server (#1624)
// Starting a new local development server, immediately registering the specified search attributes. const env = await createLocalTestEnvironment({ server: { searchAttributes: [orderStatusSearchAttribute], }, });
-
Add support for the Update-with-Start API on the Workflow Client. (#1585).
Example usage
const startWorkflowOperation = WithStartWorkflowOperation.create(transactionWorkflow, { workflowId, args: [transactionID], taskQueue: 'early-return', workflowIdConflictPolicy: 'FAIL', }); // This is the result of the _update_ call const earlyConfirmation = await client.workflow.executeUpdateWithStart(getTransactionConfirmation, { startWorkflowOperation, }); // This is an handle to the workflow execution that was started. It can be used // to wait for the workflow execution to complete and capture its return value const workflowHandle = await startWorkflowOperation.workflowHandle(); const finalReport = await workflowHandle.result();
-
Add support for default activity handler, update handler and query handler. A default handler will be called for any incoming request if no handler has been explicitely set for the given type name. (#1639, #1640, #1642)
Example usage: Default Update Handler
export async function myWorkflow(useDefinedQuery: boolean): Promise<void> { setDefaultUpdateHandler((updateName, ...args: any[]) => { // ... });
Example usage: Default Query Handler
export async function myWorkflow(useDefinedQuery: boolean): Promise<void> { setDefaultQueryHandler((queryName: string, ...args: any[]) => { // ... });
-
Add experimental support for emitting custom metrics from workflows and activities. (#1705)
Example usage: From a Workflow
import * as wf from `@temporalio/workflow`;
async function myWorkflow() {
const myHistogramMetric = wf.metricMeter.createHistogram(
'my-custom-histogram',
'int', // or 'float'
'ms', // Units (optional)
'description' // (optional)
);
myHistogramMetric.record(50);
myHistogramMetric.record(50, { tag1: 'tag-value' });
}
Example usage: From an Activity
import * as act from `@temporalio/activity`
const myCounterMetric = metricMeter.createCounter('activity-counter');
async function myActivity() {
const myCounterMetric.add(1);
}
-
Add experimental support for more powerful configuration of Workflow Task Pollers and Activity Task Pollers. (#1704)
-
Add experimental support for task priority. For now, only the numeric
priority
value is supported, which is a number between 1 (top priority) and 5 (lowest priority). Priority can be set when starting workflows or scheduling activities. Note that this feature requires server side support which has not yet been released. (#1669)
Minor features
-
Add a new
category
property onApplicationFailure
. (#1719)This new option allows controlling some of the observability and logging behaviors of the Worker related to a failure thrown from an Activity.
-
Add high level API support for the
CountWorkflowExecution
operation to the Workflow Client (#1573)
That operation efficiently determine the number of Workflows matching some list filter; the list filter may also include aGROUP BY
clause.Example usage
const workflowCount = await client.workflow.count(`TaskQueue = '${taskQueue}' GROUP BY ExecutionStatus`);
after which
workflowCount
might look something like this:{ count: 5, groups: [ { count: 2, groupValues: [['Running']] }, { count: 3, groupValues: [['Completed']] }, ], };
-
[
workflow
] ExposeAbortController
to the worker sandbox (#1576, thanks @lukeramsden). -
The following APIs are no longer
@experimental
: (#1590, #1622)- Workflow Update
- Client gRPC Retry interceptor
- HTTP Proxy support
- Forwarding and filtering of Core's logs
- Configuration of Core's metrics
WorkerOptions.nonStickyToStickyPollRatio
-
[
interceptors-opentelemetry
] Propagate the OpenTelemetry tracing context from a workflow to local activities (#1577) -
[
interceptors-opentelemetry
] Add error messages to OpenTelemetry tracing span status, when applicable. (#1632, thanks @xavierroma) -
[
workflow
] Include information about the current Update (if applicable) in Workflow logging output (#1595) -
[
worker
] Add multiple Worker and Telemetry options (#1623)-
On
TelemetryOptions
:- Add the following properties:
metrics.metricPrefix
metrics.attachServiceName
metrics.globalTags
metrics.histogramBucketOverrides
metrics.otel.http
- Move
metrics.temporality
tometrics.otel.temporality
, as Core doesn't support that option on Prometheus. This is coherent with other Core-based SDKs. - Deprecate property
TelemetryOption.noTemporalPrefixForMetrics
, promoting the use of the more versatilemetrics.metricPrefix
property instead
- Add the following properties:
-
On
DevServerConfig
:- Add
server.uiPort
property — fixes #1611 - Fix the
server.dbFilename
property, which had never worked due to a naming inconsistency between the lang's interface and bridge's code
- Add
-
On
NativeConnectionOptions
:- Add boolean property
disableErrorCodeMetricTags
.
- Add boolean property
All of those change preserve compatibility with prior behaviors and deprecated settings.
-
-
Add partial support for powering a Workflow Client from a
NativeConnection
rather than aConnection
. (#1699) -
Expose root execution information from
WorkflowInfo
andWorkflowDescription
. (#1662)
Bug Fixes
-
[
workflow
] Fix multiple context leaks and bugs inreuseV8Context
executor. (#1605)- …by reassigning a new object to an existing shared global variable;
- …by modifying one of Node's built in global objects;
- …by deleting a previously set global variable;
- …by defining global symbol properties.
💣 These changes should
-
[
client
] Homogenize and clarify that default address islocalhost
everywhere in public exposed code (that's the correct thing to do and should be non-breaking everywhere except on very badly configured dual-stack machines, in which case they would have had errors anyway due to inconsistencies betweenClient
andNativeClient
). -
[
workflow
] Clearly differentiate Workflow Task Failures resulting from unhandlePromise
rejections (#1606).This was a recurring source of extremely difficult to diagnose Workflow Task failures. Going forward, a Workflow Task Failure resulting form unhandled
Promise
rejection will clearly indicate"Unhandled promise rejection"
. -
[
workflow
] Do not appear to support conflict policy when start a child workflow (#1649) -
💥 Use plain Error in FailureConverter, WorkflowFailedError, and WorkflowUpdateFailedError (#1685)
-
[
client
] Properly set temporal-namespace header on gRPC requests (#1712) -
[
bridge
] The Core Bridge layer is now much more robust, better handle various unexpected situations, and provide more detailed and more consistent error messages. (#1698)The Core Bridge layer went through a major refactor to prepare it for upcoming new features. This refactor also allowed resolution of several lifecycle bugs that could happen in various edge cases, including:
- Node discards
Promise
s created by calling into the Core Bridge with callbacks (#1302) - Process hangs on normal exit if some native resource (
NativeConnection
,Worker
,WorkflowTestEnvironment
, etc) were not properly closed (#1413). - Failure to start ephemeral server prevents shutdown of the process (#1443).
- Hundreds of OTLP errors showing up in logs when shutting down the runtime (#1495).
💥 This refactor establishes a much stronger distinction between public and internal APIs. Though we never encouraged direct import from the
@temporalio/core-bridge
package, some types were previously exported from thecore-bridge
package and reexported from a public facing package. Due to that confusion, it is possible that some users may have been previously importing types from that package. This is no longer possible and will result in compilation errors. Please import those types from the@temporalio/worker
or@temporalio/testing
packages. - Node discards
-
[
bridge
] Log forwarding from Core SDK to the TS logger is now less demanding on CPU. As part of the COre Bridge Layer refactor, log forwarding was changed to a push model, rather than a pull model; which was previously reported to cause a constant, non negligeable CPU usage, even when the Worker was left idle for long periods of time. (#1698)
Miscellaneous Tasks
-
💥 Dropped support for Node 16 (#1586).
-
Upgrade multiple vulnerable dependencies (#1603, #1614, #1627, #1637, #1667, #1709)
Thanks
Huge thanks to the following users for their contributions.
1.12.0-rc.0
[1.12.0.rc0] - 2025-05-30
Note Worthy Features
-
Add experimental support for Worker Deployment Versioning (#1679)
-
Add support for Typed Search Attributes. (#1612, #1625)
TypedSearchAttributes
are intended to replace the existing (not type-enforced)SearchAttributes
.// Define a typed search attribute; that would generally be done at the top of one's // `workflow.ts` file, or in some shared location, similar to definition of Signals, // Query and Update types const orderStatusSearchAttribute = defineSearchAttributeKey('orderStatus', 'KEYWORD');
-
Add ability to register new Search Attributes when starting a local development server (#1624)
// Starting a new local development server, immediately registering the specified search attributes. const env = await createLocalTestEnvironment({ server: { searchAttributes: [orderStatusSearchAttribute], }, });
-
Add support for the Update-with-Start API on the Workflow Client. (#1585).
Example usage
const startWorkflowOperation = WithStartWorkflowOperation.create(transactionWorkflow, { workflowId, args: [transactionID], taskQueue: 'early-return', workflowIdConflictPolicy: 'FAIL', }); // This is the result of the _update_ call const earlyConfirmation = await client.workflow.executeUpdateWithStart(getTransactionConfirmation, { startWorkflowOperation, }); // This is an handle to the workflow execution that was started. It can be used // to wait for the workflow execution to complete and capture its return value const workflowHandle = await startWorkflowOperation.workflowHandle(); const finalReport = await workflowHandle.result();
-
Add support for default activity handler, update handler and query handler. A default handler will be called for any incoming request if no handler has been explicitely set for the given type name. (#1639, #1640, #1642)
Example usage: Default Update Handler
export async function myWorkflow(useDefinedQuery: boolean): Promise<void> { setDefaultUpdateHandler((updateName, ...args: any[]) => { // ... });
Example usage: Default Query Handler
export async function myWorkflow(useDefinedQuery: boolean): Promise<void> { setDefaultQueryHandler((queryName: string, ...args: any[]) => { // ... });
-
Add experimental support for emitting custom metrics from workflows and activities. (#1705)
Example usage: From a Workflow
import * as wf from `@temporalio/workflow`;
async function myWorkflow() {
const myHistogramMetric = wf.metricMeter.createHistogram(
'my-custom-histogram',
'int', // or 'float'
'ms', // Units (optional)
'description' // (optional)
);
myHistogramMetric.record(50);
myHistogramMetric.record(50, { tag1: 'tag-value' });
}
Example usage: From an Activity
import * as act from `@temporalio/activity`
const myCounterMetric = metricMeter.createCounter('activity-counter');
async function myActivity() {
const myCounterMetric.add(1);
}
-
Add experimental support for more powerful configuration of Workflow Task Pollers and Activity Task Pollers. (#1704)
-
Add experimental support for task priority. For now, only the numeric
priority
value is supported, which is a number between 1 (top priority) and 5 (lowest priority). Priority can be set when starting workflows or scheduling activities. Note that this feature requires server side support which has not yet been released. (#1669)
Minor features
-
Add a new
category
property onApplicationFailure
. (#1719)This new option allows controlling some of the observability and logging behaviors of the Worker related to a failure thrown from an Activity.
-
Add high level API support for the
CountWorkflowExecution
operation to the Workflow Client (#1573)
That operation efficiently determine the number of Workflows matching some list filter; the list filter may also include aGROUP BY
clause.Example usage
const workflowCount = await client.workflow.count(`TaskQueue = '${taskQueue}' GROUP BY ExecutionStatus`);
after which
workflowCount
might look something like this:{ count: 5, groups: [ { count: 2, groupValues: [['Running']] }, { count: 3, groupValues: [['Completed']] }, ], };
-
[
workflow
] ExposeAbortController
to the worker sandbox (#1576, thanks @lukeramsden). -
The following APIs are no longer
@experimental
: (#1590, #1622)- Workflow Update
- Client gRPC Retry interceptor
- HTTP Proxy support
- Forwarding and filtering of Core's logs
- Configuration of Core's metrics
WorkerOptions.nonStickyToStickyPollRatio
-
[
interceptors-opentelemetry
] Propagate the OpenTelemetry tracing context from a workflow to local activities (#1577) -
[
interceptors-opentelemetry
] Add error messages to OpenTelemetry tracing span status, when applicable. (#1632, thanks @xavierroma) -
[
workflow
] Include information about the current Update (if applicable) in Workflow logging output (#1595) -
[
worker
] Add multiple Worker and Telemetry options (#1623)-
On
TelemetryOptions
:- Add the following properties:
metrics.metricPrefix
metrics.attachServiceName
metrics.globalTags
metrics.histogramBucketOverrides
metrics.otel.http
- Move
metrics.temporality
tometrics.otel.temporality
, as Core doesn't support that option on Prometheus. This is coherent with other Core-based SDKs. - Deprecate property
TelemetryOption.noTemporalPrefixForMetrics
, promoting the use of the more versatilemetrics.metricPrefix
property instead
- Add the following properties:
-
On
DevServerConfig
:- Add
server.uiPort
property — fixes #1611 - Fix the
server.dbFilename
property, which had never worked due to a naming inconsistency between the lang's interface and bridge's code
- Add
-
On
NativeConnectionOptions
:- Add boolean property
disableErrorCodeMetricTags
.
- Add boolean property
All of those change preserve compatibility with prior behaviors and deprecated settings.
-
-
Add partial support for powering a Workflow Client from a
NativeConnection
rather than aConnection
. (#1699) -
Expose root execution information from
WorkflowInfo
andWorkflowDescription
. (#1662)
Bug Fixes
-
[
workflow
] Fix multiple context leaks and bugs inreuseV8Context
executor. (#1605)- …by reassigning a new object to an existing shared global variable;
- …by modifying one of Node's built in global objects;
- …by deleting a previously set global variable;
- …by defining global symbol properties.
💣 These changes should
-
[
client
] Homogenize and clarify that default address islocalhost
everywhere in public exposed code (that's the correct thing to do and should be non-breaking everywhere except on very badly configured dual-stack machines, in which case they would have had errors anyway due to inconsistencies betweenClient
andNativeClient
). -
[
workflow
] Clearly differentiate Workflow Task Failures resulting from unhandlePromise
rejections (#1606).This was a recurring source of extremely difficult to diagnose Workflow Task failures. Going forward, a Workflow Task Failure resulting form unhandled
Promise
rejection will clearly indicate"Unhandled promise rejection"
. -
[
workflow
] Do not appear to support conflict policy when start a child workflow (#1649) -
💥 Use plain Error in FailureConverter, WorkflowFailedError, and WorkflowUpdateFailedError (#1685)
-
[
client
] Properly set temporal-namespace header on gRPC requests (#1712) -
[
bridge
] The Core Bridge layer is now much more robust, better handle various unexpected situations, and provide more detailed and more consistent error messages. (#1698)The Core Bridge layer went through a major refactor to prepare it for upcoming new features. This refactor also allowed resolution of several lifecycle bugs that could happen in various edge cases, including:
- Node discards
Promise
s created by calling into the Core Bridge with callbacks (#1302) - Process hangs on normal exit if some native resource (
NativeConnection
,Worker
,WorkflowTestEnvironment
, etc) were not properly closed (#1413). - Failure to start ephemeral server prevents shutdown of the process (#1443).
- Hundreds of OTLP errors showing up in logs when shutting down the runtime (#1495).
💥 This refactor establishes a much stronger distinction between public and internal APIs. Though we never encouraged direct import from the
@temporalio/core-bridge
package, some types were previously exported from thecore-bridge
package and reexported from a public facing package. Due to that confusion, it is possible that some users may have been previously importing types from that package. This is no longer possible and will result in compilation errors. Please import those types from the@temporalio/worker
or@temporalio/testing
packages. - Node discards
-
[
bridge
] Log forwarding from Core SDK to the TS logger is now less demanding on CPU. As part of the COre Bridge Layer refactor, log forwarding was changed to a push model, rather than a pull model; which was previously reported to cause a constant, non negligeable CPU usage, even when the Worker was left idle for long periods of time. (#1698)
Miscellaneous Tasks
-
💥 Dropped support for Node 16 (#1586).
-
Upgrade multiple vulnerable dependencies (#1603, #1614, #1627, #1637, #1667, #1709)
Thanks
Huge thanks to the following users for their contributions.
1.11.8
1.11.7
1.11.6
[1.11.6] - 2025-01-08
Features
-
Introduce Update-with-Start (#1585)
-
Aside from Update-with-Start, all Workflow Update APIs are no longer experimental (#1590)
-
[
client
] Addclient.workflow.count
high level API (#1573, thanks to @THardy98) -
[
workflow
] ExposeAbortController
to the worker sandbox (#1576, thanks to @lukeramsden) -
[
workflow
] Propagate OpenTelemetry context when scheduling local activities (#1577, thanks to @THardy98)
Misc
- Thanks to @GSmithApps for doc improvements (#1591)
1.11.5
Noteworthy Changes
-
Normalize construction of user facing enums (#1534)
All user-facing enums have been revisited to be more in line with usual TypeScript conventions, rather than sticking to Temporal's Protobuf enum definitions.
In short, that means:
- No more redundant prefixes on enum values;
- No more
UNSPECIFIED
values — TypeScript'sundefined
already means that; - Enum types are now string unions, and users may choose to provide the string value directly.
For example:
await startChild(sleep, { - parentClosePolicy: ParentClosePolicy.PARENT_CLOSE_POLICY_ABANDON, + parentClosePolicy: ParentClosePolicy.ABANDON, /* or even */ + parentClosePolicy: 'ABANDON', });
Built-time compatibility is preserved for enum values that existed before. For example, code using
ParentClosePolicy.PARENT_CLOSE_POLICY_ABANDON
will still compile, but a deprecation will be reported.💥 Compile-time backward compatibility is only preserved for enums that were imported from user facing packages, such as
@temporalio/common
,@temporalio/client
and@temporalio/workflow
. Enum definitions imported directly from the@temporalio/proto
package may no longer compile.
Features
-
Add experimental support for user-implementable Slot Supplier. (#1553, temporalio/sdk-core#838, temporalio/sdk-core#842)
-
Add support for Workflow ID conflict policy. (#1490)
-
Expose classes
TextEncoder
andTextDecoder
inside of the Workflow sandbox. (#1562, kudo to @lukeramsden) -
The OpenTelemetry Interceptor now adds correlation metadata on emitted logs from Workflow and Activity context loggers. (#1565)
-
The OpenTelemetry Interceptor now passes the tracing metadata on signals. (#1449, kudo to @iravid)
-
[
client
] Add utility functionsisGrpcDeadlineError
andisGrpcCancelledError
. (#1548)
Bug Fixes
-
[
worker
] Fix memory leak on non-existant activity (#1563) -
[
activity
] Abort reason is now an instance ofCancellationFailure
(#1561, kudo to @ikonst) -
[
worker
] Ensure Resource Tuner always hand out a minimum of one slot for sticky and not sticky Workflow Task pollers (temporalio/sdk-core#835)