@temporal-contract/worker / workflow
workflow
Classes
ActivityCancelledError
Defined in: packages/worker/src/errors.ts:287
Discriminated variant surfaced when a call to an errors-declaring activity was cancelled (the workflow itself, or an enclosing cancellation scope). Detected via @temporalio/workflow's isCancellation(...).
A sibling of ActivityError rather than a subclass, for the same reason ChildWorkflowCancelledError is a sibling of ChildWorkflowError: call sites discriminate on the _tag.
Extends
TaggedErrorInstance<"@temporal-contract/ActivityCancelledError", {activityName:string;cause?:unknown; }>
Constructors
Constructor
new ActivityCancelledError(activityName, cause?): ActivityCancelledError;Defined in: packages/worker/src/errors.ts:294
Parameters
| Parameter | Type |
|---|---|
activityName | string |
cause? | unknown |
Returns
Overrides
TaggedError(
"@temporal-contract/ActivityCancelledError",
{ name: "ActivityCancelledError" },
)<{
activityName: string;
cause?: unknown;
}>.constructorProperties
| Property | Modifier | Type | Inherited from | Defined in |
|---|---|---|---|---|
_tag | readonly | "@temporal-contract/ActivityCancelledError" | TaggedError( "@temporal-contract/ActivityCancelledError", { name: "ActivityCancelledError" }, )._tag | node_modules/.pnpm/unthrown@4.1.0/node_modules/unthrown/dist/index.d.mts:1456 |
activityName | readonly | string | TaggedError( "@temporal-contract/ActivityCancelledError", { name: "ActivityCancelledError" }, ).activityName | packages/worker/src/errors.ts:291 |
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 | TaggedError( "@temporal-contract/ActivityCancelledError", { name: "ActivityCancelledError" }, ).message | node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es5.d.ts:1075 |
name | public | string | TaggedError( "@temporal-contract/ActivityCancelledError", { name: "ActivityCancelledError" }, ).name | node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es5.d.ts:1074 |
stack? | public | string | TaggedError( "@temporal-contract/ActivityCancelledError", { name: "ActivityCancelledError" }, ).stack | node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es5.d.ts:1076 |
ActivityError
Defined in: packages/worker/src/errors.ts:266
Generic error surfaced on the Err(...) branch when an activity that declares contract errors fails for a reason other than one of its declared errors — retries exhausted on a technical failure, a timeout, an undeclared ApplicationFailure type, or a validation failure at the workflow → activity boundary.
Mirrors ChildWorkflowError: cause is the unwrapped actionable failure (Temporal's ActivityFailure wrapper is seen through), so callers can branch on the failure category in one step.
Only activities that declare an errors map surface this — activities without declared errors keep Temporal's native throwing behavior.
Extends
TaggedErrorInstance<"@temporal-contract/ActivityError", {activityName:string;cause?:unknown; }>
Constructors
Constructor
new ActivityError(
activityName,
message,
cause?): ActivityError;Defined in: packages/worker/src/errors.ts:272
Parameters
| Parameter | Type |
|---|---|
activityName | string |
message | string |
cause? | unknown |
Returns
Overrides
TaggedError("@temporal-contract/ActivityError", {
name: "ActivityError",
})<{
activityName: string;
cause?: unknown;
}>.constructorProperties
| Property | Modifier | Type | Inherited from | Defined in |
|---|---|---|---|---|
_tag | readonly | "@temporal-contract/ActivityError" | TaggedError("@temporal-contract/ActivityError", { name: "ActivityError", })._tag | node_modules/.pnpm/unthrown@4.1.0/node_modules/unthrown/dist/index.d.mts:1456 |
activityName | readonly | string | TaggedError("@temporal-contract/ActivityError", { name: "ActivityError", }).activityName | packages/worker/src/errors.ts:269 |
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 | TaggedError("@temporal-contract/ActivityError", { name: "ActivityError", }).message | node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es5.d.ts:1075 |
name | public | string | TaggedError("@temporal-contract/ActivityError", { name: "ActivityError", }).name | node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es5.d.ts:1074 |
stack? | public | string | TaggedError("@temporal-contract/ActivityError", { name: "ActivityError", }).stack | node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es5.d.ts:1076 |
ChildWorkflowCancelledError
Defined in: packages/worker/src/errors.ts:352
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;workflowName:string; }>
Constructors
Constructor
new ChildWorkflowCancelledError(workflowName, cause?): ChildWorkflowCancelledError;Defined in: packages/worker/src/errors.ts:359
Parameters
| Parameter | Type |
|---|---|
workflowName | string |
cause? | unknown |
Returns
Overrides
TaggedError(
"@temporal-contract/ChildWorkflowCancelledError",
{ name: "ChildWorkflowCancelledError" },
)<{
workflowName: string;
cause?: unknown;
}>.constructorProperties
| Property | Modifier | Type | Inherited from | Defined in |
|---|---|---|---|---|
_tag | readonly | "@temporal-contract/ChildWorkflowCancelledError" | TaggedError( "@temporal-contract/ChildWorkflowCancelledError", { name: "ChildWorkflowCancelledError" }, )._tag | node_modules/.pnpm/unthrown@4.1.0/node_modules/unthrown/dist/index.d.mts:1456 |
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 | TaggedError( "@temporal-contract/ChildWorkflowCancelledError", { name: "ChildWorkflowCancelledError" }, ).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:356 |
ChildWorkflowError
Defined in: packages/worker/src/errors.ts:326
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; }>
Constructors
Constructor
new ChildWorkflowError(message, cause?): ChildWorkflowError;Defined in: packages/worker/src/errors.ts:331
Parameters
| Parameter | Type |
|---|---|
message | string |
cause? | unknown |
Returns
Overrides
TaggedError("@temporal-contract/ChildWorkflowError", {
name: "ChildWorkflowError",
})<{
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@4.1.0/node_modules/unthrown/dist/index.d.mts:1456 |
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 | TaggedError("@temporal-contract/ChildWorkflowError", { name: "ChildWorkflowError", }).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:303
Error thrown when a child workflow is not found in the contract
Extends
TaggedErrorInstance<"@temporal-contract/ChildWorkflowNotFoundError", {availableWorkflows: readonlystring[];workflowName:string; }>
Constructors
Constructor
new ChildWorkflowNotFoundError(workflowName, availableWorkflows?): ChildWorkflowNotFoundError;Defined in: packages/worker/src/errors.ts:310
Parameters
| Parameter | Type | Default value |
|---|---|---|
workflowName | string | undefined |
availableWorkflows | readonly string[] | [] |
Returns
Overrides
TaggedError(
"@temporal-contract/ChildWorkflowNotFoundError",
{ name: "ChildWorkflowNotFoundError" },
)<{
workflowName: string;
availableWorkflows: readonly 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@4.1.0/node_modules/unthrown/dist/index.d.mts:1456 |
availableWorkflows | readonly | readonly string[] | TaggedError( "@temporal-contract/ChildWorkflowNotFoundError", { name: "ChildWorkflowNotFoundError" }, ).availableWorkflows | packages/worker/src/errors.ts:308 |
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 | TaggedError( "@temporal-contract/ChildWorkflowNotFoundError", { name: "ChildWorkflowNotFoundError" }, ).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:307 |
QueryInputValidationError
Defined in: packages/worker/src/errors.ts:166
Error thrown when query input validation fails
Extends
Constructors
Constructor
new QueryInputValidationError(queryName, issues): QueryInputValidationError;Defined in: packages/worker/src/errors.ts:167
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:168 |
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:183
Error thrown when query output validation fails
Extends
Constructors
Constructor
new QueryOutputValidationError(queryName, issues): QueryOutputValidationError;Defined in: packages/worker/src/errors.ts:184
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:185 |
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:149
Error thrown when signal input validation fails
Extends
Constructors
Constructor
new SignalInputValidationError(signalName, issues): SignalInputValidationError;Defined in: packages/worker/src/errors.ts:150
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:151 |
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:200
Error thrown when update input validation fails
Extends
Constructors
Constructor
new UpdateInputValidationError(updateName, issues): UpdateInputValidationError;Defined in: packages/worker/src/errors.ts:201
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:202 |
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:217
Error thrown when update output validation fails
Extends
Constructors
Constructor
new UpdateOutputValidationError(updateName, issues): UpdateOutputValidationError;Defined in: packages/worker/src/errors.ts:218
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:219 |
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:377
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; }>
Constructors
Constructor
new WorkflowCancelledError(cause?): WorkflowCancelledError;Defined in: packages/worker/src/errors.ts:383
Parameters
| Parameter | Type |
|---|---|
cause? | unknown |
Returns
Overrides
TaggedError(
"@temporal-contract/WorkflowCancelledError",
{ name: "WorkflowCancelledError" },
)<{
cause?: unknown;
}>.constructorProperties
| Property | Modifier | Type | Inherited from | Defined in |
|---|---|---|---|---|
_tag | readonly | "@temporal-contract/WorkflowCancelledError" | TaggedError( "@temporal-contract/WorkflowCancelledError", { name: "WorkflowCancelledError" }, )._tag | node_modules/.pnpm/unthrown@4.1.0/node_modules/unthrown/dist/index.d.mts:1456 |
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 | TaggedError( "@temporal-contract/WorkflowCancelledError", { name: "WorkflowCancelledError" }, ).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:115
Error thrown when workflow input validation fails
Extends
Constructors
Constructor
new WorkflowInputValidationError(workflowName, issues): WorkflowInputValidationError;Defined in: packages/worker/src/errors.ts:116
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:117 |
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:132
Error thrown when workflow output validation fails
Extends
Constructors
Constructor
new WorkflowOutputValidationError(workflowName, issues): WorkflowOutputValidationError;Defined in: packages/worker/src/errors.ts:133
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:134 |
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
Type Aliases
ContractErrorUnion
type ContractErrorUnion<TErrors> = { [K in keyof TErrors & string]: ContractError<K, InferErrorData<TErrors[K]>> }[keyof TErrors & string];Defined in: packages/contract/dist/errors.d.mts:74
Consumer-side union of ContractError instances for a declared errors map — data is typed with each schema's output (post-transform) shape. This is the union surfaced on the error channel of workflow-side activity calls and client-side workflow results.
Type Parameters
| Type Parameter |
|---|
TErrors extends Record<string, ErrorDefinition> |
Functions
declareWorkflow()
function declareWorkflow<TContract, TWorkflowName>(__namedParameters): (...args) => Promise<WorkerInferOutput<TContract["workflows"][TWorkflowName]>>;Defined in: packages/worker/src/workflow.ts:176
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.js';
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, workflowsPathFromURL } from '@temporal-contract/worker/worker';
import { activities } from './activities.js';
import myContract from './contract.js';
const worker = await createWorker({
contract: myContract,
connection,
workflowsPath: workflowsPathFromURL(import.meta.url, './workflows.js'),
activities,
}).getOrThrow();References
ActivityInputValidationError
Re-exports ActivityInputValidationError
ActivityOutputValidationError
Re-exports ActivityOutputValidationError
AnyContractError
Re-exports AnyContractError
ContractError
Re-exports ContractError
ContractErrorConstructors
Re-exports ContractErrorConstructors
ContractErrorDataValidationError
Re-exports ContractErrorDataValidationError
ContractErrorOptions
Re-exports ContractErrorOptions
ValidationError
Re-exports ValidationError