@temporal-contract/worker / workflow
workflow
Classes
ChildWorkflowCancelledError
Defined in: packages/worker/src/errors.ts:291
Discriminated variant 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.
A sibling of ChildWorkflowError rather than a subclass: both are distinct TaggedErrors, so call sites discriminate on the _tag (or instanceof ChildWorkflowCancelledError) instead of relying on an instanceof ChildWorkflowError that also matches cancellation. matchTags folds the ChildWorkflowError | ChildWorkflowCancelledError union exhaustively.
Extends
TaggedErrorInstance<"@temporal-contract/ChildWorkflowCancelledError", {cause?:unknown;message:string;workflowName:string; }>
Constructors
Constructor
new ChildWorkflowCancelledError(workflowName, cause?): ChildWorkflowCancelledError;Defined in: packages/worker/src/errors.ts:299
Parameters
| Parameter | Type |
|---|---|
workflowName | string |
cause? | unknown |
Returns
Overrides
TaggedError(
"@temporal-contract/ChildWorkflowCancelledError",
{ name: "ChildWorkflowCancelledError" },
)<{
workflowName: string;
cause?: unknown;
message: string;
}>.constructorProperties
| Property | Modifier | Type | Inherited from | Defined in |
|---|---|---|---|---|
_tag | readonly | "@temporal-contract/ChildWorkflowCancelledError" | TaggedError( "@temporal-contract/ChildWorkflowCancelledError", { name: "ChildWorkflowCancelledError" }, )._tag | node_modules/.pnpm/unthrown@0.2.0/node_modules/unthrown/dist/index.d.mts:638 |
cause? | public | unknown | ActivityDefinitionNotFoundError.cause | node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2022.error.d.ts:24 |
message | public | string | ActivityInputValidationError.message | node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es5.d.ts:1075 |
name | public | string | TaggedError( "@temporal-contract/ChildWorkflowCancelledError", { name: "ChildWorkflowCancelledError" }, ).name | node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es5.d.ts:1074 |
stack? | public | string | TaggedError( "@temporal-contract/ChildWorkflowCancelledError", { name: "ChildWorkflowCancelledError" }, ).stack | node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es5.d.ts:1076 |
workflowName | readonly | string | TaggedError( "@temporal-contract/ChildWorkflowCancelledError", { name: "ChildWorkflowCancelledError" }, ).workflowName | packages/worker/src/errors.ts:295 |
ChildWorkflowError
Defined in: packages/worker/src/errors.ts:265
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
TaggedErrorInstance<"@temporal-contract/ChildWorkflowError", {cause?:unknown;message:string; }>
Constructors
Constructor
new ChildWorkflowError(message, cause?): ChildWorkflowError;Defined in: packages/worker/src/errors.ts:271
Parameters
| Parameter | Type |
|---|---|
message | string |
cause? | unknown |
Returns
Overrides
TaggedError("@temporal-contract/ChildWorkflowError", {
name: "ChildWorkflowError",
})<{
message: string;
cause?: unknown;
}>.constructorProperties
| Property | Modifier | Type | Inherited from | Defined in |
|---|---|---|---|---|
_tag | readonly | "@temporal-contract/ChildWorkflowError" | TaggedError("@temporal-contract/ChildWorkflowError", { name: "ChildWorkflowError", })._tag | node_modules/.pnpm/unthrown@0.2.0/node_modules/unthrown/dist/index.d.mts:638 |
cause? | public | unknown | ActivityDefinitionNotFoundError.cause | node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2022.error.d.ts:24 |
message | public | string | ActivityInputValidationError.message | node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es5.d.ts:1075 |
name | public | string | TaggedError("@temporal-contract/ChildWorkflowError", { name: "ChildWorkflowError", }).name | node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es5.d.ts:1074 |
stack? | public | string | TaggedError("@temporal-contract/ChildWorkflowError", { name: "ChildWorkflowError", }).stack | node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es5.d.ts:1076 |
ChildWorkflowNotFoundError
Defined in: packages/worker/src/errors.ts:238
Error thrown when a child workflow is not found in the contract
Extends
TaggedErrorInstance<"@temporal-contract/ChildWorkflowNotFoundError", {availableWorkflows: readonlystring[];message:string;workflowName:string; }>
Constructors
Constructor
new ChildWorkflowNotFoundError(workflowName, availableWorkflows?): ChildWorkflowNotFoundError;Defined in: packages/worker/src/errors.ts:246
Parameters
| Parameter | Type | Default value |
|---|---|---|
workflowName | string | undefined |
availableWorkflows | readonly string[] | [] |
Returns
Overrides
TaggedError(
"@temporal-contract/ChildWorkflowNotFoundError",
{ name: "ChildWorkflowNotFoundError" },
)<{
workflowName: string;
availableWorkflows: readonly string[];
message: string;
}>.constructorProperties
| Property | Modifier | Type | Inherited from | Defined in |
|---|---|---|---|---|
_tag | readonly | "@temporal-contract/ChildWorkflowNotFoundError" | TaggedError( "@temporal-contract/ChildWorkflowNotFoundError", { name: "ChildWorkflowNotFoundError" }, )._tag | node_modules/.pnpm/unthrown@0.2.0/node_modules/unthrown/dist/index.d.mts:638 |
availableWorkflows | readonly | readonly string[] | TaggedError( "@temporal-contract/ChildWorkflowNotFoundError", { name: "ChildWorkflowNotFoundError" }, ).availableWorkflows | packages/worker/src/errors.ts:243 |
cause? | public | unknown | TaggedError( "@temporal-contract/ChildWorkflowNotFoundError", { name: "ChildWorkflowNotFoundError" }, ).cause | node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2022.error.d.ts:24 |
message | public | string | ActivityInputValidationError.message | node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es5.d.ts:1075 |
name | public | string | TaggedError( "@temporal-contract/ChildWorkflowNotFoundError", { name: "ChildWorkflowNotFoundError" }, ).name | node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es5.d.ts:1074 |
stack? | public | string | TaggedError( "@temporal-contract/ChildWorkflowNotFoundError", { name: "ChildWorkflowNotFoundError" }, ).stack | node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es5.d.ts:1076 |
workflowName | readonly | string | TaggedError( "@temporal-contract/ChildWorkflowNotFoundError", { name: "ChildWorkflowNotFoundError" }, ).workflowName | packages/worker/src/errors.ts:242 |
QueryInputValidationError
Defined in: packages/worker/src/errors.ts:170
Error thrown when query input validation fails
Extends
Constructors
Constructor
new QueryInputValidationError(queryName, issues): QueryInputValidationError;Defined in: packages/worker/src/errors.ts:171
Parameters
| Parameter | Type |
|---|---|
queryName | string |
issues | readonly Issue[] |
Returns
Overrides
ValidationError.constructorProperties
| Property | Modifier | Type | Description | Inherited from | Defined in |
|---|---|---|---|---|---|
category? | readonly | "BENIGN" | null | - | ValidationError.category | node_modules/.pnpm/@temporalio+common@1.18.1/node_modules/@temporalio/common/lib/failure.d.ts:113 |
cause? | readonly | Error | - | ValidationError.cause | node_modules/.pnpm/@temporalio+common@1.18.1/node_modules/@temporalio/common/lib/failure.d.ts:72 |
details? | readonly | unknown[] | null | - | ValidationError.details | node_modules/.pnpm/@temporalio+common@1.18.1/node_modules/@temporalio/common/lib/failure.d.ts:111 |
failure? | public | IFailure | The original failure that constructed this error. Only present if this error was generated from an external operation. | ValidationError.failure | node_modules/.pnpm/@temporalio+common@1.18.1/node_modules/@temporalio/common/lib/failure.d.ts:78 |
issues | readonly | readonly Issue[] | - | ValidationError.issues | packages/worker/src/errors.ts:38 |
message | public | string | - | ValidationError.message | node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es5.d.ts:1075 |
name | public | string | - | ValidationError.name | node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es5.d.ts:1074 |
nextRetryDelay? | readonly | any | - | ValidationError.nextRetryDelay | node_modules/.pnpm/@temporalio+common@1.18.1/node_modules/@temporalio/common/lib/failure.d.ts:112 |
nonRetryable? | readonly | boolean | null | - | ValidationError.nonRetryable | node_modules/.pnpm/@temporalio+common@1.18.1/node_modules/@temporalio/common/lib/failure.d.ts:110 |
queryName | readonly | string | - | - | packages/worker/src/errors.ts:172 |
stack? | public | string | - | ValidationError.stack | node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es5.d.ts:1076 |
type? | readonly | string | null | - | ValidationError.type | node_modules/.pnpm/@temporalio+common@1.18.1/node_modules/@temporalio/common/lib/failure.d.ts:109 |
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. | ValidationError.stackTraceLimit | node_modules/.pnpm/@types+node@24.13.2/node_modules/@types/node/globals.d.ts:68 |
Methods
captureStackTrace()
static captureStackTrace(targetObject, constructorOpt?): void;Defined in: node_modules/.pnpm/@types+node@24.13.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
ValidationError.captureStackTrace
create()
static create(options): ApplicationFailure;Defined in: node_modules/.pnpm/@temporalio+common@1.18.1/node_modules/@temporalio/common/lib/failure.d.ts:130
Create a new ApplicationFailure.
By default, will be retryable (unless its type is included in RetryPolicy.nonRetryableErrorTypes).
Parameters
| Parameter | Type |
|---|---|
options | ApplicationFailureOptions |
Returns
Inherited from
fromError()
static fromError(error, overrides?): ApplicationFailure;Defined in: node_modules/.pnpm/@temporalio+common@1.18.1/node_modules/@temporalio/common/lib/failure.d.ts:124
Create a new ApplicationFailure from an Error object.
First calls ensureApplicationFailure | `ensureApplicationFailure(error)` and then overrides any fields provided in overrides.
Parameters
| Parameter | Type |
|---|---|
error | unknown |
overrides? | ApplicationFailureOptions |
Returns
Inherited from
nonRetryable()
static nonRetryable(
message?,
type?, ...
details): ApplicationFailure;Defined in: node_modules/.pnpm/@temporalio+common@1.18.1/node_modules/@temporalio/common/lib/failure.d.ts:150
Get a new ApplicationFailure with the nonRetryable flag set to true.
When thrown from an Activity or Workflow, the Activity or Workflow will not be retried (even if type is not listed in RetryPolicy.nonRetryableErrorTypes).
Parameters
| Parameter | Type | Description |
|---|---|---|
message? | string | null | Optional error message |
type? | string | null | Optional error type |
...details? | unknown[] | Optional details about the failure. Serialized by the Worker's PayloadConverter. |
Returns
Inherited from
prepareStackTrace()
static prepareStackTrace(err, stackTraces): any;Defined in: node_modules/.pnpm/@types+node@24.13.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
ValidationError.prepareStackTrace
retryable()
static retryable(
message?,
type?, ...
details): ApplicationFailure;Defined in: node_modules/.pnpm/@temporalio+common@1.18.1/node_modules/@temporalio/common/lib/failure.d.ts:139
Get a new ApplicationFailure with the nonRetryable flag set to false. Note that this error will still not be retried if its type is included in RetryPolicy.nonRetryableErrorTypes.
Parameters
| Parameter | Type | Description |
|---|---|---|
message? | string | null | Optional error message |
type? | string | null | Optional error type (used by RetryPolicy.nonRetryableErrorTypes) |
...details? | unknown[] | Optional details about the failure. Serialized by the Worker's PayloadConverter. |
Returns
Inherited from
QueryOutputValidationError
Defined in: packages/worker/src/errors.ts:187
Error thrown when query output validation fails
Extends
Constructors
Constructor
new QueryOutputValidationError(queryName, issues): QueryOutputValidationError;Defined in: packages/worker/src/errors.ts:188
Parameters
| Parameter | Type |
|---|---|
queryName | string |
issues | readonly Issue[] |
Returns
Overrides
ValidationError.constructorProperties
| Property | Modifier | Type | Description | Inherited from | Defined in |
|---|---|---|---|---|---|
category? | readonly | "BENIGN" | null | - | ValidationError.category | node_modules/.pnpm/@temporalio+common@1.18.1/node_modules/@temporalio/common/lib/failure.d.ts:113 |
cause? | readonly | Error | - | ValidationError.cause | node_modules/.pnpm/@temporalio+common@1.18.1/node_modules/@temporalio/common/lib/failure.d.ts:72 |
details? | readonly | unknown[] | null | - | ValidationError.details | node_modules/.pnpm/@temporalio+common@1.18.1/node_modules/@temporalio/common/lib/failure.d.ts:111 |
failure? | public | IFailure | The original failure that constructed this error. Only present if this error was generated from an external operation. | ValidationError.failure | node_modules/.pnpm/@temporalio+common@1.18.1/node_modules/@temporalio/common/lib/failure.d.ts:78 |
issues | readonly | readonly Issue[] | - | ValidationError.issues | packages/worker/src/errors.ts:38 |
message | public | string | - | ValidationError.message | node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es5.d.ts:1075 |
name | public | string | - | ValidationError.name | node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es5.d.ts:1074 |
nextRetryDelay? | readonly | any | - | ValidationError.nextRetryDelay | node_modules/.pnpm/@temporalio+common@1.18.1/node_modules/@temporalio/common/lib/failure.d.ts:112 |
nonRetryable? | readonly | boolean | null | - | ValidationError.nonRetryable | node_modules/.pnpm/@temporalio+common@1.18.1/node_modules/@temporalio/common/lib/failure.d.ts:110 |
queryName | readonly | string | - | - | packages/worker/src/errors.ts:189 |
stack? | public | string | - | ValidationError.stack | node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es5.d.ts:1076 |
type? | readonly | string | null | - | ValidationError.type | node_modules/.pnpm/@temporalio+common@1.18.1/node_modules/@temporalio/common/lib/failure.d.ts:109 |
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. | ValidationError.stackTraceLimit | node_modules/.pnpm/@types+node@24.13.2/node_modules/@types/node/globals.d.ts:68 |
Methods
captureStackTrace()
static captureStackTrace(targetObject, constructorOpt?): void;Defined in: node_modules/.pnpm/@types+node@24.13.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
ValidationError.captureStackTrace
create()
static create(options): ApplicationFailure;Defined in: node_modules/.pnpm/@temporalio+common@1.18.1/node_modules/@temporalio/common/lib/failure.d.ts:130
Create a new ApplicationFailure.
By default, will be retryable (unless its type is included in RetryPolicy.nonRetryableErrorTypes).
Parameters
| Parameter | Type |
|---|---|
options | ApplicationFailureOptions |
Returns
Inherited from
fromError()
static fromError(error, overrides?): ApplicationFailure;Defined in: node_modules/.pnpm/@temporalio+common@1.18.1/node_modules/@temporalio/common/lib/failure.d.ts:124
Create a new ApplicationFailure from an Error object.
First calls ensureApplicationFailure | `ensureApplicationFailure(error)` and then overrides any fields provided in overrides.
Parameters
| Parameter | Type |
|---|---|
error | unknown |
overrides? | ApplicationFailureOptions |
Returns
Inherited from
nonRetryable()
static nonRetryable(
message?,
type?, ...
details): ApplicationFailure;Defined in: node_modules/.pnpm/@temporalio+common@1.18.1/node_modules/@temporalio/common/lib/failure.d.ts:150
Get a new ApplicationFailure with the nonRetryable flag set to true.
When thrown from an Activity or Workflow, the Activity or Workflow will not be retried (even if type is not listed in RetryPolicy.nonRetryableErrorTypes).
Parameters
| Parameter | Type | Description |
|---|---|---|
message? | string | null | Optional error message |
type? | string | null | Optional error type |
...details? | unknown[] | Optional details about the failure. Serialized by the Worker's PayloadConverter. |
Returns
Inherited from
prepareStackTrace()
static prepareStackTrace(err, stackTraces): any;Defined in: node_modules/.pnpm/@types+node@24.13.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
ValidationError.prepareStackTrace
retryable()
static retryable(
message?,
type?, ...
details): ApplicationFailure;Defined in: node_modules/.pnpm/@temporalio+common@1.18.1/node_modules/@temporalio/common/lib/failure.d.ts:139
Get a new ApplicationFailure with the nonRetryable flag set to false. Note that this error will still not be retried if its type is included in RetryPolicy.nonRetryableErrorTypes.
Parameters
| Parameter | Type | Description |
|---|---|---|
message? | string | null | Optional error message |
type? | string | null | Optional error type (used by RetryPolicy.nonRetryableErrorTypes) |
...details? | unknown[] | Optional details about the failure. Serialized by the Worker's PayloadConverter. |
Returns
Inherited from
SignalInputValidationError
Defined in: packages/worker/src/errors.ts:153
Error thrown when signal input validation fails
Extends
Constructors
Constructor
new SignalInputValidationError(signalName, issues): SignalInputValidationError;Defined in: packages/worker/src/errors.ts:154
Parameters
| Parameter | Type |
|---|---|
signalName | string |
issues | readonly Issue[] |
Returns
Overrides
ValidationError.constructorProperties
| Property | Modifier | Type | Description | Inherited from | Defined in |
|---|---|---|---|---|---|
category? | readonly | "BENIGN" | null | - | ValidationError.category | node_modules/.pnpm/@temporalio+common@1.18.1/node_modules/@temporalio/common/lib/failure.d.ts:113 |
cause? | readonly | Error | - | ValidationError.cause | node_modules/.pnpm/@temporalio+common@1.18.1/node_modules/@temporalio/common/lib/failure.d.ts:72 |
details? | readonly | unknown[] | null | - | ValidationError.details | node_modules/.pnpm/@temporalio+common@1.18.1/node_modules/@temporalio/common/lib/failure.d.ts:111 |
failure? | public | IFailure | The original failure that constructed this error. Only present if this error was generated from an external operation. | ValidationError.failure | node_modules/.pnpm/@temporalio+common@1.18.1/node_modules/@temporalio/common/lib/failure.d.ts:78 |
issues | readonly | readonly Issue[] | - | ValidationError.issues | packages/worker/src/errors.ts:38 |
message | public | string | - | ValidationError.message | node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es5.d.ts:1075 |
name | public | string | - | ValidationError.name | node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es5.d.ts:1074 |
nextRetryDelay? | readonly | any | - | ValidationError.nextRetryDelay | node_modules/.pnpm/@temporalio+common@1.18.1/node_modules/@temporalio/common/lib/failure.d.ts:112 |
nonRetryable? | readonly | boolean | null | - | ValidationError.nonRetryable | node_modules/.pnpm/@temporalio+common@1.18.1/node_modules/@temporalio/common/lib/failure.d.ts:110 |
signalName | readonly | string | - | - | packages/worker/src/errors.ts:155 |
stack? | public | string | - | ValidationError.stack | node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es5.d.ts:1076 |
type? | readonly | string | null | - | ValidationError.type | node_modules/.pnpm/@temporalio+common@1.18.1/node_modules/@temporalio/common/lib/failure.d.ts:109 |
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. | ValidationError.stackTraceLimit | node_modules/.pnpm/@types+node@24.13.2/node_modules/@types/node/globals.d.ts:68 |
Methods
captureStackTrace()
static captureStackTrace(targetObject, constructorOpt?): void;Defined in: node_modules/.pnpm/@types+node@24.13.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
ValidationError.captureStackTrace
create()
static create(options): ApplicationFailure;Defined in: node_modules/.pnpm/@temporalio+common@1.18.1/node_modules/@temporalio/common/lib/failure.d.ts:130
Create a new ApplicationFailure.
By default, will be retryable (unless its type is included in RetryPolicy.nonRetryableErrorTypes).
Parameters
| Parameter | Type |
|---|---|
options | ApplicationFailureOptions |
Returns
Inherited from
fromError()
static fromError(error, overrides?): ApplicationFailure;Defined in: node_modules/.pnpm/@temporalio+common@1.18.1/node_modules/@temporalio/common/lib/failure.d.ts:124
Create a new ApplicationFailure from an Error object.
First calls ensureApplicationFailure | `ensureApplicationFailure(error)` and then overrides any fields provided in overrides.
Parameters
| Parameter | Type |
|---|---|
error | unknown |
overrides? | ApplicationFailureOptions |
Returns
Inherited from
nonRetryable()
static nonRetryable(
message?,
type?, ...
details): ApplicationFailure;Defined in: node_modules/.pnpm/@temporalio+common@1.18.1/node_modules/@temporalio/common/lib/failure.d.ts:150
Get a new ApplicationFailure with the nonRetryable flag set to true.
When thrown from an Activity or Workflow, the Activity or Workflow will not be retried (even if type is not listed in RetryPolicy.nonRetryableErrorTypes).
Parameters
| Parameter | Type | Description |
|---|---|---|
message? | string | null | Optional error message |
type? | string | null | Optional error type |
...details? | unknown[] | Optional details about the failure. Serialized by the Worker's PayloadConverter. |
Returns
Inherited from
prepareStackTrace()
static prepareStackTrace(err, stackTraces): any;Defined in: node_modules/.pnpm/@types+node@24.13.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
ValidationError.prepareStackTrace
retryable()
static retryable(
message?,
type?, ...
details): ApplicationFailure;Defined in: node_modules/.pnpm/@temporalio+common@1.18.1/node_modules/@temporalio/common/lib/failure.d.ts:139
Get a new ApplicationFailure with the nonRetryable flag set to false. Note that this error will still not be retried if its type is included in RetryPolicy.nonRetryableErrorTypes.
Parameters
| Parameter | Type | Description |
|---|---|---|
message? | string | null | Optional error message |
type? | string | null | Optional error type (used by RetryPolicy.nonRetryableErrorTypes) |
...details? | unknown[] | Optional details about the failure. Serialized by the Worker's PayloadConverter. |
Returns
Inherited from
UpdateInputValidationError
Defined in: packages/worker/src/errors.ts:204
Error thrown when update input validation fails
Extends
Constructors
Constructor
new UpdateInputValidationError(updateName, issues): UpdateInputValidationError;Defined in: packages/worker/src/errors.ts:205
Parameters
| Parameter | Type |
|---|---|
updateName | string |
issues | readonly Issue[] |
Returns
Overrides
ValidationError.constructorProperties
| Property | Modifier | Type | Description | Inherited from | Defined in |
|---|---|---|---|---|---|
category? | readonly | "BENIGN" | null | - | ValidationError.category | node_modules/.pnpm/@temporalio+common@1.18.1/node_modules/@temporalio/common/lib/failure.d.ts:113 |
cause? | readonly | Error | - | ValidationError.cause | node_modules/.pnpm/@temporalio+common@1.18.1/node_modules/@temporalio/common/lib/failure.d.ts:72 |
details? | readonly | unknown[] | null | - | ValidationError.details | node_modules/.pnpm/@temporalio+common@1.18.1/node_modules/@temporalio/common/lib/failure.d.ts:111 |
failure? | public | IFailure | The original failure that constructed this error. Only present if this error was generated from an external operation. | ValidationError.failure | node_modules/.pnpm/@temporalio+common@1.18.1/node_modules/@temporalio/common/lib/failure.d.ts:78 |
issues | readonly | readonly Issue[] | - | ValidationError.issues | packages/worker/src/errors.ts:38 |
message | public | string | - | ValidationError.message | node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es5.d.ts:1075 |
name | public | string | - | ValidationError.name | node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es5.d.ts:1074 |
nextRetryDelay? | readonly | any | - | ValidationError.nextRetryDelay | node_modules/.pnpm/@temporalio+common@1.18.1/node_modules/@temporalio/common/lib/failure.d.ts:112 |
nonRetryable? | readonly | boolean | null | - | ValidationError.nonRetryable | node_modules/.pnpm/@temporalio+common@1.18.1/node_modules/@temporalio/common/lib/failure.d.ts:110 |
stack? | public | string | - | ValidationError.stack | node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es5.d.ts:1076 |
type? | readonly | string | null | - | ValidationError.type | node_modules/.pnpm/@temporalio+common@1.18.1/node_modules/@temporalio/common/lib/failure.d.ts:109 |
updateName | 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. | ValidationError.stackTraceLimit | node_modules/.pnpm/@types+node@24.13.2/node_modules/@types/node/globals.d.ts:68 |
Methods
captureStackTrace()
static captureStackTrace(targetObject, constructorOpt?): void;Defined in: node_modules/.pnpm/@types+node@24.13.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
ValidationError.captureStackTrace
create()
static create(options): ApplicationFailure;Defined in: node_modules/.pnpm/@temporalio+common@1.18.1/node_modules/@temporalio/common/lib/failure.d.ts:130
Create a new ApplicationFailure.
By default, will be retryable (unless its type is included in RetryPolicy.nonRetryableErrorTypes).
Parameters
| Parameter | Type |
|---|---|
options | ApplicationFailureOptions |
Returns
Inherited from
fromError()
static fromError(error, overrides?): ApplicationFailure;Defined in: node_modules/.pnpm/@temporalio+common@1.18.1/node_modules/@temporalio/common/lib/failure.d.ts:124
Create a new ApplicationFailure from an Error object.
First calls ensureApplicationFailure | `ensureApplicationFailure(error)` and then overrides any fields provided in overrides.
Parameters
| Parameter | Type |
|---|---|
error | unknown |
overrides? | ApplicationFailureOptions |
Returns
Inherited from
nonRetryable()
static nonRetryable(
message?,
type?, ...
details): ApplicationFailure;Defined in: node_modules/.pnpm/@temporalio+common@1.18.1/node_modules/@temporalio/common/lib/failure.d.ts:150
Get a new ApplicationFailure with the nonRetryable flag set to true.
When thrown from an Activity or Workflow, the Activity or Workflow will not be retried (even if type is not listed in RetryPolicy.nonRetryableErrorTypes).
Parameters
| Parameter | Type | Description |
|---|---|---|
message? | string | null | Optional error message |
type? | string | null | Optional error type |
...details? | unknown[] | Optional details about the failure. Serialized by the Worker's PayloadConverter. |
Returns
Inherited from
prepareStackTrace()
static prepareStackTrace(err, stackTraces): any;Defined in: node_modules/.pnpm/@types+node@24.13.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
ValidationError.prepareStackTrace
retryable()
static retryable(
message?,
type?, ...
details): ApplicationFailure;Defined in: node_modules/.pnpm/@temporalio+common@1.18.1/node_modules/@temporalio/common/lib/failure.d.ts:139
Get a new ApplicationFailure with the nonRetryable flag set to false. Note that this error will still not be retried if its type is included in RetryPolicy.nonRetryableErrorTypes.
Parameters
| Parameter | Type | Description |
|---|---|---|
message? | string | null | Optional error message |
type? | string | null | Optional error type (used by RetryPolicy.nonRetryableErrorTypes) |
...details? | unknown[] | Optional details about the failure. Serialized by the Worker's PayloadConverter. |
Returns
Inherited from
UpdateOutputValidationError
Defined in: packages/worker/src/errors.ts:221
Error thrown when update output validation fails
Extends
Constructors
Constructor
new UpdateOutputValidationError(updateName, issues): UpdateOutputValidationError;Defined in: packages/worker/src/errors.ts:222
Parameters
| Parameter | Type |
|---|---|
updateName | string |
issues | readonly Issue[] |
Returns
Overrides
ValidationError.constructorProperties
| Property | Modifier | Type | Description | Inherited from | Defined in |
|---|---|---|---|---|---|
category? | readonly | "BENIGN" | null | - | ValidationError.category | node_modules/.pnpm/@temporalio+common@1.18.1/node_modules/@temporalio/common/lib/failure.d.ts:113 |
cause? | readonly | Error | - | ValidationError.cause | node_modules/.pnpm/@temporalio+common@1.18.1/node_modules/@temporalio/common/lib/failure.d.ts:72 |
details? | readonly | unknown[] | null | - | ValidationError.details | node_modules/.pnpm/@temporalio+common@1.18.1/node_modules/@temporalio/common/lib/failure.d.ts:111 |
failure? | public | IFailure | The original failure that constructed this error. Only present if this error was generated from an external operation. | ValidationError.failure | node_modules/.pnpm/@temporalio+common@1.18.1/node_modules/@temporalio/common/lib/failure.d.ts:78 |
issues | readonly | readonly Issue[] | - | ValidationError.issues | packages/worker/src/errors.ts:38 |
message | public | string | - | ValidationError.message | node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es5.d.ts:1075 |
name | public | string | - | ValidationError.name | node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es5.d.ts:1074 |
nextRetryDelay? | readonly | any | - | ValidationError.nextRetryDelay | node_modules/.pnpm/@temporalio+common@1.18.1/node_modules/@temporalio/common/lib/failure.d.ts:112 |
nonRetryable? | readonly | boolean | null | - | ValidationError.nonRetryable | node_modules/.pnpm/@temporalio+common@1.18.1/node_modules/@temporalio/common/lib/failure.d.ts:110 |
stack? | public | string | - | ValidationError.stack | node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es5.d.ts:1076 |
type? | readonly | string | null | - | ValidationError.type | node_modules/.pnpm/@temporalio+common@1.18.1/node_modules/@temporalio/common/lib/failure.d.ts:109 |
updateName | readonly | string | - | - | packages/worker/src/errors.ts:223 |
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. | ValidationError.stackTraceLimit | node_modules/.pnpm/@types+node@24.13.2/node_modules/@types/node/globals.d.ts:68 |
Methods
captureStackTrace()
static captureStackTrace(targetObject, constructorOpt?): void;Defined in: node_modules/.pnpm/@types+node@24.13.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
ValidationError.captureStackTrace
create()
static create(options): ApplicationFailure;Defined in: node_modules/.pnpm/@temporalio+common@1.18.1/node_modules/@temporalio/common/lib/failure.d.ts:130
Create a new ApplicationFailure.
By default, will be retryable (unless its type is included in RetryPolicy.nonRetryableErrorTypes).
Parameters
| Parameter | Type |
|---|---|
options | ApplicationFailureOptions |
Returns
Inherited from
fromError()
static fromError(error, overrides?): ApplicationFailure;Defined in: node_modules/.pnpm/@temporalio+common@1.18.1/node_modules/@temporalio/common/lib/failure.d.ts:124
Create a new ApplicationFailure from an Error object.
First calls ensureApplicationFailure | `ensureApplicationFailure(error)` and then overrides any fields provided in overrides.
Parameters
| Parameter | Type |
|---|---|
error | unknown |
overrides? | ApplicationFailureOptions |
Returns
Inherited from
nonRetryable()
static nonRetryable(
message?,
type?, ...
details): ApplicationFailure;Defined in: node_modules/.pnpm/@temporalio+common@1.18.1/node_modules/@temporalio/common/lib/failure.d.ts:150
Get a new ApplicationFailure with the nonRetryable flag set to true.
When thrown from an Activity or Workflow, the Activity or Workflow will not be retried (even if type is not listed in RetryPolicy.nonRetryableErrorTypes).
Parameters
| Parameter | Type | Description |
|---|---|---|
message? | string | null | Optional error message |
type? | string | null | Optional error type |
...details? | unknown[] | Optional details about the failure. Serialized by the Worker's PayloadConverter. |
Returns
Inherited from
prepareStackTrace()
static prepareStackTrace(err, stackTraces): any;Defined in: node_modules/.pnpm/@types+node@24.13.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
ValidationError.prepareStackTrace
retryable()
static retryable(
message?,
type?, ...
details): ApplicationFailure;Defined in: node_modules/.pnpm/@temporalio+common@1.18.1/node_modules/@temporalio/common/lib/failure.d.ts:139
Get a new ApplicationFailure with the nonRetryable flag set to false. Note that this error will still not be retried if its type is included in RetryPolicy.nonRetryableErrorTypes.
Parameters
| Parameter | Type | Description |
|---|---|---|
message? | string | null | Optional error message |
type? | string | null | Optional error type (used by RetryPolicy.nonRetryableErrorTypes) |
...details? | unknown[] | Optional details about the failure. Serialized by the Worker's PayloadConverter. |
Returns
Inherited from
WorkflowCancelledError
Defined in: packages/worker/src/errors.ts:316
Error surfaced in the err(...) branch of an AsyncResult 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 are unmodeled failures: they surface on the scope's defect channel (re-thrown at the edge / inspectable via result.isDefect() and result.cause), not as a typed err(...).
Extends
TaggedErrorInstance<"@temporal-contract/WorkflowCancelledError", {cause?:unknown;message:string; }>
Constructors
Constructor
new WorkflowCancelledError(cause?): WorkflowCancelledError;Defined in: packages/worker/src/errors.ts:323
Parameters
| Parameter | Type |
|---|---|
cause? | unknown |
Returns
Overrides
TaggedError(
"@temporal-contract/WorkflowCancelledError",
{ name: "WorkflowCancelledError" },
)<{
cause?: unknown;
message: string;
}>.constructorProperties
| Property | Modifier | Type | Inherited from | Defined in |
|---|---|---|---|---|
_tag | readonly | "@temporal-contract/WorkflowCancelledError" | TaggedError( "@temporal-contract/WorkflowCancelledError", { name: "WorkflowCancelledError" }, )._tag | node_modules/.pnpm/unthrown@0.2.0/node_modules/unthrown/dist/index.d.mts:638 |
cause? | public | unknown | ActivityDefinitionNotFoundError.cause | node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2022.error.d.ts:24 |
message | public | string | ActivityInputValidationError.message | node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es5.d.ts:1075 |
name | public | string | TaggedError( "@temporal-contract/WorkflowCancelledError", { name: "WorkflowCancelledError" }, ).name | node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es5.d.ts:1074 |
stack? | public | string | TaggedError( "@temporal-contract/WorkflowCancelledError", { name: "WorkflowCancelledError" }, ).stack | node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es5.d.ts:1076 |
WorkflowInputValidationError
Defined in: packages/worker/src/errors.ts:119
Error thrown when workflow input validation fails
Extends
Constructors
Constructor
new WorkflowInputValidationError(workflowName, issues): WorkflowInputValidationError;Defined in: packages/worker/src/errors.ts:120
Parameters
| Parameter | Type |
|---|---|
workflowName | string |
issues | readonly Issue[] |
Returns
Overrides
ValidationError.constructorProperties
| Property | Modifier | Type | Description | Inherited from | Defined in |
|---|---|---|---|---|---|
category? | readonly | "BENIGN" | null | - | ValidationError.category | node_modules/.pnpm/@temporalio+common@1.18.1/node_modules/@temporalio/common/lib/failure.d.ts:113 |
cause? | readonly | Error | - | ValidationError.cause | node_modules/.pnpm/@temporalio+common@1.18.1/node_modules/@temporalio/common/lib/failure.d.ts:72 |
details? | readonly | unknown[] | null | - | ValidationError.details | node_modules/.pnpm/@temporalio+common@1.18.1/node_modules/@temporalio/common/lib/failure.d.ts:111 |
failure? | public | IFailure | The original failure that constructed this error. Only present if this error was generated from an external operation. | ValidationError.failure | node_modules/.pnpm/@temporalio+common@1.18.1/node_modules/@temporalio/common/lib/failure.d.ts:78 |
issues | readonly | readonly Issue[] | - | ValidationError.issues | packages/worker/src/errors.ts:38 |
message | public | string | - | ValidationError.message | node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es5.d.ts:1075 |
name | public | string | - | ValidationError.name | node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es5.d.ts:1074 |
nextRetryDelay? | readonly | any | - | ValidationError.nextRetryDelay | node_modules/.pnpm/@temporalio+common@1.18.1/node_modules/@temporalio/common/lib/failure.d.ts:112 |
nonRetryable? | readonly | boolean | null | - | ValidationError.nonRetryable | node_modules/.pnpm/@temporalio+common@1.18.1/node_modules/@temporalio/common/lib/failure.d.ts:110 |
stack? | public | string | - | ValidationError.stack | node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es5.d.ts:1076 |
type? | readonly | string | null | - | ValidationError.type | node_modules/.pnpm/@temporalio+common@1.18.1/node_modules/@temporalio/common/lib/failure.d.ts:109 |
workflowName | readonly | string | - | - | packages/worker/src/errors.ts:121 |
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. | ValidationError.stackTraceLimit | node_modules/.pnpm/@types+node@24.13.2/node_modules/@types/node/globals.d.ts:68 |
Methods
captureStackTrace()
static captureStackTrace(targetObject, constructorOpt?): void;Defined in: node_modules/.pnpm/@types+node@24.13.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
ValidationError.captureStackTrace
create()
static create(options): ApplicationFailure;Defined in: node_modules/.pnpm/@temporalio+common@1.18.1/node_modules/@temporalio/common/lib/failure.d.ts:130
Create a new ApplicationFailure.
By default, will be retryable (unless its type is included in RetryPolicy.nonRetryableErrorTypes).
Parameters
| Parameter | Type |
|---|---|
options | ApplicationFailureOptions |
Returns
Inherited from
fromError()
static fromError(error, overrides?): ApplicationFailure;Defined in: node_modules/.pnpm/@temporalio+common@1.18.1/node_modules/@temporalio/common/lib/failure.d.ts:124
Create a new ApplicationFailure from an Error object.
First calls ensureApplicationFailure | `ensureApplicationFailure(error)` and then overrides any fields provided in overrides.
Parameters
| Parameter | Type |
|---|---|
error | unknown |
overrides? | ApplicationFailureOptions |
Returns
Inherited from
nonRetryable()
static nonRetryable(
message?,
type?, ...
details): ApplicationFailure;Defined in: node_modules/.pnpm/@temporalio+common@1.18.1/node_modules/@temporalio/common/lib/failure.d.ts:150
Get a new ApplicationFailure with the nonRetryable flag set to true.
When thrown from an Activity or Workflow, the Activity or Workflow will not be retried (even if type is not listed in RetryPolicy.nonRetryableErrorTypes).
Parameters
| Parameter | Type | Description |
|---|---|---|
message? | string | null | Optional error message |
type? | string | null | Optional error type |
...details? | unknown[] | Optional details about the failure. Serialized by the Worker's PayloadConverter. |
Returns
Inherited from
prepareStackTrace()
static prepareStackTrace(err, stackTraces): any;Defined in: node_modules/.pnpm/@types+node@24.13.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
ValidationError.prepareStackTrace
retryable()
static retryable(
message?,
type?, ...
details): ApplicationFailure;Defined in: node_modules/.pnpm/@temporalio+common@1.18.1/node_modules/@temporalio/common/lib/failure.d.ts:139
Get a new ApplicationFailure with the nonRetryable flag set to false. Note that this error will still not be retried if its type is included in RetryPolicy.nonRetryableErrorTypes.
Parameters
| Parameter | Type | Description |
|---|---|---|
message? | string | null | Optional error message |
type? | string | null | Optional error type (used by RetryPolicy.nonRetryableErrorTypes) |
...details? | unknown[] | Optional details about the failure. Serialized by the Worker's PayloadConverter. |
Returns
Inherited from
WorkflowOutputValidationError
Defined in: packages/worker/src/errors.ts:136
Error thrown when workflow output validation fails
Extends
Constructors
Constructor
new WorkflowOutputValidationError(workflowName, issues): WorkflowOutputValidationError;Defined in: packages/worker/src/errors.ts:137
Parameters
| Parameter | Type |
|---|---|
workflowName | string |
issues | readonly Issue[] |
Returns
Overrides
ValidationError.constructorProperties
| Property | Modifier | Type | Description | Inherited from | Defined in |
|---|---|---|---|---|---|
category? | readonly | "BENIGN" | null | - | ValidationError.category | node_modules/.pnpm/@temporalio+common@1.18.1/node_modules/@temporalio/common/lib/failure.d.ts:113 |
cause? | readonly | Error | - | ValidationError.cause | node_modules/.pnpm/@temporalio+common@1.18.1/node_modules/@temporalio/common/lib/failure.d.ts:72 |
details? | readonly | unknown[] | null | - | ValidationError.details | node_modules/.pnpm/@temporalio+common@1.18.1/node_modules/@temporalio/common/lib/failure.d.ts:111 |
failure? | public | IFailure | The original failure that constructed this error. Only present if this error was generated from an external operation. | ValidationError.failure | node_modules/.pnpm/@temporalio+common@1.18.1/node_modules/@temporalio/common/lib/failure.d.ts:78 |
issues | readonly | readonly Issue[] | - | ValidationError.issues | packages/worker/src/errors.ts:38 |
message | public | string | - | ValidationError.message | node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es5.d.ts:1075 |
name | public | string | - | ValidationError.name | node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es5.d.ts:1074 |
nextRetryDelay? | readonly | any | - | ValidationError.nextRetryDelay | node_modules/.pnpm/@temporalio+common@1.18.1/node_modules/@temporalio/common/lib/failure.d.ts:112 |
nonRetryable? | readonly | boolean | null | - | ValidationError.nonRetryable | node_modules/.pnpm/@temporalio+common@1.18.1/node_modules/@temporalio/common/lib/failure.d.ts:110 |
stack? | public | string | - | ValidationError.stack | node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es5.d.ts:1076 |
type? | readonly | string | null | - | ValidationError.type | node_modules/.pnpm/@temporalio+common@1.18.1/node_modules/@temporalio/common/lib/failure.d.ts:109 |
workflowName | readonly | string | - | - | packages/worker/src/errors.ts:138 |
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. | ValidationError.stackTraceLimit | node_modules/.pnpm/@types+node@24.13.2/node_modules/@types/node/globals.d.ts:68 |
Methods
captureStackTrace()
static captureStackTrace(targetObject, constructorOpt?): void;Defined in: node_modules/.pnpm/@types+node@24.13.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
ValidationError.captureStackTrace
create()
static create(options): ApplicationFailure;Defined in: node_modules/.pnpm/@temporalio+common@1.18.1/node_modules/@temporalio/common/lib/failure.d.ts:130
Create a new ApplicationFailure.
By default, will be retryable (unless its type is included in RetryPolicy.nonRetryableErrorTypes).
Parameters
| Parameter | Type |
|---|---|
options | ApplicationFailureOptions |
Returns
Inherited from
fromError()
static fromError(error, overrides?): ApplicationFailure;Defined in: node_modules/.pnpm/@temporalio+common@1.18.1/node_modules/@temporalio/common/lib/failure.d.ts:124
Create a new ApplicationFailure from an Error object.
First calls ensureApplicationFailure | `ensureApplicationFailure(error)` and then overrides any fields provided in overrides.
Parameters
| Parameter | Type |
|---|---|
error | unknown |
overrides? | ApplicationFailureOptions |
Returns
Inherited from
nonRetryable()
static nonRetryable(
message?,
type?, ...
details): ApplicationFailure;Defined in: node_modules/.pnpm/@temporalio+common@1.18.1/node_modules/@temporalio/common/lib/failure.d.ts:150
Get a new ApplicationFailure with the nonRetryable flag set to true.
When thrown from an Activity or Workflow, the Activity or Workflow will not be retried (even if type is not listed in RetryPolicy.nonRetryableErrorTypes).
Parameters
| Parameter | Type | Description |
|---|---|---|
message? | string | null | Optional error message |
type? | string | null | Optional error type |
...details? | unknown[] | Optional details about the failure. Serialized by the Worker's PayloadConverter. |
Returns
Inherited from
prepareStackTrace()
static prepareStackTrace(err, stackTraces): any;Defined in: node_modules/.pnpm/@types+node@24.13.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
ValidationError.prepareStackTrace
retryable()
static retryable(
message?,
type?, ...
details): ApplicationFailure;Defined in: node_modules/.pnpm/@temporalio+common@1.18.1/node_modules/@temporalio/common/lib/failure.d.ts:139
Get a new ApplicationFailure with the nonRetryable flag set to false. Note that this error will still not be retried if its type is included in RetryPolicy.nonRetryableErrorTypes.
Parameters
| Parameter | Type | Description |
|---|---|---|
message? | string | null | Optional error message |
type? | string | null | Optional error type (used by RetryPolicy.nonRetryableErrorTypes) |
...details? | unknown[] | Optional details about the failure. Serialized by the Worker's PayloadConverter. |
Returns
Inherited from
Functions
declareWorkflow()
function declareWorkflow<TContract, TWorkflowName>(__namedParameters): (...args) => Promise<WorkerInferOutput<TContract["workflows"][TWorkflowName]>>;Defined in: packages/worker/src/workflow.ts:154
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. The
// override is Temporal's full `ActivityOptions`, so `taskQueue` works too,
// letting you route individual activities to a dedicated worker pool.
activityOptionsByName: {
chargePayment: {
startToCloseTimeout: '5 minutes',
retry: { maximumAttempts: 5 },
},
// Route this activity to a dedicated, concurrency-capped queue.
scoreRisk: { taskQueue: 'ml-inference' },
},
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
ValidationError
Re-exports ValidationError