@temporal-contract/worker / workflow
workflow
Classes
ChildWorkflowCancelledError
Defined in: packages/worker/src/errors.ts:204
Discriminated variant of ChildWorkflowError surfaced when a child workflow operation (start, execute, or wait-for-result) was cancelled — either because the parent workflow itself was cancelled, the child was explicitly cancelled, or its enclosing cancellation scope was. Detected via @temporalio/workflow's isCancellation(...), which sees through nested ChildWorkflowFailure / CancelledFailure chains.
Extends ChildWorkflowError so existing instanceof ChildWorkflowError checks still match cancellation, while instanceof ChildWorkflowCancelledError lets call sites narrow further when they need to branch on cancellation explicitly without inspecting error.cause against a Temporal SDK class — the worker-side analogue of the client-side cause-forwarding pattern.
Extends
Constructors
Constructor
new ChildWorkflowCancelledError(workflowName, cause?): ChildWorkflowCancelledError;Defined in: packages/worker/src/errors.ts:205
Parameters
| Parameter | Type |
|---|---|
workflowName | string |
cause? | unknown |
Returns
Overrides
ChildWorkflowError.constructor
Properties
| Property | Modifier | Type | Description | Inherited from | Defined in |
|---|---|---|---|---|---|
cause? | public | unknown | - | ChildWorkflowError.cause | node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2022.error.d.ts:24 |
message | public | string | - | ChildWorkflowError.message | node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es5.d.ts:1075 |
name | public | string | - | ChildWorkflowError.name | node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es5.d.ts:1074 |
stack? | public | string | - | ChildWorkflowError.stack | node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es5.d.ts:1076 |
workflowName | readonly | string | - | - | packages/worker/src/errors.ts:206 |
stackTraceLimit | static | number | The Error.stackTraceLimit property specifies the number of stack frames collected by a stack trace (whether generated by new Error().stack or Error.captureStackTrace(obj)). The default value is 10 but may be set to any valid JavaScript number. Changes will affect any stack trace captured after the value has been changed. If set to a non-number value, or set to a negative number, stack traces will not capture any frames. | ChildWorkflowError.stackTraceLimit | node_modules/.pnpm/@types+node@24.12.2/node_modules/@types/node/globals.d.ts:68 |
Methods
captureStackTrace()
static captureStackTrace(targetObject, constructorOpt?): void;Defined in: node_modules/.pnpm/@types+node@24.12.2/node_modules/@types/node/globals.d.ts:52
Creates a .stack property on targetObject, which when accessed returns a string representing the location in the code at which Error.captureStackTrace() was called.
const myObject = {};
Error.captureStackTrace(myObject);
myObject.stack; // Similar to `new Error().stack`The first line of the trace will be prefixed with ${myObject.name}: ${myObject.message}.
The optional constructorOpt argument accepts a function. If given, all frames above constructorOpt, including constructorOpt, will be omitted from the generated stack trace.
The constructorOpt argument is useful for hiding implementation details of error generation from the user. For instance:
function a() {
b();
}
function b() {
c();
}
function c() {
// Create an error without stack trace to avoid calculating the stack trace twice.
const { stackTraceLimit } = Error;
Error.stackTraceLimit = 0;
const error = new Error();
Error.stackTraceLimit = stackTraceLimit;
// Capture the stack trace above function b
Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace
throw error;
}
a();Parameters
| Parameter | Type |
|---|---|
targetObject | object |
constructorOpt? | Function |
Returns
void
Inherited from
ChildWorkflowError.captureStackTrace
prepareStackTrace()
static prepareStackTrace(err, stackTraces): any;Defined in: node_modules/.pnpm/@types+node@24.12.2/node_modules/@types/node/globals.d.ts:56
Parameters
| Parameter | Type |
|---|---|
err | Error |
stackTraces | CallSite[] |
Returns
any
See
https://v8.dev/docs/stack-trace-api#customizing-stack-traces
Inherited from
ChildWorkflowError.prepareStackTrace
ChildWorkflowError
Defined in: packages/worker/src/errors.ts:183
Generic error for child workflow operations.
When the child execution itself fails (Temporal's ChildWorkflowFailure), cause is set to the unwrapped underlying failure (ApplicationFailure, TimeoutFailure, TerminatedFailure, etc.) lifted from Temporal's wrapper — mirroring the client-side WorkflowFailedError.cause behavior, so callers can branch on the failure category in one step instead of unwrapping twice.
Extends
WorkerError
Extended by
Constructors
Constructor
new ChildWorkflowError(message, cause?): ChildWorkflowError;Defined in: packages/worker/src/errors.ts:184
Parameters
| Parameter | Type |
|---|---|
message | string |
cause? | unknown |
Returns
Overrides
WorkerError.constructorProperties
Methods
captureStackTrace()
static captureStackTrace(targetObject, constructorOpt?): void;Defined in: node_modules/.pnpm/@types+node@24.12.2/node_modules/@types/node/globals.d.ts:52
Creates a .stack property on targetObject, which when accessed returns a string representing the location in the code at which Error.captureStackTrace() was called.
const myObject = {};
Error.captureStackTrace(myObject);
myObject.stack; // Similar to `new Error().stack`The first line of the trace will be prefixed with ${myObject.name}: ${myObject.message}.
The optional constructorOpt argument accepts a function. If given, all frames above constructorOpt, including constructorOpt, will be omitted from the generated stack trace.
The constructorOpt argument is useful for hiding implementation details of error generation from the user. For instance:
function a() {
b();
}
function b() {
c();
}
function c() {
// Create an error without stack trace to avoid calculating the stack trace twice.
const { stackTraceLimit } = Error;
Error.stackTraceLimit = 0;
const error = new Error();
Error.stackTraceLimit = stackTraceLimit;
// Capture the stack trace above function b
Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace
throw error;
}
a();Parameters
| Parameter | Type |
|---|---|
targetObject | object |
constructorOpt? | Function |
Returns
void
Inherited from
WorkerError.captureStackTraceprepareStackTrace()
static prepareStackTrace(err, stackTraces): any;Defined in: node_modules/.pnpm/@types+node@24.12.2/node_modules/@types/node/globals.d.ts:56
Parameters
| Parameter | Type |
|---|---|
err | Error |
stackTraces | CallSite[] |
Returns
any
See
https://v8.dev/docs/stack-trace-api#customizing-stack-traces
Inherited from
WorkerError.prepareStackTraceChildWorkflowNotFoundError
Defined in: packages/worker/src/errors.ts:163
Error thrown when a child workflow is not found in the contract
Extends
WorkerError
Constructors
Constructor
new ChildWorkflowNotFoundError(workflowName, availableWorkflows?): ChildWorkflowNotFoundError;Defined in: packages/worker/src/errors.ts:164
Parameters
| Parameter | Type | Default value |
|---|---|---|
workflowName | string | undefined |
availableWorkflows | readonly string[] | [] |
Returns
Overrides
WorkerError.constructorProperties
| Property | Modifier | Type | Default value | Description | Inherited from | Defined in |
|---|---|---|---|---|---|---|
availableWorkflows | readonly | readonly string[] | [] | - | - | packages/worker/src/errors.ts:166 |
cause? | public | unknown | undefined | - | WorkerError.cause | node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2022.error.d.ts:24 |
message | public | string | undefined | - | WorkerError.message | node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es5.d.ts:1075 |
name | public | string | undefined | - | WorkerError.name | node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es5.d.ts:1074 |
stack? | public | string | undefined | - | WorkerError.stack | node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es5.d.ts:1076 |
workflowName | readonly | string | undefined | - | - | packages/worker/src/errors.ts:165 |
stackTraceLimit | static | number | undefined | The Error.stackTraceLimit property specifies the number of stack frames collected by a stack trace (whether generated by new Error().stack or Error.captureStackTrace(obj)). The default value is 10 but may be set to any valid JavaScript number. Changes will affect any stack trace captured after the value has been changed. If set to a non-number value, or set to a negative number, stack traces will not capture any frames. | WorkerError.stackTraceLimit | node_modules/.pnpm/@types+node@24.12.2/node_modules/@types/node/globals.d.ts:68 |
Methods
captureStackTrace()
static captureStackTrace(targetObject, constructorOpt?): void;Defined in: node_modules/.pnpm/@types+node@24.12.2/node_modules/@types/node/globals.d.ts:52
Creates a .stack property on targetObject, which when accessed returns a string representing the location in the code at which Error.captureStackTrace() was called.
const myObject = {};
Error.captureStackTrace(myObject);
myObject.stack; // Similar to `new Error().stack`The first line of the trace will be prefixed with ${myObject.name}: ${myObject.message}.
The optional constructorOpt argument accepts a function. If given, all frames above constructorOpt, including constructorOpt, will be omitted from the generated stack trace.
The constructorOpt argument is useful for hiding implementation details of error generation from the user. For instance:
function a() {
b();
}
function b() {
c();
}
function c() {
// Create an error without stack trace to avoid calculating the stack trace twice.
const { stackTraceLimit } = Error;
Error.stackTraceLimit = 0;
const error = new Error();
Error.stackTraceLimit = stackTraceLimit;
// Capture the stack trace above function b
Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace
throw error;
}
a();Parameters
| Parameter | Type |
|---|---|
targetObject | object |
constructorOpt? | Function |
Returns
void
Inherited from
WorkerError.captureStackTraceprepareStackTrace()
static prepareStackTrace(err, stackTraces): any;Defined in: node_modules/.pnpm/@types+node@24.12.2/node_modules/@types/node/globals.d.ts:56
Parameters
| Parameter | Type |
|---|---|
err | Error |
stackTraces | CallSite[] |
Returns
any
See
https://v8.dev/docs/stack-trace-api#customizing-stack-traces
Inherited from
WorkerError.prepareStackTraceQueryInputValidationError
Defined in: packages/worker/src/errors.ts:107
Error thrown when query input validation fails
Extends
WorkerError
Constructors
Constructor
new QueryInputValidationError(queryName, issues): QueryInputValidationError;Defined in: packages/worker/src/errors.ts:108
Parameters
| Parameter | Type |
|---|---|
queryName | string |
issues | readonly Issue[] |
Returns
Overrides
WorkerError.constructorProperties
| Property | Modifier | Type | Description | Inherited from | Defined in |
|---|---|---|---|---|---|
cause? | public | unknown | - | WorkerError.cause | node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2022.error.d.ts:24 |
issues | readonly | readonly Issue[] | - | - | packages/worker/src/errors.ts:110 |
message | public | string | - | WorkerError.message | node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es5.d.ts:1075 |
name | public | string | - | WorkerError.name | node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es5.d.ts:1074 |
queryName | readonly | string | - | - | packages/worker/src/errors.ts:109 |
stack? | public | string | - | WorkerError.stack | node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es5.d.ts:1076 |
stackTraceLimit | static | number | The Error.stackTraceLimit property specifies the number of stack frames collected by a stack trace (whether generated by new Error().stack or Error.captureStackTrace(obj)). The default value is 10 but may be set to any valid JavaScript number. Changes will affect any stack trace captured after the value has been changed. If set to a non-number value, or set to a negative number, stack traces will not capture any frames. | WorkerError.stackTraceLimit | node_modules/.pnpm/@types+node@24.12.2/node_modules/@types/node/globals.d.ts:68 |
Methods
captureStackTrace()
static captureStackTrace(targetObject, constructorOpt?): void;Defined in: node_modules/.pnpm/@types+node@24.12.2/node_modules/@types/node/globals.d.ts:52
Creates a .stack property on targetObject, which when accessed returns a string representing the location in the code at which Error.captureStackTrace() was called.
const myObject = {};
Error.captureStackTrace(myObject);
myObject.stack; // Similar to `new Error().stack`The first line of the trace will be prefixed with ${myObject.name}: ${myObject.message}.
The optional constructorOpt argument accepts a function. If given, all frames above constructorOpt, including constructorOpt, will be omitted from the generated stack trace.
The constructorOpt argument is useful for hiding implementation details of error generation from the user. For instance:
function a() {
b();
}
function b() {
c();
}
function c() {
// Create an error without stack trace to avoid calculating the stack trace twice.
const { stackTraceLimit } = Error;
Error.stackTraceLimit = 0;
const error = new Error();
Error.stackTraceLimit = stackTraceLimit;
// Capture the stack trace above function b
Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace
throw error;
}
a();Parameters
| Parameter | Type |
|---|---|
targetObject | object |
constructorOpt? | Function |
Returns
void
Inherited from
WorkerError.captureStackTraceprepareStackTrace()
static prepareStackTrace(err, stackTraces): any;Defined in: node_modules/.pnpm/@types+node@24.12.2/node_modules/@types/node/globals.d.ts:56
Parameters
| Parameter | Type |
|---|---|
err | Error |
stackTraces | CallSite[] |
Returns
any
See
https://v8.dev/docs/stack-trace-api#customizing-stack-traces
Inherited from
WorkerError.prepareStackTraceQueryOutputValidationError
Defined in: packages/worker/src/errors.ts:121
Error thrown when query output validation fails
Extends
WorkerError
Constructors
Constructor
new QueryOutputValidationError(queryName, issues): QueryOutputValidationError;Defined in: packages/worker/src/errors.ts:122
Parameters
| Parameter | Type |
|---|---|
queryName | string |
issues | readonly Issue[] |
Returns
Overrides
WorkerError.constructorProperties
| Property | Modifier | Type | Description | Inherited from | Defined in |
|---|---|---|---|---|---|
cause? | public | unknown | - | WorkerError.cause | node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2022.error.d.ts:24 |
issues | readonly | readonly Issue[] | - | - | packages/worker/src/errors.ts:124 |
message | public | string | - | WorkerError.message | node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es5.d.ts:1075 |
name | public | string | - | WorkerError.name | node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es5.d.ts:1074 |
queryName | readonly | string | - | - | packages/worker/src/errors.ts:123 |
stack? | public | string | - | WorkerError.stack | node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es5.d.ts:1076 |
stackTraceLimit | static | number | The Error.stackTraceLimit property specifies the number of stack frames collected by a stack trace (whether generated by new Error().stack or Error.captureStackTrace(obj)). The default value is 10 but may be set to any valid JavaScript number. Changes will affect any stack trace captured after the value has been changed. If set to a non-number value, or set to a negative number, stack traces will not capture any frames. | WorkerError.stackTraceLimit | node_modules/.pnpm/@types+node@24.12.2/node_modules/@types/node/globals.d.ts:68 |
Methods
captureStackTrace()
static captureStackTrace(targetObject, constructorOpt?): void;Defined in: node_modules/.pnpm/@types+node@24.12.2/node_modules/@types/node/globals.d.ts:52
Creates a .stack property on targetObject, which when accessed returns a string representing the location in the code at which Error.captureStackTrace() was called.
const myObject = {};
Error.captureStackTrace(myObject);
myObject.stack; // Similar to `new Error().stack`The first line of the trace will be prefixed with ${myObject.name}: ${myObject.message}.
The optional constructorOpt argument accepts a function. If given, all frames above constructorOpt, including constructorOpt, will be omitted from the generated stack trace.
The constructorOpt argument is useful for hiding implementation details of error generation from the user. For instance:
function a() {
b();
}
function b() {
c();
}
function c() {
// Create an error without stack trace to avoid calculating the stack trace twice.
const { stackTraceLimit } = Error;
Error.stackTraceLimit = 0;
const error = new Error();
Error.stackTraceLimit = stackTraceLimit;
// Capture the stack trace above function b
Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace
throw error;
}
a();Parameters
| Parameter | Type |
|---|---|
targetObject | object |
constructorOpt? | Function |
Returns
void
Inherited from
WorkerError.captureStackTraceprepareStackTrace()
static prepareStackTrace(err, stackTraces): any;Defined in: node_modules/.pnpm/@types+node@24.12.2/node_modules/@types/node/globals.d.ts:56
Parameters
| Parameter | Type |
|---|---|
err | Error |
stackTraces | CallSite[] |
Returns
any
See
https://v8.dev/docs/stack-trace-api#customizing-stack-traces
Inherited from
WorkerError.prepareStackTraceSignalInputValidationError
Defined in: packages/worker/src/errors.ts:93
Error thrown when signal input validation fails
Extends
WorkerError
Constructors
Constructor
new SignalInputValidationError(signalName, issues): SignalInputValidationError;Defined in: packages/worker/src/errors.ts:94
Parameters
| Parameter | Type |
|---|---|
signalName | string |
issues | readonly Issue[] |
Returns
Overrides
WorkerError.constructorProperties
| Property | Modifier | Type | Description | Inherited from | Defined in |
|---|---|---|---|---|---|
cause? | public | unknown | - | WorkerError.cause | node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2022.error.d.ts:24 |
issues | readonly | readonly Issue[] | - | - | packages/worker/src/errors.ts:96 |
message | public | string | - | WorkerError.message | node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es5.d.ts:1075 |
name | public | string | - | WorkerError.name | node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es5.d.ts:1074 |
signalName | readonly | string | - | - | packages/worker/src/errors.ts:95 |
stack? | public | string | - | WorkerError.stack | node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es5.d.ts:1076 |
stackTraceLimit | static | number | The Error.stackTraceLimit property specifies the number of stack frames collected by a stack trace (whether generated by new Error().stack or Error.captureStackTrace(obj)). The default value is 10 but may be set to any valid JavaScript number. Changes will affect any stack trace captured after the value has been changed. If set to a non-number value, or set to a negative number, stack traces will not capture any frames. | WorkerError.stackTraceLimit | node_modules/.pnpm/@types+node@24.12.2/node_modules/@types/node/globals.d.ts:68 |
Methods
captureStackTrace()
static captureStackTrace(targetObject, constructorOpt?): void;Defined in: node_modules/.pnpm/@types+node@24.12.2/node_modules/@types/node/globals.d.ts:52
Creates a .stack property on targetObject, which when accessed returns a string representing the location in the code at which Error.captureStackTrace() was called.
const myObject = {};
Error.captureStackTrace(myObject);
myObject.stack; // Similar to `new Error().stack`The first line of the trace will be prefixed with ${myObject.name}: ${myObject.message}.
The optional constructorOpt argument accepts a function. If given, all frames above constructorOpt, including constructorOpt, will be omitted from the generated stack trace.
The constructorOpt argument is useful for hiding implementation details of error generation from the user. For instance:
function a() {
b();
}
function b() {
c();
}
function c() {
// Create an error without stack trace to avoid calculating the stack trace twice.
const { stackTraceLimit } = Error;
Error.stackTraceLimit = 0;
const error = new Error();
Error.stackTraceLimit = stackTraceLimit;
// Capture the stack trace above function b
Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace
throw error;
}
a();Parameters
| Parameter | Type |
|---|---|
targetObject | object |
constructorOpt? | Function |
Returns
void
Inherited from
WorkerError.captureStackTraceprepareStackTrace()
static prepareStackTrace(err, stackTraces): any;Defined in: node_modules/.pnpm/@types+node@24.12.2/node_modules/@types/node/globals.d.ts:56
Parameters
| Parameter | Type |
|---|---|
err | Error |
stackTraces | CallSite[] |
Returns
any
See
https://v8.dev/docs/stack-trace-api#customizing-stack-traces
Inherited from
WorkerError.prepareStackTraceUpdateInputValidationError
Defined in: packages/worker/src/errors.ts:135
Error thrown when update input validation fails
Extends
WorkerError
Constructors
Constructor
new UpdateInputValidationError(updateName, issues): UpdateInputValidationError;Defined in: packages/worker/src/errors.ts:136
Parameters
| Parameter | Type |
|---|---|
updateName | string |
issues | readonly Issue[] |
Returns
Overrides
WorkerError.constructorProperties
| Property | Modifier | Type | Description | Inherited from | Defined in |
|---|---|---|---|---|---|
cause? | public | unknown | - | WorkerError.cause | node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2022.error.d.ts:24 |
issues | readonly | readonly Issue[] | - | - | packages/worker/src/errors.ts:138 |
message | public | string | - | WorkerError.message | node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es5.d.ts:1075 |
name | public | string | - | WorkerError.name | node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es5.d.ts:1074 |
stack? | public | string | - | WorkerError.stack | node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es5.d.ts:1076 |
updateName | readonly | string | - | - | packages/worker/src/errors.ts:137 |
stackTraceLimit | static | number | The Error.stackTraceLimit property specifies the number of stack frames collected by a stack trace (whether generated by new Error().stack or Error.captureStackTrace(obj)). The default value is 10 but may be set to any valid JavaScript number. Changes will affect any stack trace captured after the value has been changed. If set to a non-number value, or set to a negative number, stack traces will not capture any frames. | WorkerError.stackTraceLimit | node_modules/.pnpm/@types+node@24.12.2/node_modules/@types/node/globals.d.ts:68 |
Methods
captureStackTrace()
static captureStackTrace(targetObject, constructorOpt?): void;Defined in: node_modules/.pnpm/@types+node@24.12.2/node_modules/@types/node/globals.d.ts:52
Creates a .stack property on targetObject, which when accessed returns a string representing the location in the code at which Error.captureStackTrace() was called.
const myObject = {};
Error.captureStackTrace(myObject);
myObject.stack; // Similar to `new Error().stack`The first line of the trace will be prefixed with ${myObject.name}: ${myObject.message}.
The optional constructorOpt argument accepts a function. If given, all frames above constructorOpt, including constructorOpt, will be omitted from the generated stack trace.
The constructorOpt argument is useful for hiding implementation details of error generation from the user. For instance:
function a() {
b();
}
function b() {
c();
}
function c() {
// Create an error without stack trace to avoid calculating the stack trace twice.
const { stackTraceLimit } = Error;
Error.stackTraceLimit = 0;
const error = new Error();
Error.stackTraceLimit = stackTraceLimit;
// Capture the stack trace above function b
Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace
throw error;
}
a();Parameters
| Parameter | Type |
|---|---|
targetObject | object |
constructorOpt? | Function |
Returns
void
Inherited from
WorkerError.captureStackTraceprepareStackTrace()
static prepareStackTrace(err, stackTraces): any;Defined in: node_modules/.pnpm/@types+node@24.12.2/node_modules/@types/node/globals.d.ts:56
Parameters
| Parameter | Type |
|---|---|
err | Error |
stackTraces | CallSite[] |
Returns
any
See
https://v8.dev/docs/stack-trace-api#customizing-stack-traces
Inherited from
WorkerError.prepareStackTraceUpdateOutputValidationError
Defined in: packages/worker/src/errors.ts:149
Error thrown when update output validation fails
Extends
WorkerError
Constructors
Constructor
new UpdateOutputValidationError(updateName, issues): UpdateOutputValidationError;Defined in: packages/worker/src/errors.ts:150
Parameters
| Parameter | Type |
|---|---|
updateName | string |
issues | readonly Issue[] |
Returns
Overrides
WorkerError.constructorProperties
| Property | Modifier | Type | Description | Inherited from | Defined in |
|---|---|---|---|---|---|
cause? | public | unknown | - | WorkerError.cause | node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2022.error.d.ts:24 |
issues | readonly | readonly Issue[] | - | - | packages/worker/src/errors.ts:152 |
message | public | string | - | WorkerError.message | node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es5.d.ts:1075 |
name | public | string | - | WorkerError.name | node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es5.d.ts:1074 |
stack? | public | string | - | WorkerError.stack | node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es5.d.ts:1076 |
updateName | readonly | string | - | - | packages/worker/src/errors.ts:151 |
stackTraceLimit | static | number | The Error.stackTraceLimit property specifies the number of stack frames collected by a stack trace (whether generated by new Error().stack or Error.captureStackTrace(obj)). The default value is 10 but may be set to any valid JavaScript number. Changes will affect any stack trace captured after the value has been changed. If set to a non-number value, or set to a negative number, stack traces will not capture any frames. | WorkerError.stackTraceLimit | node_modules/.pnpm/@types+node@24.12.2/node_modules/@types/node/globals.d.ts:68 |
Methods
captureStackTrace()
static captureStackTrace(targetObject, constructorOpt?): void;Defined in: node_modules/.pnpm/@types+node@24.12.2/node_modules/@types/node/globals.d.ts:52
Creates a .stack property on targetObject, which when accessed returns a string representing the location in the code at which Error.captureStackTrace() was called.
const myObject = {};
Error.captureStackTrace(myObject);
myObject.stack; // Similar to `new Error().stack`The first line of the trace will be prefixed with ${myObject.name}: ${myObject.message}.
The optional constructorOpt argument accepts a function. If given, all frames above constructorOpt, including constructorOpt, will be omitted from the generated stack trace.
The constructorOpt argument is useful for hiding implementation details of error generation from the user. For instance:
function a() {
b();
}
function b() {
c();
}
function c() {
// Create an error without stack trace to avoid calculating the stack trace twice.
const { stackTraceLimit } = Error;
Error.stackTraceLimit = 0;
const error = new Error();
Error.stackTraceLimit = stackTraceLimit;
// Capture the stack trace above function b
Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace
throw error;
}
a();Parameters
| Parameter | Type |
|---|---|
targetObject | object |
constructorOpt? | Function |
Returns
void
Inherited from
WorkerError.captureStackTraceprepareStackTrace()
static prepareStackTrace(err, stackTraces): any;Defined in: node_modules/.pnpm/@types+node@24.12.2/node_modules/@types/node/globals.d.ts:56
Parameters
| Parameter | Type |
|---|---|
err | Error |
stackTraces | CallSite[] |
Returns
any
See
https://v8.dev/docs/stack-trace-api#customizing-stack-traces
Inherited from
WorkerError.prepareStackTraceWorkflowCancelledError
Defined in: packages/worker/src/errors.ts:226
Error surfaced in the err(...) branch of a ResultAsync when a typed cancellation scope is cancelled via Temporal's cancellation propagation. Returned by both context.cancellableScope (when the workflow or an ancestor scope cancels) and context.nonCancellableScope (when cancellation is raised from inside the scope). Distinct from arbitrary thrown errors so call sites can branch on cancellation explicitly.
Non-cancellation errors thrown inside a scope surface as a sibling WorkflowScopeError on the same err(...) channel, so callers can use instanceof to discriminate without falling back to try/catch.
Extends
WorkerError
Constructors
Constructor
new WorkflowCancelledError(cause?): WorkflowCancelledError;Defined in: packages/worker/src/errors.ts:227
Parameters
| Parameter | Type |
|---|---|
cause? | unknown |
Returns
Overrides
WorkerError.constructorProperties
Methods
captureStackTrace()
static captureStackTrace(targetObject, constructorOpt?): void;Defined in: node_modules/.pnpm/@types+node@24.12.2/node_modules/@types/node/globals.d.ts:52
Creates a .stack property on targetObject, which when accessed returns a string representing the location in the code at which Error.captureStackTrace() was called.
const myObject = {};
Error.captureStackTrace(myObject);
myObject.stack; // Similar to `new Error().stack`The first line of the trace will be prefixed with ${myObject.name}: ${myObject.message}.
The optional constructorOpt argument accepts a function. If given, all frames above constructorOpt, including constructorOpt, will be omitted from the generated stack trace.
The constructorOpt argument is useful for hiding implementation details of error generation from the user. For instance:
function a() {
b();
}
function b() {
c();
}
function c() {
// Create an error without stack trace to avoid calculating the stack trace twice.
const { stackTraceLimit } = Error;
Error.stackTraceLimit = 0;
const error = new Error();
Error.stackTraceLimit = stackTraceLimit;
// Capture the stack trace above function b
Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace
throw error;
}
a();Parameters
| Parameter | Type |
|---|---|
targetObject | object |
constructorOpt? | Function |
Returns
void
Inherited from
WorkerError.captureStackTraceprepareStackTrace()
static prepareStackTrace(err, stackTraces): any;Defined in: node_modules/.pnpm/@types+node@24.12.2/node_modules/@types/node/globals.d.ts:56
Parameters
| Parameter | Type |
|---|---|
err | Error |
stackTraces | CallSite[] |
Returns
any
See
https://v8.dev/docs/stack-trace-api#customizing-stack-traces
Inherited from
WorkerError.prepareStackTraceWorkflowInputValidationError
Defined in: packages/worker/src/errors.ts:65
Error thrown when workflow input validation fails
Extends
WorkerError
Constructors
Constructor
new WorkflowInputValidationError(workflowName, issues): WorkflowInputValidationError;Defined in: packages/worker/src/errors.ts:66
Parameters
| Parameter | Type |
|---|---|
workflowName | string |
issues | readonly Issue[] |
Returns
Overrides
WorkerError.constructorProperties
| Property | Modifier | Type | Description | Inherited from | Defined in |
|---|---|---|---|---|---|
cause? | public | unknown | - | WorkerError.cause | node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2022.error.d.ts:24 |
issues | readonly | readonly Issue[] | - | - | packages/worker/src/errors.ts:68 |
message | public | string | - | WorkerError.message | node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es5.d.ts:1075 |
name | public | string | - | WorkerError.name | node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es5.d.ts:1074 |
stack? | public | string | - | WorkerError.stack | node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es5.d.ts:1076 |
workflowName | readonly | string | - | - | packages/worker/src/errors.ts:67 |
stackTraceLimit | static | number | The Error.stackTraceLimit property specifies the number of stack frames collected by a stack trace (whether generated by new Error().stack or Error.captureStackTrace(obj)). The default value is 10 but may be set to any valid JavaScript number. Changes will affect any stack trace captured after the value has been changed. If set to a non-number value, or set to a negative number, stack traces will not capture any frames. | WorkerError.stackTraceLimit | node_modules/.pnpm/@types+node@24.12.2/node_modules/@types/node/globals.d.ts:68 |
Methods
captureStackTrace()
static captureStackTrace(targetObject, constructorOpt?): void;Defined in: node_modules/.pnpm/@types+node@24.12.2/node_modules/@types/node/globals.d.ts:52
Creates a .stack property on targetObject, which when accessed returns a string representing the location in the code at which Error.captureStackTrace() was called.
const myObject = {};
Error.captureStackTrace(myObject);
myObject.stack; // Similar to `new Error().stack`The first line of the trace will be prefixed with ${myObject.name}: ${myObject.message}.
The optional constructorOpt argument accepts a function. If given, all frames above constructorOpt, including constructorOpt, will be omitted from the generated stack trace.
The constructorOpt argument is useful for hiding implementation details of error generation from the user. For instance:
function a() {
b();
}
function b() {
c();
}
function c() {
// Create an error without stack trace to avoid calculating the stack trace twice.
const { stackTraceLimit } = Error;
Error.stackTraceLimit = 0;
const error = new Error();
Error.stackTraceLimit = stackTraceLimit;
// Capture the stack trace above function b
Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace
throw error;
}
a();Parameters
| Parameter | Type |
|---|---|
targetObject | object |
constructorOpt? | Function |
Returns
void
Inherited from
WorkerError.captureStackTraceprepareStackTrace()
static prepareStackTrace(err, stackTraces): any;Defined in: node_modules/.pnpm/@types+node@24.12.2/node_modules/@types/node/globals.d.ts:56
Parameters
| Parameter | Type |
|---|---|
err | Error |
stackTraces | CallSite[] |
Returns
any
See
https://v8.dev/docs/stack-trace-api#customizing-stack-traces
Inherited from
WorkerError.prepareStackTraceWorkflowOutputValidationError
Defined in: packages/worker/src/errors.ts:79
Error thrown when workflow output validation fails
Extends
WorkerError
Constructors
Constructor
new WorkflowOutputValidationError(workflowName, issues): WorkflowOutputValidationError;Defined in: packages/worker/src/errors.ts:80
Parameters
| Parameter | Type |
|---|---|
workflowName | string |
issues | readonly Issue[] |
Returns
Overrides
WorkerError.constructorProperties
| Property | Modifier | Type | Description | Inherited from | Defined in |
|---|---|---|---|---|---|
cause? | public | unknown | - | WorkerError.cause | node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2022.error.d.ts:24 |
issues | readonly | readonly Issue[] | - | - | packages/worker/src/errors.ts:82 |
message | public | string | - | WorkerError.message | node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es5.d.ts:1075 |
name | public | string | - | WorkerError.name | node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es5.d.ts:1074 |
stack? | public | string | - | WorkerError.stack | node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es5.d.ts:1076 |
workflowName | readonly | string | - | - | packages/worker/src/errors.ts:81 |
stackTraceLimit | static | number | The Error.stackTraceLimit property specifies the number of stack frames collected by a stack trace (whether generated by new Error().stack or Error.captureStackTrace(obj)). The default value is 10 but may be set to any valid JavaScript number. Changes will affect any stack trace captured after the value has been changed. If set to a non-number value, or set to a negative number, stack traces will not capture any frames. | WorkerError.stackTraceLimit | node_modules/.pnpm/@types+node@24.12.2/node_modules/@types/node/globals.d.ts:68 |
Methods
captureStackTrace()
static captureStackTrace(targetObject, constructorOpt?): void;Defined in: node_modules/.pnpm/@types+node@24.12.2/node_modules/@types/node/globals.d.ts:52
Creates a .stack property on targetObject, which when accessed returns a string representing the location in the code at which Error.captureStackTrace() was called.
const myObject = {};
Error.captureStackTrace(myObject);
myObject.stack; // Similar to `new Error().stack`The first line of the trace will be prefixed with ${myObject.name}: ${myObject.message}.
The optional constructorOpt argument accepts a function. If given, all frames above constructorOpt, including constructorOpt, will be omitted from the generated stack trace.
The constructorOpt argument is useful for hiding implementation details of error generation from the user. For instance:
function a() {
b();
}
function b() {
c();
}
function c() {
// Create an error without stack trace to avoid calculating the stack trace twice.
const { stackTraceLimit } = Error;
Error.stackTraceLimit = 0;
const error = new Error();
Error.stackTraceLimit = stackTraceLimit;
// Capture the stack trace above function b
Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace
throw error;
}
a();Parameters
| Parameter | Type |
|---|---|
targetObject | object |
constructorOpt? | Function |
Returns
void
Inherited from
WorkerError.captureStackTraceprepareStackTrace()
static prepareStackTrace(err, stackTraces): any;Defined in: node_modules/.pnpm/@types+node@24.12.2/node_modules/@types/node/globals.d.ts:56
Parameters
| Parameter | Type |
|---|---|
err | Error |
stackTraces | CallSite[] |
Returns
any
See
https://v8.dev/docs/stack-trace-api#customizing-stack-traces
Inherited from
WorkerError.prepareStackTraceWorkflowScopeError
Defined in: packages/worker/src/errors.ts:262
Error surfaced in the err(...) branch of a ResultAsync when the function passed to cancellableScope / nonCancellableScope throws a non-cancellation error.
The original error is preserved on cause so call sites can introspect it without losing identity:
Example
const result = await context.cancellableScope(async () => {
return await context.activities.processStep(args);
});
if (result.isErr()) {
if (result.error instanceof WorkflowCancelledError) {
// graceful cancellation
} else if (result.error instanceof WorkflowScopeError) {
// domain error — `result.error.cause` is the original throwable
}
}Introduced so the scope helpers route every failure through neverthrow's railway. Previously, non-cancellation errors were re-thrown out of the helper, which became a ResultAsync rejection (new ResultAsync(promise) does not catch) — they leaked as unhandled rejections rather than surfacing on the typed error channel callers actually inspect.
Extends
WorkerError
Constructors
Constructor
new WorkflowScopeError(cause): WorkflowScopeError;Defined in: packages/worker/src/errors.ts:263
Parameters
| Parameter | Type |
|---|---|
cause | unknown |
Returns
Overrides
WorkerError.constructorProperties
Methods
captureStackTrace()
static captureStackTrace(targetObject, constructorOpt?): void;Defined in: node_modules/.pnpm/@types+node@24.12.2/node_modules/@types/node/globals.d.ts:52
Creates a .stack property on targetObject, which when accessed returns a string representing the location in the code at which Error.captureStackTrace() was called.
const myObject = {};
Error.captureStackTrace(myObject);
myObject.stack; // Similar to `new Error().stack`The first line of the trace will be prefixed with ${myObject.name}: ${myObject.message}.
The optional constructorOpt argument accepts a function. If given, all frames above constructorOpt, including constructorOpt, will be omitted from the generated stack trace.
The constructorOpt argument is useful for hiding implementation details of error generation from the user. For instance:
function a() {
b();
}
function b() {
c();
}
function c() {
// Create an error without stack trace to avoid calculating the stack trace twice.
const { stackTraceLimit } = Error;
Error.stackTraceLimit = 0;
const error = new Error();
Error.stackTraceLimit = stackTraceLimit;
// Capture the stack trace above function b
Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace
throw error;
}
a();Parameters
| Parameter | Type |
|---|---|
targetObject | object |
constructorOpt? | Function |
Returns
void
Inherited from
WorkerError.captureStackTraceprepareStackTrace()
static prepareStackTrace(err, stackTraces): any;Defined in: node_modules/.pnpm/@types+node@24.12.2/node_modules/@types/node/globals.d.ts:56
Parameters
| Parameter | Type |
|---|---|
err | Error |
stackTraces | CallSite[] |
Returns
any
See
https://v8.dev/docs/stack-trace-api#customizing-stack-traces
Inherited from
WorkerError.prepareStackTraceFunctions
declareWorkflow()
function declareWorkflow<TContract, TWorkflowName>(__namedParameters): (...args) => Promise<WorkerInferOutput<TContract["workflows"][TWorkflowName]>>;Defined in: packages/worker/src/workflow.ts:151
Create a typed workflow implementation with automatic validation
This wraps a workflow implementation with:
- Input/output validation
- Typed workflow context with activities
- Workflow info access
Workflows must be defined in separate files and imported by the Temporal Worker via workflowsPath.
Type Parameters
| Type Parameter |
|---|
TContract extends ContractDefinition |
TWorkflowName extends string |
Parameters
| Parameter | Type |
|---|---|
__namedParameters | DeclareWorkflowOptions<TContract, TWorkflowName> |
Returns
(...args) => Promise<WorkerInferOutput<TContract["workflows"][TWorkflowName]>>
Example
// workflows/processOrder.ts
import { declareWorkflow } from '@temporal-contract/worker/workflow';
import myContract from '../contract';
export const processOrder = declareWorkflow({
workflowName: 'processOrder',
contract: myContract,
activityOptions: {
startToCloseTimeout: '1 minute',
},
// Optional: override `activityOptions` for specific activities. Each
// entry shallow-merges over the workflow default — the override wins on
// every property it specifies, including the whole `retry` block.
activityOptionsByName: {
chargePayment: {
startToCloseTimeout: '5 minutes',
retry: { maximumAttempts: 5 },
},
},
implementation: async (context, args) => {
// context.activities: typed activities (workflow + global)
// context.info: WorkflowInfo
const inventory = await context.activities.validateInventory({
orderId: args.orderId,
});
if (!inventory.available) {
return { orderId: args.orderId, status: 'out_of_stock' };
}
const payment = await context.activities.chargePayment({
customerId: args.customerId,
amount: 100,
});
return {
orderId: args.orderId,
status: payment.success ? 'success' : 'failed',
transactionId: payment.transactionId,
};
},
});Then in your worker setup:
// worker.ts
import { createWorker } from '@temporal-contract/worker/worker';
import { activities } from './activities';
import myContract from './contract';
const worker = await createWorker({
contract: myContract,
connection,
workflowsPath: workflowsPathFromURL(import.meta.url, './workflows.js'),
activities,
});References
ActivityInputValidationError
Re-exports ActivityInputValidationError
ActivityOutputValidationError
Re-exports ActivityOutputValidationError