Skip to content

@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
ts
new QueryValidationError(
   queryName, 
   direction, 
   issues): QueryValidationError;

Defined in: packages/client/src/errors.ts:174

Parameters
ParameterType
queryNamestring
direction"input" | "output"
issuesreadonly Issue[]
Returns

QueryValidationError

Overrides
ts
TypedClientError.constructor

Properties

PropertyModifierTypeDescriptionInherited fromDefined in
cause?publicunknown-TypedClientError.causenode_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2022.error.d.ts:24
directionreadonly"input" | "output"--packages/client/src/errors.ts:176
issuesreadonlyreadonly Issue[]--packages/client/src/errors.ts:177
messagepublicstring-TypedClientError.messagenode_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es5.d.ts:1075
namepublicstring-TypedClientError.namenode_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es5.d.ts:1074
queryNamereadonlystring--packages/client/src/errors.ts:175
stack?publicstring-TypedClientError.stacknode_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es5.d.ts:1076
stackTraceLimitstaticnumberThe 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.stackTraceLimitnode_modules/.pnpm/@types+node@24.12.2/node_modules/@types/node/globals.d.ts:68

Methods

captureStackTrace()
ts
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.

js
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:

js
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
ParameterType
targetObjectobject
constructorOpt?Function
Returns

void

Inherited from
ts
TypedClientError.captureStackTrace
prepareStackTrace()
ts
static prepareStackTrace(err, stackTraces): any;

Defined in: node_modules/.pnpm/@types+node@24.12.2/node_modules/@types/node/globals.d.ts:56

Parameters
ParameterType
errError
stackTracesCallSite[]
Returns

any

See

https://v8.dev/docs/stack-trace-api#customizing-stack-traces

Inherited from
ts
TypedClientError.prepareStackTrace

RuntimeClientError

Defined in: packages/client/src/errors.ts:48

Generic runtime failure wrapper when no specific error type applies

Extends

  • TypedClientError

Constructors

Constructor
ts
new RuntimeClientError(operation, cause?): RuntimeClientError;

Defined in: packages/client/src/errors.ts:49

Parameters
ParameterType
operationstring
cause?unknown
Returns

RuntimeClientError

Overrides
ts
TypedClientError.constructor

Properties

PropertyModifierTypeDescriptionInherited fromDefined in
cause?readonlyunknown-TypedClientError.causepackages/client/src/errors.ts:51
messagepublicstring-TypedClientError.messagenode_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es5.d.ts:1075
namepublicstring-TypedClientError.namenode_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es5.d.ts:1074
operationreadonlystring--packages/client/src/errors.ts:50
stack?publicstring-TypedClientError.stacknode_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es5.d.ts:1076
stackTraceLimitstaticnumberThe 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.stackTraceLimitnode_modules/.pnpm/@types+node@24.12.2/node_modules/@types/node/globals.d.ts:68

Methods

captureStackTrace()
ts
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.

js
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:

js
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
ParameterType
targetObjectobject
constructorOpt?Function
Returns

void

Inherited from
ts
TypedClientError.captureStackTrace
prepareStackTrace()
ts
static prepareStackTrace(err, stackTraces): any;

Defined in: node_modules/.pnpm/@types+node@24.12.2/node_modules/@types/node/globals.d.ts:56

Parameters
ParameterType
errError
stackTracesCallSite[]
Returns

any

See

https://v8.dev/docs/stack-trace-api#customizing-stack-traces

Inherited from
ts
TypedClientError.prepareStackTrace

SignalValidationError

Defined in: packages/client/src/errors.ts:186

Thrown when signal input validation fails

Extends

  • TypedClientError

Constructors

Constructor
ts
new SignalValidationError(signalName, issues): SignalValidationError;

Defined in: packages/client/src/errors.ts:187

Parameters
ParameterType
signalNamestring
issuesreadonly Issue[]
Returns

SignalValidationError

Overrides
ts
TypedClientError.constructor

Properties

PropertyModifierTypeDescriptionInherited fromDefined in
cause?publicunknown-TypedClientError.causenode_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2022.error.d.ts:24
issuesreadonlyreadonly Issue[]--packages/client/src/errors.ts:189
messagepublicstring-TypedClientError.messagenode_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es5.d.ts:1075
namepublicstring-TypedClientError.namenode_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es5.d.ts:1074
signalNamereadonlystring--packages/client/src/errors.ts:188
stack?publicstring-TypedClientError.stacknode_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es5.d.ts:1076
stackTraceLimitstaticnumberThe 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.stackTraceLimitnode_modules/.pnpm/@types+node@24.12.2/node_modules/@types/node/globals.d.ts:68

Methods

captureStackTrace()
ts
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.

js
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:

js
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
ParameterType
targetObjectobject
constructorOpt?Function
Returns

void

Inherited from
ts
TypedClientError.captureStackTrace
prepareStackTrace()
ts
static prepareStackTrace(err, stackTraces): any;

Defined in: node_modules/.pnpm/@types+node@24.12.2/node_modules/@types/node/globals.d.ts:56

Parameters
ParameterType
errError
stackTracesCallSite[]
Returns

any

See

https://v8.dev/docs/stack-trace-api#customizing-stack-traces

Inherited from
ts
TypedClientError.prepareStackTrace

TypedClient

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

PropertyModifierTypeDescriptionDefined in
schedulereadonlyTypedScheduleClient<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()
ts
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
ParameterType
workflowNameTWorkflowName
__namedParametersTypedWorkflowStartOptions<TContract, TWorkflowName>
Returns

ResultAsync<ClientInferOutput<TContract["workflows"][TWorkflowName]>, | WorkflowNotFoundError | WorkflowValidationError | WorkflowAlreadyStartedError | RuntimeClientError | WorkflowFailedError | WorkflowExecutionNotFoundError>

Example
ts
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()
ts
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
ParameterType
workflowNameTWorkflowName
workflowIdstring
Returns

ResultAsync<TypedWorkflowHandle<TContract["workflows"][TWorkflowName]>, | WorkflowNotFoundError | RuntimeClientError>

Example
ts
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()
ts
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:

  • args against the workflow's input schema
  • signalArgs against 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
ParameterType
workflowNameTWorkflowName
__namedParametersTypedSignalWithStartOptions<TContract, TWorkflowName, TSignalName>
Returns

ResultAsync<TypedWorkflowHandleWithSignaledRunId<TContract["workflows"][TWorkflowName]>, | WorkflowNotFoundError | WorkflowValidationError | WorkflowAlreadyStartedError | RuntimeClientError | SignalValidationError>

Example
ts
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()
ts
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
ParameterType
workflowNameTWorkflowName
__namedParametersTypedWorkflowStartOptions<TContract, TWorkflowName>
Returns

ResultAsync<TypedWorkflowHandle<TContract["workflows"][TWorkflowName]>, | WorkflowNotFoundError | WorkflowValidationError | WorkflowAlreadyStartedError | RuntimeClientError>

Example
ts
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()
ts
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
ParameterType
contractTContract
clientClient
Returns

TypedClient<TContract>

Example
ts
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
ts
new TypedScheduleClient<TContract>(contract, scheduleClient): TypedScheduleClient<TContract>;

Defined in: packages/client/src/schedule.ts:110

Parameters
ParameterType
contractTContract
scheduleClientScheduleClient
Returns

TypedScheduleClient<TContract>

Methods

create()
ts
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
ParameterType
workflowNameTWorkflowName
optionsTypedScheduleCreateOptions<TContract, TWorkflowName>
Returns

ResultAsync<TypedScheduleHandle, | WorkflowNotFoundError | WorkflowValidationError | RuntimeClientError>

getHandle()
ts
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
ParameterType
scheduleIdstring
Returns

TypedScheduleHandle


UpdateValidationError

Defined in: packages/client/src/errors.ts:198

Thrown when update input or output validation fails

Extends

  • TypedClientError

Constructors

Constructor
ts
new UpdateValidationError(
   updateName, 
   direction, 
   issues): UpdateValidationError;

Defined in: packages/client/src/errors.ts:199

Parameters
ParameterType
updateNamestring
direction"input" | "output"
issuesreadonly Issue[]
Returns

UpdateValidationError

Overrides
ts
TypedClientError.constructor

Properties

PropertyModifierTypeDescriptionInherited fromDefined in
cause?publicunknown-TypedClientError.causenode_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2022.error.d.ts:24
directionreadonly"input" | "output"--packages/client/src/errors.ts:201
issuesreadonlyreadonly Issue[]--packages/client/src/errors.ts:202
messagepublicstring-TypedClientError.messagenode_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es5.d.ts:1075
namepublicstring-TypedClientError.namenode_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es5.d.ts:1074
stack?publicstring-TypedClientError.stacknode_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es5.d.ts:1076
updateNamereadonlystring--packages/client/src/errors.ts:200
stackTraceLimitstaticnumberThe 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.stackTraceLimitnode_modules/.pnpm/@types+node@24.12.2/node_modules/@types/node/globals.d.ts:68

Methods

captureStackTrace()
ts
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.

js
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:

js
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
ParameterType
targetObjectobject
constructorOpt?Function
Returns

void

Inherited from
ts
TypedClientError.captureStackTrace
prepareStackTrace()
ts
static prepareStackTrace(err, stackTraces): any;

Defined in: node_modules/.pnpm/@types+node@24.12.2/node_modules/@types/node/globals.d.ts:56

Parameters
ParameterType
errError
stackTracesCallSite[]
Returns

any

See

https://v8.dev/docs/stack-trace-api#customizing-stack-traces

Inherited from
ts
TypedClientError.prepareStackTrace

WorkflowAlreadyStartedError

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
ts
new WorkflowAlreadyStartedError(
   workflowType, 
   workflowId, 
   cause?): WorkflowAlreadyStartedError;

Defined in: packages/client/src/errors.ts:87

Parameters
ParameterType
workflowTypestring
workflowIdstring
cause?unknown
Returns

WorkflowAlreadyStartedError

Overrides
ts
TypedClientError.constructor

Properties

PropertyModifierTypeDescriptionInherited fromDefined in
cause?readonlyunknown-TypedClientError.causepackages/client/src/errors.ts:90
messagepublicstring-TypedClientError.messagenode_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es5.d.ts:1075
namepublicstring-TypedClientError.namenode_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es5.d.ts:1074
stack?publicstring-TypedClientError.stacknode_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es5.d.ts:1076
workflowIdreadonlystring--packages/client/src/errors.ts:89
workflowTypereadonlystring--packages/client/src/errors.ts:88
stackTraceLimitstaticnumberThe 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.stackTraceLimitnode_modules/.pnpm/@types+node@24.12.2/node_modules/@types/node/globals.d.ts:68

Methods

captureStackTrace()
ts
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.

js
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:

js
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
ParameterType
targetObjectobject
constructorOpt?Function
Returns

void

Inherited from
ts
TypedClientError.captureStackTrace
prepareStackTrace()
ts
static prepareStackTrace(err, stackTraces): any;

Defined in: node_modules/.pnpm/@types+node@24.12.2/node_modules/@types/node/globals.d.ts:56

Parameters
ParameterType
errError
stackTracesCallSite[]
Returns

any

See

https://v8.dev/docs/stack-trace-api#customizing-stack-traces

Inherited from
ts
TypedClientError.prepareStackTrace

WorkflowExecutionNotFoundError

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
ts
new WorkflowExecutionNotFoundError(
   workflowId, 
   runId?, 
   cause?): WorkflowExecutionNotFoundError;

Defined in: packages/client/src/errors.ts:109

Parameters
ParameterType
workflowIdstring
runId?string
cause?unknown
Returns

WorkflowExecutionNotFoundError

Overrides
ts
TypedClientError.constructor

Properties

PropertyModifierTypeDescriptionInherited fromDefined in
cause?readonlyunknown-TypedClientError.causepackages/client/src/errors.ts:112
messagepublicstring-TypedClientError.messagenode_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es5.d.ts:1075
namepublicstring-TypedClientError.namenode_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es5.d.ts:1074
runId?readonlystring--packages/client/src/errors.ts:111
stack?publicstring-TypedClientError.stacknode_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es5.d.ts:1076
workflowIdreadonlystring--packages/client/src/errors.ts:110
stackTraceLimitstaticnumberThe 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.stackTraceLimitnode_modules/.pnpm/@types+node@24.12.2/node_modules/@types/node/globals.d.ts:68

Methods

captureStackTrace()
ts
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.

js
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:

js
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
ParameterType
targetObjectobject
constructorOpt?Function
Returns

void

Inherited from
ts
TypedClientError.captureStackTrace
prepareStackTrace()
ts
static prepareStackTrace(err, stackTraces): any;

Defined in: node_modules/.pnpm/@types+node@24.12.2/node_modules/@types/node/globals.d.ts:56

Parameters
ParameterType
errError
stackTracesCallSite[]
Returns

any

See

https://v8.dev/docs/stack-trace-api#customizing-stack-traces

Inherited from
ts
TypedClientError.prepareStackTrace

WorkflowFailedError

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
ts
new WorkflowFailedError(workflowId, cause?): WorkflowFailedError;

Defined in: packages/client/src/errors.ts:140

Parameters
ParameterType
workflowIdstring
cause?TemporalFailure
Returns

WorkflowFailedError

Overrides
ts
TypedClientError.constructor

Properties

PropertyModifierTypeDescriptionInherited fromDefined in
cause?readonlyTemporalFailure-TypedClientError.causepackages/client/src/errors.ts:142
messagepublicstring-TypedClientError.messagenode_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es5.d.ts:1075
namepublicstring-TypedClientError.namenode_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es5.d.ts:1074
stack?publicstring-TypedClientError.stacknode_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es5.d.ts:1076
workflowIdreadonlystring--packages/client/src/errors.ts:141
stackTraceLimitstaticnumberThe 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.stackTraceLimitnode_modules/.pnpm/@types+node@24.12.2/node_modules/@types/node/globals.d.ts:68

Methods

captureStackTrace()
ts
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.

js
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:

js
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
ParameterType
targetObjectobject
constructorOpt?Function
Returns

void

Inherited from
ts
TypedClientError.captureStackTrace
prepareStackTrace()
ts
static prepareStackTrace(err, stackTraces): any;

Defined in: node_modules/.pnpm/@types+node@24.12.2/node_modules/@types/node/globals.d.ts:56

Parameters
ParameterType
errError
stackTracesCallSite[]
Returns

any

See

https://v8.dev/docs/stack-trace-api#customizing-stack-traces

Inherited from
ts
TypedClientError.prepareStackTrace

WorkflowNotFoundError

Defined in: packages/client/src/errors.ts:64

Thrown when a workflow is not found in the contract

Extends

  • TypedClientError

Constructors

Constructor
ts
new WorkflowNotFoundError(workflowName, availableWorkflows): WorkflowNotFoundError;

Defined in: packages/client/src/errors.ts:65

Parameters
ParameterType
workflowNamestring
availableWorkflowsstring[]
Returns

WorkflowNotFoundError

Overrides
ts
TypedClientError.constructor

Properties

PropertyModifierTypeDescriptionInherited fromDefined in
availableWorkflowsreadonlystring[]--packages/client/src/errors.ts:67
cause?publicunknown-TypedClientError.causenode_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2022.error.d.ts:24
messagepublicstring-TypedClientError.messagenode_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es5.d.ts:1075
namepublicstring-TypedClientError.namenode_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es5.d.ts:1074
stack?publicstring-TypedClientError.stacknode_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es5.d.ts:1076
workflowNamereadonlystring--packages/client/src/errors.ts:66
stackTraceLimitstaticnumberThe 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.stackTraceLimitnode_modules/.pnpm/@types+node@24.12.2/node_modules/@types/node/globals.d.ts:68

Methods

captureStackTrace()
ts
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.

js
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:

js
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
ParameterType
targetObjectobject
constructorOpt?Function
Returns

void

Inherited from
ts
TypedClientError.captureStackTrace
prepareStackTrace()
ts
static prepareStackTrace(err, stackTraces): any;

Defined in: node_modules/.pnpm/@types+node@24.12.2/node_modules/@types/node/globals.d.ts:56

Parameters
ParameterType
errError
stackTracesCallSite[]
Returns

any

See

https://v8.dev/docs/stack-trace-api#customizing-stack-traces

Inherited from
ts
TypedClientError.prepareStackTrace

WorkflowValidationError

Defined in: packages/client/src/errors.ts:158

Thrown when workflow input or output validation fails

Extends

  • TypedClientError

Constructors

Constructor
ts
new WorkflowValidationError(
   workflowName, 
   direction, 
   issues): WorkflowValidationError;

Defined in: packages/client/src/errors.ts:159

Parameters
ParameterType
workflowNamestring
direction"input" | "output"
issuesreadonly Issue[]
Returns

WorkflowValidationError

Overrides
ts
TypedClientError.constructor

Properties

PropertyModifierTypeDescriptionInherited fromDefined in
cause?publicunknown-TypedClientError.causenode_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2022.error.d.ts:24
directionreadonly"input" | "output"--packages/client/src/errors.ts:161
issuesreadonlyreadonly Issue[]--packages/client/src/errors.ts:162
messagepublicstring-TypedClientError.messagenode_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es5.d.ts:1075
namepublicstring-TypedClientError.namenode_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es5.d.ts:1074
stack?publicstring-TypedClientError.stacknode_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es5.d.ts:1076
workflowNamereadonlystring--packages/client/src/errors.ts:160
stackTraceLimitstaticnumberThe 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.stackTraceLimitnode_modules/.pnpm/@types+node@24.12.2/node_modules/@types/node/globals.d.ts:68

Methods

captureStackTrace()
ts
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.

js
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:

js
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
ParameterType
targetObjectobject
constructorOpt?Function
Returns

void

Inherited from
ts
TypedClientError.captureStackTrace
prepareStackTrace()
ts
static prepareStackTrace(err, stackTraces): any;

Defined in: node_modules/.pnpm/@types+node@24.12.2/node_modules/@types/node/globals.d.ts:56

Parameters
ParameterType
errError
stackTracesCallSite[]
Returns

any

See

https://v8.dev/docs/stack-trace-api#customizing-stack-traces

Inherited from
ts
TypedClientError.prepareStackTrace

Type Aliases

ClientInferActivities

ts
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

ts
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

ParameterType
argsClientInferInput<TActivity>

Returns

Promise<ClientInferOutput<TActivity>>


ClientInferInput

ts
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

ts
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

ts
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

ParameterType
argsClientInferInput<TQuery>

Returns

ResultAsync<ClientInferOutput<TQuery>, Error>


ClientInferSignal

ts
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

ParameterType
argsClientInferInput<TSignal>

Returns

ResultAsync<void, Error>


ClientInferUpdate

ts
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

ParameterType
argsClientInferInput<TUpdate>

Returns

ResultAsync<ClientInferOutput<TUpdate>, Error>


ClientInferWorkflow

ts
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

ParameterType
argsClientInferInput<TWorkflow>

Returns

Promise<ClientInferOutput<TWorkflow>>


ClientInferWorkflowActivities

ts
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

ts
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

ts
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

ts
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

ts
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

ts
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

ts
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

ts
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

ts
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

PropertyTypeDescriptionDefined in
action?TypedScheduleActionOverridesWorkflow-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
argsClientInferInput<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
scheduleIdstringSchedule 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
specScheduleSpecWhen 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

ts
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

PropertyModifierTypeDescriptionDefined in
deletepublic() => ResultAsync<void, RuntimeClientError>Delete the schedule.packages/client/src/schedule.ts:99
describepublic() => ResultAsync<ScheduleDescription, RuntimeClientError>Fetch the schedule's current description from the server.packages/client/src/schedule.ts:101
pausepublic(note?) => ResultAsync<void, RuntimeClientError>Pause the schedule. Optional note becomes part of the audit trail.packages/client/src/schedule.ts:93
scheduleIdreadonlystringThis schedule's identifier.packages/client/src/schedule.ts:91
triggerpublic(overlap?) => ResultAsync<void, RuntimeClientError>Fire the schedule's action immediately.packages/client/src/schedule.ts:97
unpausepublic(note?) => ResultAsync<void, RuntimeClientError>Resume a paused schedule.packages/client/src/schedule.ts:95

TypedSearchAttributeMap

ts
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. KEYWORDstring, INTnumber, DATETIMEDate, KEYWORD_LISTstring[]).

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

ts
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

NameTypeDescriptionDefined in
argsClientInferInput<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
signalArgsTContract["workflows"][TWorkflowName]["signals"][TSignalName] extends SignalDefinition ? ClientInferInput<TContract["workflows"][TWorkflowName]["signals"][TSignalName]> : never-packages/client/src/client.ts:145
signalNameTSignalName-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

ts
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

PropertyTypeDescriptionDefined in
cancel() => ResultAsync<void, | WorkflowExecutionNotFoundError | RuntimeClientError>Cancel workflow with Result patternpackages/client/src/client.ts:250
describe() => ResultAsync<Awaited<ReturnType<WorkflowHandle["describe"]>>, | WorkflowExecutionNotFoundError | RuntimeClientError>Get workflow execution description including status and metadatapackages/client/src/client.ts:255
fetchHistory() => ResultAsync<Awaited<ReturnType<WorkflowHandle["fetchHistory"]>>, | WorkflowExecutionNotFoundError | RuntimeClientError>Fetch the workflow execution historypackages/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 patternpackages/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 patternpackages/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
workflowIdstring-packages/client/src/client.ts:176

TypedWorkflowHandleWithSignaledRunId

ts
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

NameTypeDescriptionDefined in
signaledRunIdstringThe 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

ts
type TypedWorkflowStartOptions<TContract, TWorkflowName> = Omit<WorkflowStartOptions, "taskQueue" | "args" | "searchAttributes" | "typedSearchAttributes"> & object;

Defined in: packages/client/src/client.ts:114

Type Declaration

NameTypeDescriptionDefined in
argsClientInferInput<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()

ts
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

ParameterType
workflowDefTWorkflow
instanceTypedSearchAttributes

Returns

Partial<TypedSearchAttributeMap<TWorkflow>>

Example

ts
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
}

Released under the MIT License.