@temporal-contract/client
@temporal-contract/client
Classes
QueryValidationError
Defined in: packages/client/src/errors.ts:173
Thrown when query input or output validation fails
Extends
TypedClientError
Constructors
Constructor
new QueryValidationError(
queryName,
direction,
issues): QueryValidationError;Defined in: packages/client/src/errors.ts:174
Parameters
| Parameter | Type |
|---|---|
queryName | string |
direction | "input" | "output" |
issues | readonly Issue[] |
Returns
Overrides
TypedClientError.constructorProperties
| Property | Modifier | Type | Description | Inherited from | Defined in |
|---|---|---|---|---|---|
cause? | public | unknown | - | TypedClientError.cause | node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2022.error.d.ts:24 |
direction | readonly | "input" | "output" | - | - | packages/client/src/errors.ts:176 |
issues | readonly | readonly Issue[] | - | - | packages/client/src/errors.ts:177 |
message | public | string | - | TypedClientError.message | node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es5.d.ts:1075 |
name | public | string | - | TypedClientError.name | node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es5.d.ts:1074 |
queryName | readonly | string | - | - | packages/client/src/errors.ts:175 |
stack? | public | string | - | TypedClientError.stack | node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es5.d.ts:1076 |
stackTraceLimit | static | number | The Error.stackTraceLimit property specifies the number of stack frames collected by a stack trace (whether generated by new Error().stack or Error.captureStackTrace(obj)). The default value is 10 but may be set to any valid JavaScript number. Changes will affect any stack trace captured after the value has been changed. If set to a non-number value, or set to a negative number, stack traces will not capture any frames. | TypedClientError.stackTraceLimit | node_modules/.pnpm/@types+node@24.12.2/node_modules/@types/node/globals.d.ts:68 |
Methods
captureStackTrace()
static captureStackTrace(targetObject, constructorOpt?): void;Defined in: node_modules/.pnpm/@types+node@24.12.2/node_modules/@types/node/globals.d.ts:52
Creates a .stack property on targetObject, which when accessed returns a string representing the location in the code at which Error.captureStackTrace() was called.
const myObject = {};
Error.captureStackTrace(myObject);
myObject.stack; // Similar to `new Error().stack`The first line of the trace will be prefixed with ${myObject.name}: ${myObject.message}.
The optional constructorOpt argument accepts a function. If given, all frames above constructorOpt, including constructorOpt, will be omitted from the generated stack trace.
The constructorOpt argument is useful for hiding implementation details of error generation from the user. For instance:
function a() {
b();
}
function b() {
c();
}
function c() {
// Create an error without stack trace to avoid calculating the stack trace twice.
const { stackTraceLimit } = Error;
Error.stackTraceLimit = 0;
const error = new Error();
Error.stackTraceLimit = stackTraceLimit;
// Capture the stack trace above function b
Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace
throw error;
}
a();Parameters
| Parameter | Type |
|---|---|
targetObject | object |
constructorOpt? | Function |
Returns
void
Inherited from
TypedClientError.captureStackTraceprepareStackTrace()
static prepareStackTrace(err, stackTraces): any;Defined in: node_modules/.pnpm/@types+node@24.12.2/node_modules/@types/node/globals.d.ts:56
Parameters
| Parameter | Type |
|---|---|
err | Error |
stackTraces | CallSite[] |
Returns
any
See
https://v8.dev/docs/stack-trace-api#customizing-stack-traces
Inherited from
TypedClientError.prepareStackTraceRuntimeClientError
Defined in: packages/client/src/errors.ts:48
Generic runtime failure wrapper when no specific error type applies
Extends
TypedClientError
Constructors
Constructor
new RuntimeClientError(operation, cause?): RuntimeClientError;Defined in: packages/client/src/errors.ts:49
Parameters
| Parameter | Type |
|---|---|
operation | string |
cause? | unknown |
Returns
Overrides
TypedClientError.constructorProperties
| Property | Modifier | Type | Description | Inherited from | Defined in |
|---|---|---|---|---|---|
cause? | readonly | unknown | - | TypedClientError.cause | packages/client/src/errors.ts:51 |
message | public | string | - | TypedClientError.message | node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es5.d.ts:1075 |
name | public | string | - | TypedClientError.name | node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es5.d.ts:1074 |
operation | readonly | string | - | - | packages/client/src/errors.ts:50 |
stack? | public | string | - | TypedClientError.stack | node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es5.d.ts:1076 |
stackTraceLimit | static | number | The Error.stackTraceLimit property specifies the number of stack frames collected by a stack trace (whether generated by new Error().stack or Error.captureStackTrace(obj)). The default value is 10 but may be set to any valid JavaScript number. Changes will affect any stack trace captured after the value has been changed. If set to a non-number value, or set to a negative number, stack traces will not capture any frames. | TypedClientError.stackTraceLimit | node_modules/.pnpm/@types+node@24.12.2/node_modules/@types/node/globals.d.ts:68 |
Methods
captureStackTrace()
static captureStackTrace(targetObject, constructorOpt?): void;Defined in: node_modules/.pnpm/@types+node@24.12.2/node_modules/@types/node/globals.d.ts:52
Creates a .stack property on targetObject, which when accessed returns a string representing the location in the code at which Error.captureStackTrace() was called.
const myObject = {};
Error.captureStackTrace(myObject);
myObject.stack; // Similar to `new Error().stack`The first line of the trace will be prefixed with ${myObject.name}: ${myObject.message}.
The optional constructorOpt argument accepts a function. If given, all frames above constructorOpt, including constructorOpt, will be omitted from the generated stack trace.
The constructorOpt argument is useful for hiding implementation details of error generation from the user. For instance:
function a() {
b();
}
function b() {
c();
}
function c() {
// Create an error without stack trace to avoid calculating the stack trace twice.
const { stackTraceLimit } = Error;
Error.stackTraceLimit = 0;
const error = new Error();
Error.stackTraceLimit = stackTraceLimit;
// Capture the stack trace above function b
Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace
throw error;
}
a();Parameters
| Parameter | Type |
|---|---|
targetObject | object |
constructorOpt? | Function |
Returns
void
Inherited from
TypedClientError.captureStackTraceprepareStackTrace()
static prepareStackTrace(err, stackTraces): any;Defined in: node_modules/.pnpm/@types+node@24.12.2/node_modules/@types/node/globals.d.ts:56
Parameters
| Parameter | Type |
|---|---|
err | Error |
stackTraces | CallSite[] |
Returns
any
See
https://v8.dev/docs/stack-trace-api#customizing-stack-traces
Inherited from
TypedClientError.prepareStackTraceSignalValidationError
Defined in: packages/client/src/errors.ts:186
Thrown when signal input validation fails
Extends
TypedClientError
Constructors
Constructor
new SignalValidationError(signalName, issues): SignalValidationError;Defined in: packages/client/src/errors.ts:187
Parameters
| Parameter | Type |
|---|---|
signalName | string |
issues | readonly Issue[] |
Returns
Overrides
TypedClientError.constructorProperties
| Property | Modifier | Type | Description | Inherited from | Defined in |
|---|---|---|---|---|---|
cause? | public | unknown | - | TypedClientError.cause | node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2022.error.d.ts:24 |
issues | readonly | readonly Issue[] | - | - | packages/client/src/errors.ts:189 |
message | public | string | - | TypedClientError.message | node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es5.d.ts:1075 |
name | public | string | - | TypedClientError.name | node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es5.d.ts:1074 |
signalName | readonly | string | - | - | packages/client/src/errors.ts:188 |
stack? | public | string | - | TypedClientError.stack | node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es5.d.ts:1076 |
stackTraceLimit | static | number | The Error.stackTraceLimit property specifies the number of stack frames collected by a stack trace (whether generated by new Error().stack or Error.captureStackTrace(obj)). The default value is 10 but may be set to any valid JavaScript number. Changes will affect any stack trace captured after the value has been changed. If set to a non-number value, or set to a negative number, stack traces will not capture any frames. | TypedClientError.stackTraceLimit | node_modules/.pnpm/@types+node@24.12.2/node_modules/@types/node/globals.d.ts:68 |
Methods
captureStackTrace()
static captureStackTrace(targetObject, constructorOpt?): void;Defined in: node_modules/.pnpm/@types+node@24.12.2/node_modules/@types/node/globals.d.ts:52
Creates a .stack property on targetObject, which when accessed returns a string representing the location in the code at which Error.captureStackTrace() was called.
const myObject = {};
Error.captureStackTrace(myObject);
myObject.stack; // Similar to `new Error().stack`The first line of the trace will be prefixed with ${myObject.name}: ${myObject.message}.
The optional constructorOpt argument accepts a function. If given, all frames above constructorOpt, including constructorOpt, will be omitted from the generated stack trace.
The constructorOpt argument is useful for hiding implementation details of error generation from the user. For instance:
function a() {
b();
}
function b() {
c();
}
function c() {
// Create an error without stack trace to avoid calculating the stack trace twice.
const { stackTraceLimit } = Error;
Error.stackTraceLimit = 0;
const error = new Error();
Error.stackTraceLimit = stackTraceLimit;
// Capture the stack trace above function b
Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace
throw error;
}
a();Parameters
| Parameter | Type |
|---|---|
targetObject | object |
constructorOpt? | Function |
Returns
void
Inherited from
TypedClientError.captureStackTraceprepareStackTrace()
static prepareStackTrace(err, stackTraces): any;Defined in: node_modules/.pnpm/@types+node@24.12.2/node_modules/@types/node/globals.d.ts:56
Parameters
| Parameter | Type |
|---|---|
err | Error |
stackTraces | CallSite[] |
Returns
any
See
https://v8.dev/docs/stack-trace-api#customizing-stack-traces
Inherited from
TypedClientError.prepareStackTraceTypedClient
Defined in: packages/client/src/client.ts:345
Typed Temporal client with neverthrow Result/ResultAsync pattern based on a contract
Provides type-safe methods to start and execute workflows defined in the contract, with explicit error handling using Result pattern.
Type Parameters
| Type Parameter |
|---|
TContract extends ContractDefinition |
Properties
| Property | Modifier | Type | Description | Defined in |
|---|---|---|---|---|
schedule | readonly | TypedScheduleClient<TContract> | Typed wrapper around Temporal's client.schedule.create(...) and related lifecycle methods. Fires the underlying startWorkflow action with args validated against the contract's input schema. Requires @temporalio/client 1.16+. The Schedule API was added in 1.16; on older versions this property is unset and any access throws. The package's peer dep is pinned to ^1.16.0 so the standard install paths surface a peer-dependency warning rather than a runtime crash. Example const result = await client.schedule.create("processOrder", { scheduleId: "daily-sweep", spec: { cronExpressions: ["0 2 * * *"] }, args: { orderId: "sweep" }, }); result.match( async (handle) => { await handle.pause("maintenance"); }, (error) => console.error("schedule create failed", error), ); | packages/client/src/client.ts:370 |
Methods
executeWorkflow()
executeWorkflow<TWorkflowName>(workflowName, __namedParameters): ResultAsync<ClientInferOutput<TContract["workflows"][TWorkflowName]>,
| WorkflowNotFoundError
| WorkflowValidationError
| WorkflowAlreadyStartedError
| RuntimeClientError
| WorkflowFailedError
| WorkflowExecutionNotFoundError>;Defined in: packages/client/src/client.ts:605
Execute a workflow (start and wait for result) with ResultAsync pattern
Type Parameters
| Type Parameter |
|---|
TWorkflowName extends string |
Parameters
| Parameter | Type |
|---|---|
workflowName | TWorkflowName |
__namedParameters | TypedWorkflowStartOptions<TContract, TWorkflowName> |
Returns
ResultAsync<ClientInferOutput<TContract["workflows"][TWorkflowName]>, | WorkflowNotFoundError | WorkflowValidationError | WorkflowAlreadyStartedError | RuntimeClientError | WorkflowFailedError | WorkflowExecutionNotFoundError>
Example
const result = await client.executeWorkflow('processOrder', {
workflowId: 'order-123',
args: { orderId: 'ORD-123' },
workflowExecutionTimeout: '1 day',
retry: { maximumAttempts: 3 },
});
result.match(
(output) => console.log('Order processed:', output.status),
(error) => console.error('Processing failed:', error),
);getHandle()
getHandle<TWorkflowName>(workflowName, workflowId): ResultAsync<TypedWorkflowHandle<TContract["workflows"][TWorkflowName]>,
| WorkflowNotFoundError
| RuntimeClientError>;Defined in: packages/client/src/client.ts:710
Get a handle to an existing workflow with ResultAsync pattern
Type Parameters
| Type Parameter |
|---|
TWorkflowName extends string |
Parameters
| Parameter | Type |
|---|---|
workflowName | TWorkflowName |
workflowId | string |
Returns
ResultAsync<TypedWorkflowHandle<TContract["workflows"][TWorkflowName]>, | WorkflowNotFoundError | RuntimeClientError>
Example
const handleResult = await client.getHandle('processOrder', 'order-123');
handleResult.match(
async (handle) => {
const result = await handle.result();
// ... handle result
},
(error) => console.error('Failed to get handle:', error),
);signalWithStart()
signalWithStart<TWorkflowName, TSignalName>(workflowName, __namedParameters): ResultAsync<TypedWorkflowHandleWithSignaledRunId<TContract["workflows"][TWorkflowName]>,
| WorkflowNotFoundError
| WorkflowValidationError
| WorkflowAlreadyStartedError
| RuntimeClientError
| SignalValidationError>;Defined in: packages/client/src/client.ts:509
Send a signal to a workflow, starting it first if it doesn't already exist.
Validates both halves of the call against the contract:
argsagainst the workflow's input schemasignalArgsagainst the named signal's input schema
Returns a TypedWorkflowHandleWithSignaledRunId — the same shape as startWorkflow's handle, plus a signaledRunId field for correlating the signal with the (possibly pre-existing) workflow execution chain.
Type Parameters
| Type Parameter |
|---|
TWorkflowName extends string |
TSignalName extends string |
Parameters
| Parameter | Type |
|---|---|
workflowName | TWorkflowName |
__namedParameters | TypedSignalWithStartOptions<TContract, TWorkflowName, TSignalName> |
Returns
ResultAsync<TypedWorkflowHandleWithSignaledRunId<TContract["workflows"][TWorkflowName]>, | WorkflowNotFoundError | WorkflowValidationError | WorkflowAlreadyStartedError | RuntimeClientError | SignalValidationError>
Example
const result = await client.signalWithStart('processOrder', {
workflowId: 'order-123',
args: { orderId: 'ORD-123', customerId: 'CUST-1' },
signalName: 'cancel',
signalArgs: { reason: 'duplicate' },
});
result.match(
(handle) => console.log('signaled run', handle.signaledRunId),
(error) => console.error('signalWithStart failed', error),
);startWorkflow()
startWorkflow<TWorkflowName>(workflowName, __namedParameters): ResultAsync<TypedWorkflowHandle<TContract["workflows"][TWorkflowName]>,
| WorkflowNotFoundError
| WorkflowValidationError
| WorkflowAlreadyStartedError
| RuntimeClientError>;Defined in: packages/client/src/client.ts:438
Start a workflow and return a typed handle with ResultAsync pattern
Type Parameters
| Type Parameter |
|---|
TWorkflowName extends string |
Parameters
| Parameter | Type |
|---|---|
workflowName | TWorkflowName |
__namedParameters | TypedWorkflowStartOptions<TContract, TWorkflowName> |
Returns
ResultAsync<TypedWorkflowHandle<TContract["workflows"][TWorkflowName]>, | WorkflowNotFoundError | WorkflowValidationError | WorkflowAlreadyStartedError | RuntimeClientError>
Example
const handleResult = await client.startWorkflow('processOrder', {
workflowId: 'order-123',
args: { orderId: 'ORD-123' },
workflowExecutionTimeout: '1 day',
retry: { maximumAttempts: 3 },
});
handleResult.match(
async (handle) => {
const result = await handle.result();
// ... handle result
},
(error) => console.error('Failed to start:', error),
);create()
static create<TContract>(contract, client): TypedClient<TContract>;Defined in: packages/client/src/client.ts:410
Create a typed Temporal client with neverthrow pattern from a contract
Type Parameters
| Type Parameter |
|---|
TContract extends ContractDefinition |
Parameters
| Parameter | Type |
|---|---|
contract | TContract |
client | Client |
Returns
TypedClient<TContract>
Example
const connection = await Connection.connect();
const temporalClient = new Client({ connection });
const client = TypedClient.create(myContract, temporalClient);
const result = await client.executeWorkflow('processOrder', {
workflowId: 'order-123',
args: { ... },
});
result.match(
(output) => console.log('Success:', output),
(error) => console.error('Failed:', error),
);TypedScheduleClient
Defined in: packages/client/src/schedule.ts:109
Typed wrapper around Temporal's ScheduleClient. Exposed as typedClient.schedule — keeps the typed-client surface organized the same way Temporal's own Client.schedule does.
Type Parameters
| Type Parameter |
|---|
TContract extends ContractDefinition |
Constructors
Constructor
new TypedScheduleClient<TContract>(contract, scheduleClient): TypedScheduleClient<TContract>;Defined in: packages/client/src/schedule.ts:110
Parameters
| Parameter | Type |
|---|---|
contract | TContract |
scheduleClient | ScheduleClient |
Returns
TypedScheduleClient<TContract>
Methods
create()
create<TWorkflowName>(workflowName, options): ResultAsync<TypedScheduleHandle,
| WorkflowNotFoundError
| WorkflowValidationError
| RuntimeClientError>;Defined in: packages/client/src/schedule.ts:124
Create a new schedule that, on each fire, starts the named contract workflow with validated args.
Validates args against the workflow's input schema before dispatching the create request to Temporal. The workflow's taskQueue and workflowType are pulled from the contract automatically; the typed options shape omits them so call sites don't have to repeat themselves.
Type Parameters
| Type Parameter |
|---|
TWorkflowName extends string |
Parameters
| Parameter | Type |
|---|---|
workflowName | TWorkflowName |
options | TypedScheduleCreateOptions<TContract, TWorkflowName> |
Returns
ResultAsync<TypedScheduleHandle, | WorkflowNotFoundError | WorkflowValidationError | RuntimeClientError>
getHandle()
getHandle(scheduleId): TypedScheduleHandle;Defined in: packages/client/src/schedule.ts:206
Get a typed handle to an existing schedule. Does not validate that the schedule exists — handle methods (describe, pause, etc.) will surface a RuntimeClientError if the underlying ID is unknown.
Parameters
| Parameter | Type |
|---|---|
scheduleId | string |
Returns
UpdateValidationError
Defined in: packages/client/src/errors.ts:198
Thrown when update input or output validation fails
Extends
TypedClientError
Constructors
Constructor
new UpdateValidationError(
updateName,
direction,
issues): UpdateValidationError;Defined in: packages/client/src/errors.ts:199
Parameters
| Parameter | Type |
|---|---|
updateName | string |
direction | "input" | "output" |
issues | readonly Issue[] |
Returns
Overrides
TypedClientError.constructorProperties
| Property | Modifier | Type | Description | Inherited from | Defined in |
|---|---|---|---|---|---|
cause? | public | unknown | - | TypedClientError.cause | node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2022.error.d.ts:24 |
direction | readonly | "input" | "output" | - | - | packages/client/src/errors.ts:201 |
issues | readonly | readonly Issue[] | - | - | packages/client/src/errors.ts:202 |
message | public | string | - | TypedClientError.message | node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es5.d.ts:1075 |
name | public | string | - | TypedClientError.name | node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es5.d.ts:1074 |
stack? | public | string | - | TypedClientError.stack | node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es5.d.ts:1076 |
updateName | readonly | string | - | - | packages/client/src/errors.ts:200 |
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. | TypedClientError.stackTraceLimit | node_modules/.pnpm/@types+node@24.12.2/node_modules/@types/node/globals.d.ts:68 |
Methods
captureStackTrace()
static captureStackTrace(targetObject, constructorOpt?): void;Defined in: node_modules/.pnpm/@types+node@24.12.2/node_modules/@types/node/globals.d.ts:52
Creates a .stack property on targetObject, which when accessed returns a string representing the location in the code at which Error.captureStackTrace() was called.
const myObject = {};
Error.captureStackTrace(myObject);
myObject.stack; // Similar to `new Error().stack`The first line of the trace will be prefixed with ${myObject.name}: ${myObject.message}.
The optional constructorOpt argument accepts a function. If given, all frames above constructorOpt, including constructorOpt, will be omitted from the generated stack trace.
The constructorOpt argument is useful for hiding implementation details of error generation from the user. For instance:
function a() {
b();
}
function b() {
c();
}
function c() {
// Create an error without stack trace to avoid calculating the stack trace twice.
const { stackTraceLimit } = Error;
Error.stackTraceLimit = 0;
const error = new Error();
Error.stackTraceLimit = stackTraceLimit;
// Capture the stack trace above function b
Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace
throw error;
}
a();Parameters
| Parameter | Type |
|---|---|
targetObject | object |
constructorOpt? | Function |
Returns
void
Inherited from
TypedClientError.captureStackTraceprepareStackTrace()
static prepareStackTrace(err, stackTraces): any;Defined in: node_modules/.pnpm/@types+node@24.12.2/node_modules/@types/node/globals.d.ts:56
Parameters
| Parameter | Type |
|---|---|
err | Error |
stackTraces | CallSite[] |
Returns
any
See
https://v8.dev/docs/stack-trace-api#customizing-stack-traces
Inherited from
TypedClientError.prepareStackTraceWorkflowAlreadyStartedError
Defined in: packages/client/src/errors.ts:86
Discriminated variant of RuntimeClientError surfaced when starting a workflow collides with an existing execution — Temporal's WorkflowExecutionAlreadyStartedError. The most common cause is a workflowId reuse policy that rejects duplicates while a previous run is still in retention.
Distinguishing this from RuntimeClientError lets idempotent callers branch on it explicitly (e.g. fetch the existing handle and continue) without inspecting error.cause against a Temporal SDK class.
Extends
TypedClientError
Constructors
Constructor
new WorkflowAlreadyStartedError(
workflowType,
workflowId,
cause?): WorkflowAlreadyStartedError;Defined in: packages/client/src/errors.ts:87
Parameters
| Parameter | Type |
|---|---|
workflowType | string |
workflowId | string |
cause? | unknown |
Returns
Overrides
TypedClientError.constructorProperties
| Property | Modifier | Type | Description | Inherited from | Defined in |
|---|---|---|---|---|---|
cause? | readonly | unknown | - | TypedClientError.cause | packages/client/src/errors.ts:90 |
message | public | string | - | TypedClientError.message | node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es5.d.ts:1075 |
name | public | string | - | TypedClientError.name | node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es5.d.ts:1074 |
stack? | public | string | - | TypedClientError.stack | node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es5.d.ts:1076 |
workflowId | readonly | string | - | - | packages/client/src/errors.ts:89 |
workflowType | readonly | string | - | - | packages/client/src/errors.ts:88 |
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. | TypedClientError.stackTraceLimit | node_modules/.pnpm/@types+node@24.12.2/node_modules/@types/node/globals.d.ts:68 |
Methods
captureStackTrace()
static captureStackTrace(targetObject, constructorOpt?): void;Defined in: node_modules/.pnpm/@types+node@24.12.2/node_modules/@types/node/globals.d.ts:52
Creates a .stack property on targetObject, which when accessed returns a string representing the location in the code at which Error.captureStackTrace() was called.
const myObject = {};
Error.captureStackTrace(myObject);
myObject.stack; // Similar to `new Error().stack`The first line of the trace will be prefixed with ${myObject.name}: ${myObject.message}.
The optional constructorOpt argument accepts a function. If given, all frames above constructorOpt, including constructorOpt, will be omitted from the generated stack trace.
The constructorOpt argument is useful for hiding implementation details of error generation from the user. For instance:
function a() {
b();
}
function b() {
c();
}
function c() {
// Create an error without stack trace to avoid calculating the stack trace twice.
const { stackTraceLimit } = Error;
Error.stackTraceLimit = 0;
const error = new Error();
Error.stackTraceLimit = stackTraceLimit;
// Capture the stack trace above function b
Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace
throw error;
}
a();Parameters
| Parameter | Type |
|---|---|
targetObject | object |
constructorOpt? | Function |
Returns
void
Inherited from
TypedClientError.captureStackTraceprepareStackTrace()
static prepareStackTrace(err, stackTraces): any;Defined in: node_modules/.pnpm/@types+node@24.12.2/node_modules/@types/node/globals.d.ts:56
Parameters
| Parameter | Type |
|---|---|
err | Error |
stackTraces | CallSite[] |
Returns
any
See
https://v8.dev/docs/stack-trace-api#customizing-stack-traces
Inherited from
TypedClientError.prepareStackTraceWorkflowExecutionNotFoundError
Defined in: packages/client/src/errors.ts:108
Discriminated variant of RuntimeClientError surfaced when an operation targets a workflow execution that doesn't exist in the namespace — Temporal's WorkflowNotFoundError (distinct from this package's contract-level WorkflowNotFoundError).
Returned from:
- handle methods:
signal,query,executeUpdate,result,terminate,cancel,describe,fetchHistory executeWorkflow(when the underlying execute call hits a missing execution mid-flight)
Extends
TypedClientError
Constructors
Constructor
new WorkflowExecutionNotFoundError(
workflowId,
runId?,
cause?): WorkflowExecutionNotFoundError;Defined in: packages/client/src/errors.ts:109
Parameters
| Parameter | Type |
|---|---|
workflowId | string |
runId? | string |
cause? | unknown |
Returns
WorkflowExecutionNotFoundError
Overrides
TypedClientError.constructorProperties
| Property | Modifier | Type | Description | Inherited from | Defined in |
|---|---|---|---|---|---|
cause? | readonly | unknown | - | TypedClientError.cause | packages/client/src/errors.ts:112 |
message | public | string | - | TypedClientError.message | node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es5.d.ts:1075 |
name | public | string | - | TypedClientError.name | node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es5.d.ts:1074 |
runId? | readonly | string | - | - | packages/client/src/errors.ts:111 |
stack? | public | string | - | TypedClientError.stack | node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es5.d.ts:1076 |
workflowId | readonly | string | - | - | packages/client/src/errors.ts:110 |
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. | TypedClientError.stackTraceLimit | node_modules/.pnpm/@types+node@24.12.2/node_modules/@types/node/globals.d.ts:68 |
Methods
captureStackTrace()
static captureStackTrace(targetObject, constructorOpt?): void;Defined in: node_modules/.pnpm/@types+node@24.12.2/node_modules/@types/node/globals.d.ts:52
Creates a .stack property on targetObject, which when accessed returns a string representing the location in the code at which Error.captureStackTrace() was called.
const myObject = {};
Error.captureStackTrace(myObject);
myObject.stack; // Similar to `new Error().stack`The first line of the trace will be prefixed with ${myObject.name}: ${myObject.message}.
The optional constructorOpt argument accepts a function. If given, all frames above constructorOpt, including constructorOpt, will be omitted from the generated stack trace.
The constructorOpt argument is useful for hiding implementation details of error generation from the user. For instance:
function a() {
b();
}
function b() {
c();
}
function c() {
// Create an error without stack trace to avoid calculating the stack trace twice.
const { stackTraceLimit } = Error;
Error.stackTraceLimit = 0;
const error = new Error();
Error.stackTraceLimit = stackTraceLimit;
// Capture the stack trace above function b
Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace
throw error;
}
a();Parameters
| Parameter | Type |
|---|---|
targetObject | object |
constructorOpt? | Function |
Returns
void
Inherited from
TypedClientError.captureStackTraceprepareStackTrace()
static prepareStackTrace(err, stackTraces): any;Defined in: node_modules/.pnpm/@types+node@24.12.2/node_modules/@types/node/globals.d.ts:56
Parameters
| Parameter | Type |
|---|---|
err | Error |
stackTraces | CallSite[] |
Returns
any
See
https://v8.dev/docs/stack-trace-api#customizing-stack-traces
Inherited from
TypedClientError.prepareStackTraceWorkflowFailedError
Defined in: packages/client/src/errors.ts:139
Discriminated variant of RuntimeClientError surfaced when waiting on a workflow's result and the workflow completes with a failure — Temporal's WorkflowFailedError.
cause is the unwrapped underlying TemporalFailure (typically an ApplicationFailure, CancelledFailure, TerminatedFailure, or TimeoutFailure) lifted from Temporal's wrapper, so callers can branch on the failure category in one step (err.cause instanceof ApplicationFailure) instead of unwrapping twice via the SDK wrapper. The SDK declares WorkflowFailedError.cause as the wider Error | undefined (since cause lives on Error), but the runtime guarantee — driven by Temporal's wire format — is that it is always a TemporalFailure subclass when the wrapper is surfaced. classifyResultError narrows that wider static type to the public TemporalFailure union with a cast, so consumers see the precise leaf-failure typing instead of a bare Error.
Returned from executeWorkflow and handle.result().
Extends
TypedClientError
Constructors
Constructor
new WorkflowFailedError(workflowId, cause?): WorkflowFailedError;Defined in: packages/client/src/errors.ts:140
Parameters
| Parameter | Type |
|---|---|
workflowId | string |
cause? | TemporalFailure |
Returns
Overrides
TypedClientError.constructorProperties
| Property | Modifier | Type | Description | Inherited from | Defined in |
|---|---|---|---|---|---|
cause? | readonly | TemporalFailure | - | TypedClientError.cause | packages/client/src/errors.ts:142 |
message | public | string | - | TypedClientError.message | node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es5.d.ts:1075 |
name | public | string | - | TypedClientError.name | node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es5.d.ts:1074 |
stack? | public | string | - | TypedClientError.stack | node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es5.d.ts:1076 |
workflowId | readonly | string | - | - | packages/client/src/errors.ts:141 |
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. | TypedClientError.stackTraceLimit | node_modules/.pnpm/@types+node@24.12.2/node_modules/@types/node/globals.d.ts:68 |
Methods
captureStackTrace()
static captureStackTrace(targetObject, constructorOpt?): void;Defined in: node_modules/.pnpm/@types+node@24.12.2/node_modules/@types/node/globals.d.ts:52
Creates a .stack property on targetObject, which when accessed returns a string representing the location in the code at which Error.captureStackTrace() was called.
const myObject = {};
Error.captureStackTrace(myObject);
myObject.stack; // Similar to `new Error().stack`The first line of the trace will be prefixed with ${myObject.name}: ${myObject.message}.
The optional constructorOpt argument accepts a function. If given, all frames above constructorOpt, including constructorOpt, will be omitted from the generated stack trace.
The constructorOpt argument is useful for hiding implementation details of error generation from the user. For instance:
function a() {
b();
}
function b() {
c();
}
function c() {
// Create an error without stack trace to avoid calculating the stack trace twice.
const { stackTraceLimit } = Error;
Error.stackTraceLimit = 0;
const error = new Error();
Error.stackTraceLimit = stackTraceLimit;
// Capture the stack trace above function b
Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace
throw error;
}
a();Parameters
| Parameter | Type |
|---|---|
targetObject | object |
constructorOpt? | Function |
Returns
void
Inherited from
TypedClientError.captureStackTraceprepareStackTrace()
static prepareStackTrace(err, stackTraces): any;Defined in: node_modules/.pnpm/@types+node@24.12.2/node_modules/@types/node/globals.d.ts:56
Parameters
| Parameter | Type |
|---|---|
err | Error |
stackTraces | CallSite[] |
Returns
any
See
https://v8.dev/docs/stack-trace-api#customizing-stack-traces
Inherited from
TypedClientError.prepareStackTraceWorkflowNotFoundError
Defined in: packages/client/src/errors.ts:64
Thrown when a workflow is not found in the contract
Extends
TypedClientError
Constructors
Constructor
new WorkflowNotFoundError(workflowName, availableWorkflows): WorkflowNotFoundError;Defined in: packages/client/src/errors.ts:65
Parameters
| Parameter | Type |
|---|---|
workflowName | string |
availableWorkflows | string[] |
Returns
Overrides
TypedClientError.constructorProperties
| Property | Modifier | Type | Description | Inherited from | Defined in |
|---|---|---|---|---|---|
availableWorkflows | readonly | string[] | - | - | packages/client/src/errors.ts:67 |
cause? | public | unknown | - | TypedClientError.cause | node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2022.error.d.ts:24 |
message | public | string | - | TypedClientError.message | node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es5.d.ts:1075 |
name | public | string | - | TypedClientError.name | node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es5.d.ts:1074 |
stack? | public | string | - | TypedClientError.stack | node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es5.d.ts:1076 |
workflowName | readonly | string | - | - | packages/client/src/errors.ts:66 |
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. | TypedClientError.stackTraceLimit | node_modules/.pnpm/@types+node@24.12.2/node_modules/@types/node/globals.d.ts:68 |
Methods
captureStackTrace()
static captureStackTrace(targetObject, constructorOpt?): void;Defined in: node_modules/.pnpm/@types+node@24.12.2/node_modules/@types/node/globals.d.ts:52
Creates a .stack property on targetObject, which when accessed returns a string representing the location in the code at which Error.captureStackTrace() was called.
const myObject = {};
Error.captureStackTrace(myObject);
myObject.stack; // Similar to `new Error().stack`The first line of the trace will be prefixed with ${myObject.name}: ${myObject.message}.
The optional constructorOpt argument accepts a function. If given, all frames above constructorOpt, including constructorOpt, will be omitted from the generated stack trace.
The constructorOpt argument is useful for hiding implementation details of error generation from the user. For instance:
function a() {
b();
}
function b() {
c();
}
function c() {
// Create an error without stack trace to avoid calculating the stack trace twice.
const { stackTraceLimit } = Error;
Error.stackTraceLimit = 0;
const error = new Error();
Error.stackTraceLimit = stackTraceLimit;
// Capture the stack trace above function b
Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace
throw error;
}
a();Parameters
| Parameter | Type |
|---|---|
targetObject | object |
constructorOpt? | Function |
Returns
void
Inherited from
TypedClientError.captureStackTraceprepareStackTrace()
static prepareStackTrace(err, stackTraces): any;Defined in: node_modules/.pnpm/@types+node@24.12.2/node_modules/@types/node/globals.d.ts:56
Parameters
| Parameter | Type |
|---|---|
err | Error |
stackTraces | CallSite[] |
Returns
any
See
https://v8.dev/docs/stack-trace-api#customizing-stack-traces
Inherited from
TypedClientError.prepareStackTraceWorkflowValidationError
Defined in: packages/client/src/errors.ts:158
Thrown when workflow input or output validation fails
Extends
TypedClientError
Constructors
Constructor
new WorkflowValidationError(
workflowName,
direction,
issues): WorkflowValidationError;Defined in: packages/client/src/errors.ts:159
Parameters
| Parameter | Type |
|---|---|
workflowName | string |
direction | "input" | "output" |
issues | readonly Issue[] |
Returns
Overrides
TypedClientError.constructorProperties
| Property | Modifier | Type | Description | Inherited from | Defined in |
|---|---|---|---|---|---|
cause? | public | unknown | - | TypedClientError.cause | node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2022.error.d.ts:24 |
direction | readonly | "input" | "output" | - | - | packages/client/src/errors.ts:161 |
issues | readonly | readonly Issue[] | - | - | packages/client/src/errors.ts:162 |
message | public | string | - | TypedClientError.message | node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es5.d.ts:1075 |
name | public | string | - | TypedClientError.name | node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es5.d.ts:1074 |
stack? | public | string | - | TypedClientError.stack | node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es5.d.ts:1076 |
workflowName | readonly | string | - | - | packages/client/src/errors.ts:160 |
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. | TypedClientError.stackTraceLimit | node_modules/.pnpm/@types+node@24.12.2/node_modules/@types/node/globals.d.ts:68 |
Methods
captureStackTrace()
static captureStackTrace(targetObject, constructorOpt?): void;Defined in: node_modules/.pnpm/@types+node@24.12.2/node_modules/@types/node/globals.d.ts:52
Creates a .stack property on targetObject, which when accessed returns a string representing the location in the code at which Error.captureStackTrace() was called.
const myObject = {};
Error.captureStackTrace(myObject);
myObject.stack; // Similar to `new Error().stack`The first line of the trace will be prefixed with ${myObject.name}: ${myObject.message}.
The optional constructorOpt argument accepts a function. If given, all frames above constructorOpt, including constructorOpt, will be omitted from the generated stack trace.
The constructorOpt argument is useful for hiding implementation details of error generation from the user. For instance:
function a() {
b();
}
function b() {
c();
}
function c() {
// Create an error without stack trace to avoid calculating the stack trace twice.
const { stackTraceLimit } = Error;
Error.stackTraceLimit = 0;
const error = new Error();
Error.stackTraceLimit = stackTraceLimit;
// Capture the stack trace above function b
Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace
throw error;
}
a();Parameters
| Parameter | Type |
|---|---|
targetObject | object |
constructorOpt? | Function |
Returns
void
Inherited from
TypedClientError.captureStackTraceprepareStackTrace()
static prepareStackTrace(err, stackTraces): any;Defined in: node_modules/.pnpm/@types+node@24.12.2/node_modules/@types/node/globals.d.ts:56
Parameters
| Parameter | Type |
|---|---|
err | Error |
stackTraces | CallSite[] |
Returns
any
See
https://v8.dev/docs/stack-trace-api#customizing-stack-traces
Inherited from
TypedClientError.prepareStackTraceType Aliases
ClientInferActivities
type ClientInferActivities<TContract> = TContract["activities"] extends Record<string, ActivityDefinition> ? { [K in keyof TContract["activities"]]: ClientInferActivity<TContract["activities"][K]> } : object;Defined in: packages/client/src/types.ts:88
Infer all activities from a contract (client perspective)
Type Parameters
| Type Parameter |
|---|
TContract extends ContractDefinition |
ClientInferActivity
type ClientInferActivity<TActivity> = (args) => Promise<ClientInferOutput<TActivity>>;Defined in: packages/client/src/types.ts:46
Infer activity function signature from client perspective Client sends z.output and receives z.input
Type Parameters
| Type Parameter |
|---|
TActivity extends ActivityDefinition |
Parameters
| Parameter | Type |
|---|---|
args | ClientInferInput<TActivity> |
Returns
Promise<ClientInferOutput<TActivity>>
ClientInferInput
type ClientInferInput<T> = StandardSchemaV1.InferInput<T["input"]>;Defined in: packages/client/src/types.ts:17
Infer input type from a definition (client perspective) Client sends the input type (before input schema parsing/transformation)
Type Parameters
| Type Parameter |
|---|
T extends object |
ClientInferOutput
type ClientInferOutput<T> = StandardSchemaV1.InferOutput<T["output"]>;Defined in: packages/client/src/types.ts:25
Infer output type from a definition (client perspective) Client receives the output type (after output schema parsing/transformation)
Type Parameters
| Type Parameter |
|---|
T extends object |
ClientInferQuery
type ClientInferQuery<TQuery> = (args) => ResultAsync<ClientInferOutput<TQuery>, Error>;Defined in: packages/client/src/types.ts:62
Infer query handler signature from client perspective Client sends z.output and receives z.input wrapped in ResultAsync<T, Error>
Type Parameters
| Type Parameter |
|---|
TQuery extends QueryDefinition |
Parameters
| Parameter | Type |
|---|---|
args | ClientInferInput<TQuery> |
Returns
ResultAsync<ClientInferOutput<TQuery>, Error>
ClientInferSignal
type ClientInferSignal<TSignal> = (args) => ResultAsync<void, Error>;Defined in: packages/client/src/types.ts:54
Infer signal handler signature from client perspective Client sends z.output and returns ResultAsync<void, Error>
Type Parameters
| Type Parameter |
|---|
TSignal extends SignalDefinition |
Parameters
| Parameter | Type |
|---|---|
args | ClientInferInput<TSignal> |
Returns
ResultAsync<void, Error>
ClientInferUpdate
type ClientInferUpdate<TUpdate> = (args) => ResultAsync<ClientInferOutput<TUpdate>, Error>;Defined in: packages/client/src/types.ts:70
Infer update handler signature from client perspective Client sends z.output and receives z.input wrapped in ResultAsync<T, Error>
Type Parameters
| Type Parameter |
|---|
TUpdate extends UpdateDefinition |
Parameters
| Parameter | Type |
|---|---|
args | ClientInferInput<TUpdate> |
Returns
ResultAsync<ClientInferOutput<TUpdate>, Error>
ClientInferWorkflow
type ClientInferWorkflow<TWorkflow> = (args) => Promise<ClientInferOutput<TWorkflow>>;Defined in: packages/client/src/types.ts:38
Infer workflow function signature from client perspective Client sends z.output and receives z.input
Type Parameters
| Type Parameter |
|---|
TWorkflow extends AnyWorkflowDefinition |
Parameters
| Parameter | Type |
|---|---|
args | ClientInferInput<TWorkflow> |
Returns
Promise<ClientInferOutput<TWorkflow>>
ClientInferWorkflowActivities
type ClientInferWorkflowActivities<T> = T["activities"] extends Record<string, ActivityDefinition> ? { [K in keyof T["activities"]]: ClientInferActivity<T["activities"][K]> } : object;Defined in: packages/client/src/types.ts:98
Infer activities from a workflow definition (client perspective)
Type Parameters
| Type Parameter |
|---|
T extends AnyWorkflowDefinition |
ClientInferWorkflowContextActivities
type ClientInferWorkflowContextActivities<TContract, TWorkflowName> = ClientInferWorkflowActivities<TContract["workflows"][TWorkflowName]> & ClientInferActivities<TContract>;Defined in: packages/client/src/types.ts:139
Infer all activities available in a workflow context (client perspective) Combines workflow-specific activities with global activities
Type Parameters
| Type Parameter |
|---|
TContract extends ContractDefinition |
TWorkflowName extends keyof TContract["workflows"] & string |
ClientInferWorkflowQueries
type ClientInferWorkflowQueries<T> = T["queries"] extends Record<string, QueryDefinition> ? { [K in keyof T["queries"]]: ClientInferQuery<T["queries"][K]> } : object;Defined in: packages/client/src/types.ts:118
Infer queries from a workflow definition (client perspective)
Type Parameters
| Type Parameter |
|---|
T extends AnyWorkflowDefinition |
ClientInferWorkflows
type ClientInferWorkflows<TContract> = { [K in keyof TContract["workflows"]]: ClientInferWorkflow<TContract["workflows"][K]> };Defined in: packages/client/src/types.ts:81
Infer all workflows from a contract (client perspective)
Type Parameters
| Type Parameter |
|---|
TContract extends ContractDefinition |
ClientInferWorkflowSignals
type ClientInferWorkflowSignals<T> = T["signals"] extends Record<string, SignalDefinition> ? { [K in keyof T["signals"]]: ClientInferSignal<T["signals"][K]> } : object;Defined in: packages/client/src/types.ts:108
Infer signals from a workflow definition (client perspective)
Type Parameters
| Type Parameter |
|---|
T extends AnyWorkflowDefinition |
ClientInferWorkflowUpdates
type ClientInferWorkflowUpdates<T> = T["updates"] extends Record<string, UpdateDefinition> ? { [K in keyof T["updates"]]: ClientInferUpdate<T["updates"][K]> } : object;Defined in: packages/client/src/types.ts:128
Infer updates from a workflow definition (client perspective)
Type Parameters
| Type Parameter |
|---|
T extends AnyWorkflowDefinition |
TemporalFailure
type TemporalFailure =
| ApplicationFailure
| CancelledFailure
| TerminatedFailure
| TimeoutFailure
| ChildWorkflowFailure
| ServerFailure
| ActivityFailure;Defined in: packages/client/src/errors.ts:23
Union of the actionable Temporal failure types that can surface as the cause of a WorkflowFailedError. These all extend Temporal's internal TemporalFailure base class — we list them by leaf type rather than by the base class so consumer code can use a single switch (true) over instanceof discriminants without an exhaustiveness escape hatch.
Re-exported from the package entry point so consumers can import it directly: import type { TemporalFailure } from "@temporal-contract/client".
TypedScheduleActionOverrides
type TypedScheduleActionOverrides = Pick<ScheduleOptionsStartWorkflowAction<never>,
| "workflowId"
| "workflowExecutionTimeout"
| "workflowRunTimeout"
| "workflowTaskTimeout"
| "retry"
| "memo"
| "staticDetails"
| "staticSummary">;Defined in: packages/client/src/schedule.ts:27
Workflow-action–level overrides forwarded to Temporal's ScheduleOptionsStartWorkflowAction. These live under a nested action field so the workflow-level memo (per-action workflow metadata) can be set independently from the schedule-level memo (metadata on the schedule itself) — Temporal honours both, and they have separate lifecycles.
workflowType and taskQueue are owned by the contract and not exposed.
TypedScheduleCreateOptions
type TypedScheduleCreateOptions<TContract, TWorkflowName> = object;Defined in: packages/client/src/schedule.ts:48
Options for TypedScheduleClient.create.
scheduleId and spec come from Temporal's ScheduleOptions. args is typed against the destination workflow's input schema. policies, state, and memo mirror Temporal's own schedule-level options. Workflow-action–level overrides nest under action so memo and other fields with the same name don't collide between the two scopes.
Type Parameters
| Type Parameter |
|---|
TContract extends ContractDefinition |
TWorkflowName extends keyof TContract["workflows"] & string |
Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
action? | TypedScheduleActionOverrides | Workflow-action–level overrides. workflowType and taskQueue are derived from the contract, so they don't appear here. Note that action.memo is a workflow-level memo applied to each spawned run, distinct from the top-level memo (which is metadata on the schedule itself). | packages/client/src/schedule.ts:80 |
args | ClientInferInput<TContract["workflows"][TWorkflowName]> | Workflow input — validated against the contract's input schema. | packages/client/src/schedule.ts:57 |
memo? | ScheduleOptions["memo"] | Schedule-level memo (non-indexed metadata on the schedule itself). | packages/client/src/schedule.ts:72 |
policies? | ScheduleOptions["policies"] | Temporal schedule policies (overlap, catchupWindow, pauseOnFailure, etc.). | packages/client/src/schedule.ts:68 |
scheduleId | string | Schedule ID. Recommended to use a meaningful business identifier. | packages/client/src/schedule.ts:53 |
searchAttributes? | TypedSearchAttributeMap<TContract["workflows"][TWorkflowName]> | Indexed search attributes for each workflow run spawned by this schedule. Keys and value types are constrained to those declared on the destination workflow's contract via defineSearchAttribute. Translated to Temporal's typedSearchAttributes and attached to the schedule's startWorkflow action so each spawned run is indexed identically to one started directly via client.startWorkflow. | packages/client/src/schedule.ts:66 |
spec | ScheduleSpec | When the schedule should fire (cron, interval, calendar). | packages/client/src/schedule.ts:55 |
state? | ScheduleOptions["state"] | Temporal schedule state (paused, note, limited, etc.). | packages/client/src/schedule.ts:70 |
TypedScheduleHandle
type TypedScheduleHandle = object;Defined in: packages/client/src/schedule.ts:89
Typed handle to a schedule. Mirrors Temporal's ScheduleHandle lifecycle methods (pause, unpause, trigger, describe, delete) wrapped in the neverthrow ResultAsync pattern so call sites match the rest of the typed client.
Properties
| Property | Modifier | Type | Description | Defined in |
|---|---|---|---|---|
delete | public | () => ResultAsync<void, RuntimeClientError> | Delete the schedule. | packages/client/src/schedule.ts:99 |
describe | public | () => ResultAsync<ScheduleDescription, RuntimeClientError> | Fetch the schedule's current description from the server. | packages/client/src/schedule.ts:101 |
pause | public | (note?) => ResultAsync<void, RuntimeClientError> | Pause the schedule. Optional note becomes part of the audit trail. | packages/client/src/schedule.ts:93 |
scheduleId | readonly | string | This schedule's identifier. | packages/client/src/schedule.ts:91 |
trigger | public | (overlap?) => ResultAsync<void, RuntimeClientError> | Fire the schedule's action immediately. | packages/client/src/schedule.ts:97 |
unpause | public | (note?) => ResultAsync<void, RuntimeClientError> | Resume a paused schedule. | packages/client/src/schedule.ts:95 |
TypedSearchAttributeMap
type TypedSearchAttributeMap<TWorkflow> = TWorkflow["searchAttributes"] extends Record<string, SearchAttributeDefinition> ? { [K in keyof TWorkflow["searchAttributes"]]?: SearchAttributeKindToType<TWorkflow["searchAttributes"][K]["kind"]> } : never;Defined in: packages/client/src/client.ts:56
Typed searchAttributes map for a workflow, derived from the workflow's declared searchAttributes. Each key is constrained to a declared attribute name; each value's type is determined by the attribute's kind (e.g. KEYWORD → string, INT → number, DATETIME → Date, KEYWORD_LIST → string[]).
If the workflow declares no search attributes, this resolves to never, meaning the searchAttributes field is effectively absent from the start options for that workflow.
Type Parameters
| Type Parameter |
|---|
TWorkflow extends AnyWorkflowDefinition |
TypedSignalWithStartOptions
type TypedSignalWithStartOptions<TContract, TWorkflowName, TSignalName> = Omit<WorkflowSignalWithStartOptions,
| "taskQueue"
| "args"
| "signal"
| "signalArgs"
| "searchAttributes"
| "typedSearchAttributes"> & object;Defined in: packages/client/src/client.ts:135
Options for TypedClient.signalWithStart — typed against both the workflow's input schema and the named signal's input schema.
Type Declaration
| Name | Type | Description | Defined in |
|---|---|---|---|
args | ClientInferInput<TContract["workflows"][TWorkflowName]> | - | packages/client/src/client.ts:143 |
searchAttributes? | TypedSearchAttributeMap<TContract["workflows"][TWorkflowName]> | Indexed search attributes for the started workflow. Keys and value types are constrained to those declared on the workflow's contract via defineSearchAttribute. Translated to Temporal's typedSearchAttributes before the signalWithStart request is dispatched. | packages/client/src/client.ts:154 |
signalArgs | TContract["workflows"][TWorkflowName]["signals"][TSignalName] extends SignalDefinition ? ClientInferInput<TContract["workflows"][TWorkflowName]["signals"][TSignalName]> : never | - | packages/client/src/client.ts:145 |
signalName | TSignalName | - | packages/client/src/client.ts:144 |
Type Parameters
| Type Parameter |
|---|
TContract extends ContractDefinition |
TWorkflowName extends keyof TContract["workflows"] & string |
TSignalName extends SignalNamesOf<TContract["workflows"][TWorkflowName]> |
TypedWorkflowHandle
type TypedWorkflowHandle<TWorkflow> = object;Defined in: packages/client/src/client.ts:175
Typed workflow handle with validated results using neverthrow Result/ResultAsync
Type Parameters
| Type Parameter |
|---|
TWorkflow extends AnyWorkflowDefinition |
Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
cancel | () => ResultAsync<void, | WorkflowExecutionNotFoundError | RuntimeClientError> | Cancel workflow with Result pattern | packages/client/src/client.ts:250 |
describe | () => ResultAsync<Awaited<ReturnType<WorkflowHandle["describe"]>>, | WorkflowExecutionNotFoundError | RuntimeClientError> | Get workflow execution description including status and metadata | packages/client/src/client.ts:255 |
fetchHistory | () => ResultAsync<Awaited<ReturnType<WorkflowHandle["fetchHistory"]>>, | WorkflowExecutionNotFoundError | RuntimeClientError> | Fetch the workflow execution history | packages/client/src/client.ts:263 |
queries | { [K in keyof ClientInferWorkflowQueries<TWorkflow>]: ClientInferWorkflowQueries<TWorkflow>[K] extends (args: infer Args) => ResultAsync<infer R, Error> ? (args: Args) => ResultAsync<R, QueryValidationError | WorkflowExecutionNotFoundError | RuntimeClientError> : never } | Type-safe queries based on workflow definition with Result pattern Each query returns ResultAsync<T, Error> instead of Promise<T> | packages/client/src/client.ts:182 |
result | () => ResultAsync<ClientInferOutput<TWorkflow>, | WorkflowValidationError | WorkflowFailedError | WorkflowExecutionNotFoundError | RuntimeClientError> | Get workflow result with Result pattern | packages/client/src/client.ts:232 |
signals | { [K in keyof ClientInferWorkflowSignals<TWorkflow>]: ClientInferWorkflowSignals<TWorkflow>[K] extends (args: infer Args) => ResultAsync<void, Error> ? (args: Args) => ResultAsync<void, SignalValidationError | WorkflowExecutionNotFoundError | RuntimeClientError> : never } | Type-safe signals based on workflow definition with Result pattern Each signal returns ResultAsync<void, Error> instead of Promise<void> | packages/client/src/client.ts:199 |
terminate | (reason?) => ResultAsync<void, | WorkflowExecutionNotFoundError | RuntimeClientError> | Terminate workflow with Result pattern | packages/client/src/client.ts:243 |
updates | { [K in keyof ClientInferWorkflowUpdates<TWorkflow>]: ClientInferWorkflowUpdates<TWorkflow>[K] extends (args: infer Args) => ResultAsync<infer R, Error> ? (args: Args) => ResultAsync<R, UpdateValidationError | WorkflowExecutionNotFoundError | RuntimeClientError> : never } | Type-safe updates based on workflow definition with Result pattern Each update returns ResultAsync<T, Error> instead of Promise<T> | packages/client/src/client.ts:216 |
workflowId | string | - | packages/client/src/client.ts:176 |
TypedWorkflowHandleWithSignaledRunId
type TypedWorkflowHandleWithSignaledRunId<TWorkflow> = TypedWorkflowHandle<TWorkflow> & object;Defined in: packages/client/src/client.ts:162
Typed workflow handle returned by signalWithStart. Adds signaledRunId to the standard handle so callers can correlate the signal with the (possibly pre-existing) workflow execution chain.
Type Declaration
| Name | Type | Description | Defined in |
|---|---|---|---|
signaledRunId | string | The Run Id of the bound Workflow at the time of signalWithStart. Since signalWithStart may have signaled an existing Workflow Chain, this is not necessarily the firstExecutionRunId. | packages/client/src/client.ts:169 |
Type Parameters
| Type Parameter |
|---|
TWorkflow extends AnyWorkflowDefinition |
TypedWorkflowStartOptions
type TypedWorkflowStartOptions<TContract, TWorkflowName> = Omit<WorkflowStartOptions, "taskQueue" | "args" | "searchAttributes" | "typedSearchAttributes"> & object;Defined in: packages/client/src/client.ts:114
Type Declaration
| Name | Type | Description | Defined in |
|---|---|---|---|
args | ClientInferInput<TContract["workflows"][TWorkflowName]> | - | packages/client/src/client.ts:121 |
searchAttributes? | TypedSearchAttributeMap<TContract["workflows"][TWorkflowName]> | Indexed search attributes for the started workflow. Keys and value types are constrained to those declared on the workflow's contract via defineSearchAttribute. Translated to Temporal's typedSearchAttributes before the start request is dispatched. | packages/client/src/client.ts:128 |
Type Parameters
| Type Parameter |
|---|
TContract extends ContractDefinition |
TWorkflowName extends keyof TContract["workflows"] & string |
Functions
readTypedSearchAttributes()
function readTypedSearchAttributes<TWorkflow>(workflowDef, instance): Partial<TypedSearchAttributeMap<TWorkflow>>;Defined in: packages/client/src/client.ts:94
Read declared search attributes off a TypedSearchAttributes instance — the read-side counterpart to the write-side searchAttributes option on startWorkflow / signalWithStart / executeWorkflow / schedule.create.
Use it on the result of handle.describe() (or a schedule's describe) to recover the typed shape of indexed attributes. The Temporal SDK only exposes a .get(key) accessor on TypedSearchAttributes and requires the caller to reconstruct each SearchAttributeKey from the contract's declared kind — this helper does that lookup once for every declared attribute, returning a Partial<TypedSearchAttributeMap<TWorkflow>> (each declared key may or may not have been set on the workflow).
Workflows without declared searchAttributes get an empty object back.
Type Parameters
| Type Parameter |
|---|
TWorkflow extends AnyWorkflowDefinition |
Parameters
| Parameter | Type |
|---|---|
workflowDef | TWorkflow |
instance | TypedSearchAttributes |
Returns
Partial<TypedSearchAttributeMap<TWorkflow>>
Example
const description = await handle.describe();
if (description.isOk()) {
const attrs = readTypedSearchAttributes(
myContract.workflows.processOrder,
description.value.typedSearchAttributes,
);
// attrs.customerId: string | undefined
// attrs.priority: number | undefined
}