Releases: temporalio/sdk-typescript
v1.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)
Docs
Miscellaneous Tasks
1.11.4
1.11.3
Bug Fixes
- [
worker
] Gracefully shut down Worker on unexpected errors (#1539) - [
worker
] Avoid a spurious error if Worker receives SIGINT while already shutting down (#1547)
Features
- [
Schedule
] Support query for listing schedules (#1535, Kudos to @nikhilbhatia08 🙏) - [
client
] :test: Add experimental support for Cloud Operations API (#1538)
1.11.2
Important ⚠️ ⚠️ ⚠️
- This release fixes a bug in 1.11.0 and 1.11.1 that may result in Workflows failing to replay with the very same code.
We urge users who are already using v1.11.0 or v1.11.1 to promptly upgrade to this release.
Bug Fixes
- [
workflow
] Workflow Activation Encoder was discarding SDK flags (#1530) - [
core
] Respect gRPC timeouts on get wf execution history (temporalio/sdk-core#812) - [
core
] Attempt to address unusal rpc cancellation error (temporalio/sdk-core#811) - [
core
] Fix legacy query failure replying (temporalio/sdk-core#809) - [
core
] Fix possible NDEs caused by LAs & immediate cancels resolving in different order upon replay (temporalio/sdk-core#808) - [
workflow
] Fix potential incoherencies in Workflow Activation Jobs ordering (#1513, temporalio/sdk-core#789) - [
core
] Include Search Attribute updates made in-workflow when continuing as new (temporalio/sdk-core#797) - [
core
] Add basic validation on Activity Tasks (temporalio/sdk-core#795) - [
core
] Do not send queries after we would fail WFT (temporalio/sdk-core#792)
Dependencies
Thanks
- Thanks to Ilya Priven for multiple docs improvements (#1507, #1525, #1527, #1524).
1.11.1
1.11.0
Bug Fixes
- Fix flakes in Worker Tuner and Workflow Update tests (#1463)
- [
workflow
] Don't propagate cancellation from non-cancellable scopes to children (#1429) - [
worker
] Don't fail Worker on Activity Task decode failures (port from #1473) (#1477) - [
ci
] Enable file-based persistence on dev server for stress tests (#1480) - [
workflow
] Fix cancel-before-started abandon activity (#1487) - [
doc
] Docs were no longer being built and deployed in CI (#1494) - [
workflow
] Process all activation jobs as a single batch (#1488)
Documentation
- Clarify some drawbacks of ephemeral servers, and other minor fixes (#1478)
Features
Resource-based Worker Auto-tuning (EXPERIMENTAL)
Experimental support for worker tuning has been added along with an implementation for auto-tuning based on available
resources. WorkerOptions
now has a tuner
field that can be set to a WorkerTuner
. This is composed of SlotSupplier
s, of which currently FixedSize
and ResourceBased
are available. ResourceBased
tuners change the number of available slots dynamically based on resource usage. For some examples of initializing the worker tuner, see here.
At some point the SlotSupplier
interface will be manually implementable, but only fixed-size and resource-based slot suppliers are currently supported. Custom slot suppliers will appear in the future.
This SDK API is experimental and may change in incompatible ways in the future.
- [
workflow
] Unify GRPC::CANCELED and DEADLINE_EXCEEDED in an SDK Timeout exception for Update (#1452) - [
workflow
] Expose updateId to update handlers (#1450) - [
workflow
] Add upsert memo command (#1321)
Miscellaneous Tasks
- Bump GHA runner for stress tests (#1492)
Client
- Make gRPC INTERNAL status retryable (#1455)