Skip to content

@temporal-contract/client


@temporal-contract/client ​

Classes ​

ContractClient ​

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

Contract-scoped typed Temporal client with unthrown Result/AsyncResult pattern.

Provides type-safe methods to start and execute workflows defined in the bound contract, with explicit error handling using the Result pattern. Obtained from TypedClient.for — the connection-scoped root — and inherits its underlying Client. Not constructible directly: the class is exported for type annotations only.

Type Parameters ​

Type Parameter
TContract extends ContractDefinition

Properties ​

PropertyModifierTypeDescriptionDefined in
contractreadonlyTContractThe contract this client is bound to — handy for logging, metrics labels, and plumbing the same contract into workers/tests without threading a second reference around.packages/client/src/client.ts:753
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; TypedClient.create fails fast (a defect with a clear message) when the underlying Client predates it. Example import { P } from "unthrown"; const result = await contractClient.schedule.create("processOrder", { scheduleId: "daily-sweep", spec: { cronExpressions: ["0 2 * * *"] }, args: { orderId: "sweep" }, }); await result.match({ ok: async (handle) => { await handle.pause("maintenance"); }, errCases: (matcher) => matcher.with( P.tag("@temporal-contract/WorkflowNotInContractError"), P.tag("@temporal-contract/WorkflowValidationError"), P.tag("@temporal-contract/ScheduleAlreadyExistsError"), (error) => console.error("schedule create failed", error), ), defect: (cause) => console.error("unexpected failure", cause), });packages/client/src/client.ts:787

Accessors ​

taskQueue ​
Get Signature ​
ts
get taskQueue(): TContract["taskQueue"];

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

The task queue this client dispatches to — the bound contract's taskQueue. Exposed for logging/observability so callers don't need to reach through contract.

Returns ​

TContract["taskQueue"]

Methods ​

executeWorkflow() ​
ts
executeWorkflow<TWorkflowName>(workflowName, options): AsyncResult<ClientInferOutput<TContract["workflows"][TWorkflowName]>, 
  | WorkflowNotInContractError
  | WorkflowAlreadyStartedError
  | WorkflowResultErrorsOf<TContract["workflows"][TWorkflowName]>>;

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

Execute a workflow (start and wait for result) with AsyncResult pattern.

Beside the start-phase errors, the result phase surfaces the workflow's declared contract errors and the first-class outcome errors (WorkflowCancelledError / WorkflowTerminatedError / WorkflowTimeoutError) — see TypedWorkflowHandle.result for the cancellation-handling caveat.

Type Parameters ​
Type Parameter
TWorkflowName extends string
Parameters ​
ParameterType
workflowNameTWorkflowName
optionsTypedWorkflowStartOptions<TContract, TWorkflowName>
Returns ​

AsyncResult<ClientInferOutput<TContract["workflows"][TWorkflowName]>, | WorkflowNotInContractError | WorkflowAlreadyStartedError | WorkflowResultErrorsOf<TContract["workflows"][TWorkflowName]>>

Example ​
ts
import {
  WORKFLOW_FAILED_ERROR_TAG,
  WORKFLOW_VALIDATION_ERROR_TAG,
} from "@temporal-contract/client";
import { P } from "unthrown";

const result = await contractClient.executeWorkflow('processOrder', {
  workflowId: 'order-123',
  args: { orderId: 'ORD-123' },
  workflowExecutionTimeout: '1 day',
  retry: { maximumAttempts: 3 },
});

await result.match({
  ok: (output) => console.log('Order processed:', output.status),
  errCases: (matcher) =>
    matcher
      .with(P.tag('@temporal-contract/ContractError'), (error) =>
        console.error('Domain failure:', error.errorName),
      )
      .with(
        P.tag(WORKFLOW_VALIDATION_ERROR_TAG),
        P.tag(WORKFLOW_FAILED_ERROR_TAG),
        // ...one P.tag per remaining member of the union
        (error) => console.error('Processing failed:', error),
      ),
  defect: (cause) => console.error('Unexpected failure:', cause),
});
getHandle() ​
ts
getHandle<TWorkflowName>(
   workflowName, 
   workflowId, 
   options?
): Result<TypedWorkflowHandle<TContract["workflows"][TWorkflowName]>, WorkflowNotInContractError>;

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

Get a typed handle to an existing workflow execution.

Synchronous — the only failure mode is a workflow name missing from the contract, surfaced as a sync Result Err. Whether the execution exists is a server-side question answered lazily by the handle's methods (as WorkflowExecutionNotFoundError).

Accepts an optional runId (bind to a specific execution) and Temporal's GetWorkflowHandleOptions passthrough — in particular firstExecutionRunId, the chain interlock ensuring mutating handle methods (terminate, cancel) don't affect executions from another chain reusing the workflow ID.

Type Parameters ​
Type Parameter
TWorkflowName extends string
Parameters ​
ParameterType
workflowNameTWorkflowName
workflowIdstring
options?TypedGetHandleOptions
Returns ​

Result<TypedWorkflowHandle<TContract["workflows"][TWorkflowName]>, WorkflowNotInContractError>

Example ​
ts
const handleResult = contractClient.getHandle('processOrder', 'order-123');
if (!handleResult.isOk()) {
  console.error('Unknown workflow:', handleResult.isErr() ? handleResult.error : handleResult.cause);
  return;
}
const result = await handleResult.value.result();
signalWithStart() ​
ts
signalWithStart<TWorkflowName, TSignalName>(workflowName, options): AsyncResult<TypedWorkflowHandleWithSignaledRunId<TContract["workflows"][TWorkflowName]>, 
  | WorkflowNotInContractError
  | WorkflowValidationError
  | WorkflowAlreadyStartedError
  | SignalValidationError>;

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

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 input schema of the signal named by the options bag's signalName field

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
optionsTypedSignalWithStartOptions<TContract, TWorkflowName, TSignalName>
Returns ​

AsyncResult<TypedWorkflowHandleWithSignaledRunId<TContract["workflows"][TWorkflowName]>, | WorkflowNotInContractError | WorkflowValidationError | WorkflowAlreadyStartedError | SignalValidationError>

Example ​
ts
import {
  SIGNAL_VALIDATION_ERROR_TAG,
  WORKFLOW_ALREADY_STARTED_ERROR_TAG,
  WORKFLOW_NOT_IN_CONTRACT_ERROR_TAG,
  WORKFLOW_VALIDATION_ERROR_TAG,
} from "@temporal-contract/client";
import { P } from "unthrown";

const result = await contractClient.signalWithStart('processOrder', {
  workflowId: 'order-123',
  args: { orderId: 'ORD-123', customerId: 'CUST-1' },
  signalName: 'cancel',
  signalArgs: { reason: 'duplicate' },
});

await result.match({
  ok: (handle) => console.log('signaled run', handle.signaledRunId),
  errCases: (matcher) =>
    matcher
      .with(P.tag(SIGNAL_VALIDATION_ERROR_TAG), (error) =>
        console.error('signal payload rejected', error),
      )
      .with(
        P.tag(WORKFLOW_NOT_IN_CONTRACT_ERROR_TAG),
        P.tag(WORKFLOW_VALIDATION_ERROR_TAG),
        P.tag(WORKFLOW_ALREADY_STARTED_ERROR_TAG),
        (error) => console.error('signalWithStart failed', error),
      ),
  defect: (cause) => console.error('unexpected failure', cause),
});
startWorkflow() ​
ts
startWorkflow<TWorkflowName>(workflowName, options): AsyncResult<TypedWorkflowHandle<TContract["workflows"][TWorkflowName]>, 
  | WorkflowNotInContractError
  | WorkflowValidationError
  | WorkflowAlreadyStartedError>;

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

Start a workflow and return a typed handle with AsyncResult pattern

Type Parameters ​
Type Parameter
TWorkflowName extends string
Parameters ​
ParameterType
workflowNameTWorkflowName
optionsTypedWorkflowStartOptions<TContract, TWorkflowName>
Returns ​

AsyncResult<TypedWorkflowHandle<TContract["workflows"][TWorkflowName]>, | WorkflowNotInContractError | WorkflowValidationError | WorkflowAlreadyStartedError>

Example ​
ts
import {
  WORKFLOW_ALREADY_STARTED_ERROR_TAG,
  WORKFLOW_NOT_IN_CONTRACT_ERROR_TAG,
  WORKFLOW_VALIDATION_ERROR_TAG,
} from "@temporal-contract/client";
import { P } from "unthrown";

const handleResult = await contractClient.startWorkflow('processOrder', {
  workflowId: 'order-123',
  args: { orderId: 'ORD-123' },
  workflowExecutionTimeout: '1 day',
  retry: { maximumAttempts: 3 },
});

await handleResult.match({
  ok: async (handle) => {
    const result = await handle.result();
    // ... handle result
  },
  errCases: (matcher) =>
    matcher.with(
      P.tag(WORKFLOW_NOT_IN_CONTRACT_ERROR_TAG),
      P.tag(WORKFLOW_VALIDATION_ERROR_TAG),
      P.tag(WORKFLOW_ALREADY_STARTED_ERROR_TAG),
      (error) => console.error('Failed to start:', error),
    ),
  defect: (cause) => console.error('Unexpected failure:', cause),
});

ContractError ​

Defined in: packages/contract/dist/errors-impl-BxWuCbUU.d.mts:45

A typed domain error declared on a contract's errors map.

One class covers every declared error; the errorName field is the per-error discriminant (it equals the key in the contract's errors map and the ApplicationFailure.type on the wire). Narrow a union with it:

ts
if (result.isErr() && result.error instanceof ContractError) {
  switch (result.error.errorName) {
    case "PaymentDeclined":
      result.error.data; // { reason: string }
  }
}

The unthrown _tag ("@temporal-contract/ContractError") discriminates a ContractError from the other tagged errors in a Result's error channel (e.g. via result.match({ errCases: (m) => m.with(P.tag("@temporal-contract/ContractError"), …) })); errorName then narrows to the concrete declared error.

Extends ​

  • ContractError_base<{ cause?: unknown; data: TData; errorName: TName; }>

Type Parameters ​

Type ParameterDefault type
TName extends stringstring
TDataunknown

Constructors ​

Constructor ​
ts
new ContractError<TName, TData>(args): ContractError<TName, TData>;

Defined in: packages/contract/dist/errors-impl-BxWuCbUU.d.mts:52

Parameters ​
ParameterType
args{ cause?: unknown; data: TData; errorName: TName; message: string; }
args.cause?unknown
args.dataTData
args.errorNameTName
args.messagestring
Returns ​

ContractError<TName, TData>

Overrides ​
ts
ContractError_base<{
  / Declared error name — the ApplicationFailure.type discriminator. /
  errorName: TName;
  / Structured payload validated against the declared data schema. /
  data: TData;
  cause?: unknown;
}>.constructor

Properties ​

PropertyModifierTypeDescriptionInherited fromDefined in
_tagreadonly"@temporal-contract/ContractError"-ContractError_base._tagnode_modules/.pnpm/unthrown@5.7.0/node_modules/unthrown/dist/index.d.mts:2011
cause?publicunknown-QueryValidationError.causenode_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2022.error.d.ts:24
datareadonlyTDataStructured payload validated against the declared data schema.ContractError_base.datapackages/contract/dist/errors-impl-BxWuCbUU.d.mts:49
errorNamereadonlyTNameDeclared error name — the ApplicationFailure.type discriminator.ContractError_base.errorNamepackages/contract/dist/errors-impl-BxWuCbUU.d.mts:47
messagepublicstring-ContractError_base.messagenode_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es5.d.ts:1075
namepublicstring-ContractError_base.namenode_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es5.d.ts:1074
stack?publicstring-ContractError_base.stacknode_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es5.d.ts:1076

QueryFailedError ​

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

Surfaced on the Err channel when the server could not serve a query — either no handler is registered under the query name on the (possibly older) workflow execution, or the query handler itself threw. Temporal reports both through the same channel (QueryNotRegisteredError, an INVALID_ARGUMENT gRPC failure whose message carries the underlying reason), so they are classified into this single modeled error; cause keeps Temporal's original error for inspection.

A routine operational outcome — a stale execution predating the handler, a handler bug — not a technical fault, so it rides the Err channel instead of the defect channel.

Returned from the typed handle's queries.* proxies.

Extends ​

  • TaggedErrorInstance<"@temporal-contract/QueryFailedError", { cause?: unknown; queryName: string; }>

Constructors ​

Constructor ​
ts
new QueryFailedError(queryName, cause?): QueryFailedError;

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

Parameters ​
ParameterType
queryNamestring
cause?unknown
Returns ​

QueryFailedError

Overrides ​
ts
TaggedError(QUERY_FAILED_ERROR_TAG, {
  name: "QueryFailedError",
})<{
  queryName: string;
  cause?: unknown;
}>.constructor

Properties ​

PropertyModifierTypeInherited fromDefined in
_tagreadonly"@temporal-contract/QueryFailedError"TaggedError(QUERY_FAILED_ERROR_TAG, { name: "QueryFailedError", })._tagnode_modules/.pnpm/unthrown@5.7.0/node_modules/unthrown/dist/index.d.mts:2011
cause?publicunknownQueryValidationError.causenode_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2022.error.d.ts:24
messagepublicstringTaggedError(QUERY_FAILED_ERROR_TAG, { name: "QueryFailedError", }).messagenode_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es5.d.ts:1075
namepublicstringTaggedError(QUERY_FAILED_ERROR_TAG, { name: "QueryFailedError", }).namenode_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es5.d.ts:1074
queryNamereadonlystringTaggedError(QUERY_FAILED_ERROR_TAG, { name: "QueryFailedError", }).queryNamepackages/client/src/errors.ts:321
stack?publicstringTaggedError(QUERY_FAILED_ERROR_TAG, { name: "QueryFailedError", }).stacknode_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es5.d.ts:1076

QueryValidationError ​

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

Surfaced on the Err channel when query input or output validation fails

Extends ​

  • TaggedErrorInstance<"@temporal-contract/QueryValidationError", { direction: "input" | "output"; issues: readonly Issue[]; queryName: string; }>

Constructors ​

Constructor ​
ts
new QueryValidationError(
   queryName, 
   direction, 
   issues
): QueryValidationError;

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

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

QueryValidationError

Overrides ​
ts
TaggedError(QUERY_VALIDATION_ERROR_TAG, {
  name: "QueryValidationError",
})<{
  queryName: string;
  direction: "input" | "output";
  issues: ReadonlyArray<StandardSchemaV1.Issue>;
}>.constructor

Properties ​

PropertyModifierTypeInherited fromDefined in
_tagreadonly"@temporal-contract/QueryValidationError"TaggedError(QUERY_VALIDATION_ERROR_TAG, { name: "QueryValidationError", })._tagnode_modules/.pnpm/unthrown@5.7.0/node_modules/unthrown/dist/index.d.mts:2011
cause?publicunknownTaggedError(QUERY_VALIDATION_ERROR_TAG, { name: "QueryValidationError", }).causenode_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2022.error.d.ts:24
directionreadonly"input" | "output"TaggedError(QUERY_VALIDATION_ERROR_TAG, { name: "QueryValidationError", }).directionpackages/client/src/errors.ts:290
issuesreadonlyreadonly Issue[]TaggedError(QUERY_VALIDATION_ERROR_TAG, { name: "QueryValidationError", }).issuespackages/client/src/errors.ts:291
messagepublicstringTaggedError(QUERY_VALIDATION_ERROR_TAG, { name: "QueryValidationError", }).messagenode_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es5.d.ts:1075
namepublicstringTaggedError(QUERY_VALIDATION_ERROR_TAG, { name: "QueryValidationError", }).namenode_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es5.d.ts:1074
queryNamereadonlystringTaggedError(QUERY_VALIDATION_ERROR_TAG, { name: "QueryValidationError", }).queryNamepackages/client/src/errors.ts:289
stack?publicstringTaggedError(QUERY_VALIDATION_ERROR_TAG, { name: "QueryValidationError", }).stacknode_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es5.d.ts:1076

RuntimeClientError ​

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

Generic runtime failure wrapper when no specific error type applies

Extends ​

  • TaggedErrorInstance<"@temporal-contract/RuntimeClientError", { cause?: unknown; operation: string; }>

Constructors ​

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

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

Parameters ​
ParameterType
operationstring
cause?unknown
Returns ​

RuntimeClientError

Overrides ​
ts
TaggedError(RUNTIME_CLIENT_ERROR_TAG, {
  name: "RuntimeClientError",
})<{
  operation: string;
  cause?: unknown;
}>.constructor

Properties ​

PropertyModifierTypeInherited fromDefined in
_tagreadonly"@temporal-contract/RuntimeClientError"TaggedError(RUNTIME_CLIENT_ERROR_TAG, { name: "RuntimeClientError", })._tagnode_modules/.pnpm/unthrown@5.7.0/node_modules/unthrown/dist/index.d.mts:2011
cause?publicunknownQueryValidationError.causenode_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2022.error.d.ts:24
messagepublicstringTaggedError(RUNTIME_CLIENT_ERROR_TAG, { name: "RuntimeClientError", }).messagenode_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es5.d.ts:1075
namepublicstringTaggedError(RUNTIME_CLIENT_ERROR_TAG, { name: "RuntimeClientError", }).namenode_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es5.d.ts:1074
operationreadonlystringTaggedError(RUNTIME_CLIENT_ERROR_TAG, { name: "RuntimeClientError", }).operationpackages/client/src/errors.ts:65
stack?publicstringTaggedError(RUNTIME_CLIENT_ERROR_TAG, { name: "RuntimeClientError", }).stacknode_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es5.d.ts:1076

ScheduleAlreadyExistsError ​

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

Surfaced on the Err channel when schedule.create collides with a running (not deleted) schedule bearing the same scheduleId — Temporal's ScheduleAlreadyRunning. Idempotent callers can branch on it explicitly (e.g. fetch the existing handle and continue).

Extends ​

  • TaggedErrorInstance<"@temporal-contract/ScheduleAlreadyExistsError", { cause?: unknown; scheduleId: string; }>

Constructors ​

Constructor ​
ts
new ScheduleAlreadyExistsError(scheduleId, cause?): ScheduleAlreadyExistsError;

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

Parameters ​
ParameterType
scheduleIdstring
cause?unknown
Returns ​

ScheduleAlreadyExistsError

Overrides ​
ts
TaggedError(SCHEDULE_ALREADY_EXISTS_ERROR_TAG, {
  name: "ScheduleAlreadyExistsError",
})<{
  scheduleId: string;
  cause?: unknown;
}>.constructor

Properties ​

PropertyModifierTypeInherited fromDefined in
_tagreadonly"@temporal-contract/ScheduleAlreadyExistsError"TaggedError(SCHEDULE_ALREADY_EXISTS_ERROR_TAG, { name: "ScheduleAlreadyExistsError", })._tagnode_modules/.pnpm/unthrown@5.7.0/node_modules/unthrown/dist/index.d.mts:2011
cause?publicunknownQueryValidationError.causenode_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2022.error.d.ts:24
messagepublicstringTaggedError(SCHEDULE_ALREADY_EXISTS_ERROR_TAG, { name: "ScheduleAlreadyExistsError", }).messagenode_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es5.d.ts:1075
namepublicstringTaggedError(SCHEDULE_ALREADY_EXISTS_ERROR_TAG, { name: "ScheduleAlreadyExistsError", }).namenode_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es5.d.ts:1074
scheduleIdreadonlystringTaggedError(SCHEDULE_ALREADY_EXISTS_ERROR_TAG, { name: "ScheduleAlreadyExistsError", }).scheduleIdpackages/client/src/errors.ts:434
stack?publicstringTaggedError(SCHEDULE_ALREADY_EXISTS_ERROR_TAG, { name: "ScheduleAlreadyExistsError", }).stacknode_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es5.d.ts:1076

ScheduleNotFoundError ​

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

Surfaced on the Err channel when a schedule-handle operation targets a schedule ID unknown to the Temporal server — Temporal's ScheduleNotFoundError. Either the ID is wrong or the schedule was deleted.

Extends ​

  • TaggedErrorInstance<"@temporal-contract/ScheduleNotFoundError", { cause?: unknown; scheduleId: string; }>

Constructors ​

Constructor ​
ts
new ScheduleNotFoundError(scheduleId, cause?): ScheduleNotFoundError;

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

Parameters ​
ParameterType
scheduleIdstring
cause?unknown
Returns ​

ScheduleNotFoundError

Overrides ​
ts
TaggedError(SCHEDULE_NOT_FOUND_ERROR_TAG, {
  name: "ScheduleNotFoundError",
})<{
  scheduleId: string;
  cause?: unknown;
}>.constructor

Properties ​

PropertyModifierTypeInherited fromDefined in
_tagreadonly"@temporal-contract/ScheduleNotFoundError"TaggedError(SCHEDULE_NOT_FOUND_ERROR_TAG, { name: "ScheduleNotFoundError", })._tagnode_modules/.pnpm/unthrown@5.7.0/node_modules/unthrown/dist/index.d.mts:2011
cause?publicunknownQueryValidationError.causenode_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2022.error.d.ts:24
messagepublicstringTaggedError(SCHEDULE_NOT_FOUND_ERROR_TAG, { name: "ScheduleNotFoundError", }).messagenode_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es5.d.ts:1075
namepublicstringTaggedError(SCHEDULE_NOT_FOUND_ERROR_TAG, { name: "ScheduleNotFoundError", }).namenode_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es5.d.ts:1074
scheduleIdreadonlystringTaggedError(SCHEDULE_NOT_FOUND_ERROR_TAG, { name: "ScheduleNotFoundError", }).scheduleIdpackages/client/src/errors.ts:452
stack?publicstringTaggedError(SCHEDULE_NOT_FOUND_ERROR_TAG, { name: "ScheduleNotFoundError", }).stacknode_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es5.d.ts:1076

SignalValidationError ​

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

Surfaced on the Err channel when signal input validation fails

Extends ​

  • TaggedErrorInstance<"@temporal-contract/SignalValidationError", { issues: readonly Issue[]; signalName: string; }>

Constructors ​

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

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

Parameters ​
ParameterType
signalNamestring
issuesreadonly Issue[]
Returns ​

SignalValidationError

Overrides ​
ts
TaggedError(SIGNAL_VALIDATION_ERROR_TAG, {
  name: "SignalValidationError",
})<{
  signalName: string;
  issues: ReadonlyArray<StandardSchemaV1.Issue>;
}>.constructor

Properties ​

PropertyModifierTypeInherited fromDefined in
_tagreadonly"@temporal-contract/SignalValidationError"TaggedError(SIGNAL_VALIDATION_ERROR_TAG, { name: "SignalValidationError", })._tagnode_modules/.pnpm/unthrown@5.7.0/node_modules/unthrown/dist/index.d.mts:2011
cause?publicunknownTaggedError(SIGNAL_VALIDATION_ERROR_TAG, { name: "SignalValidationError", }).causenode_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2022.error.d.ts:24
issuesreadonlyreadonly Issue[]TaggedError(SIGNAL_VALIDATION_ERROR_TAG, { name: "SignalValidationError", }).issuespackages/client/src/errors.ts:339
messagepublicstringTaggedError(SIGNAL_VALIDATION_ERROR_TAG, { name: "SignalValidationError", }).messagenode_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es5.d.ts:1075
namepublicstringTaggedError(SIGNAL_VALIDATION_ERROR_TAG, { name: "SignalValidationError", }).namenode_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es5.d.ts:1074
signalNamereadonlystringTaggedError(SIGNAL_VALIDATION_ERROR_TAG, { name: "SignalValidationError", }).signalNamepackages/client/src/errors.ts:338
stack?publicstringTaggedError(SIGNAL_VALIDATION_ERROR_TAG, { name: "SignalValidationError", }).stacknode_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es5.d.ts:1076

TechnicalError ​

Defined in: packages/contract/dist/errors-impl-BxWuCbUU.d.mts:18

Error for technical/runtime failures that cannot be prevented by TypeScript — connection failures, missing runtime capabilities, worker bundling errors. These are unmodeled infrastructure faults, never anticipated domain failures, so they ride the Defect channel: the creation factories (TypedClient.create, TypedWorker.create) surface them as a Defect whose cause is a TechnicalError instance (inspect via match's defect handler, recoverDefect, or tapDefect) — this class never appears in a Result's modeled E channel.

The class is retained (and still exported) so the descriptive message and cause survive for logging; it is only ever used as a defect's cause.

Extends ​

  • TechnicalError_base<{ cause?: unknown; }>

Constructors ​

Constructor ​
ts
new TechnicalError(message, cause?): TechnicalError;

Defined in: packages/contract/dist/errors-impl-BxWuCbUU.d.mts:21

Parameters ​
ParameterType
messagestring
cause?unknown
Returns ​

TechnicalError

Overrides ​
ts
TechnicalError_base<{
  cause?: unknown;
}>.constructor

Properties ​

PropertyModifierTypeInherited fromDefined in
_tagreadonly"@temporal-contract/TechnicalError"TechnicalError_base._tagnode_modules/.pnpm/unthrown@5.7.0/node_modules/unthrown/dist/index.d.mts:2011
cause?publicunknownQueryValidationError.causenode_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2022.error.d.ts:24
messagepublicstringTechnicalError_base.messagenode_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es5.d.ts:1075
namepublicstringTechnicalError_base.namenode_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es5.d.ts:1074
stack?publicstringTechnicalError_base.stacknode_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es5.d.ts:1076

TypedClient ​

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

Connection-scoped root of the typed client surface.

A client is a connection; a contract is a schema. TypedClient owns the connection-lifetime concerns — the eager ensureConnected(), the @temporalio/client capability check and the raw escape hatch — and hands out contract-bound ContractClients via TypedClient.for. Create it once at process start; bind contracts freely (binding is synchronous, infallible, and memoized).

Properties ​

PropertyModifierTypeDescriptionDefined in
rawreadonlyClientThe underlying @temporalio/client Client — the escape hatch for anything the typed surface doesn't cover yet (e.g. raw.workflow.list(...), raw.workflow.count(...)). Calls made through raw bypass contract validation.packages/client/src/client.ts:604

Methods ​

for() ​
ts
for<TContract>(contract): ContractClient<TContract>;

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

Bind a contract, returning a ContractClient typed against it.

Synchronous and infallible — binding a schema to an established connection is a free, compile-time-ish operation, so it's valid in a field initializer. Memoized per contract identity: the option-less for(c) === for(c) guarantee holds, so calling it per request is free.

Type Parameters ​
Type Parameter
TContract extends ContractDefinition
Parameters ​
ParameterType
contractTContract
Returns ​

ContractClient<TContract>

Example ​
ts
import {
  WORKFLOW_NOT_IN_CONTRACT_ERROR_TAG,
  WORKFLOW_VALIDATION_ERROR_TAG,
} from "@temporal-contract/client";
import { P } from "unthrown";

import { orderContract } from "./contracts/order.contract.js";

const orders = client.for(orderContract);

const result = await orders.executeWorkflow("processOrder", {
  workflowId: "order-123",
  args: { orderId: "ORD-123" },
});

await result.match({
  ok: (output) => console.log("processed", output),
  errCases: (matcher) =>
    matcher.with(
      P.tag(WORKFLOW_NOT_IN_CONTRACT_ERROR_TAG),
      P.tag(WORKFLOW_VALIDATION_ERROR_TAG),
      // ...one P.tag per remaining member of the union
      (error) => console.error("processing failed", error),
    ),
  defect: (cause) => console.error("unexpected failure", cause),
});
create() ​
ts
static create(__namedParameters): AsyncResult<TypedClient, never>;

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

Create the connection-scoped typed client.

Returns AsyncResult<TypedClient, never> — setup faults are technical infrastructure failures, not anticipated domain errors, so they surface on the Defect channel (a TechnicalError instance as the defect's cause), never the modeled Err channel. Technical failures routed there:

  • the underlying Client lacks the Schedule API (@temporalio/client < 1.16);
  • the connection cannot be established (when the client's connection exposes ensureConnected, it is awaited eagerly so a bad address/namespace surfaces here instead of on the first operation).
Parameters ​
ParameterType
__namedParametersCreateClientOptions
Returns ​

AsyncResult<TypedClient, never>

Example ​
ts
import { TypedClient } from "@temporal-contract/client";
import { Client, Connection } from "@temporalio/client";

const connection = await Connection.connect();
const temporalClient = new Client({ connection });

// Once, at process start. The Err channel is empty (`never`), so
// `.get()` unwraps directly — a setup defect rethrows its cause.
const client = await TypedClient.create({ client: temporalClient }).get();

TypedScheduleClient ​

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

Typed wrapper around Temporal's ScheduleClient. Exposed as contractClient.schedule — keeps the typed-client surface organized the same way Temporal's own Client.schedule does. Not constructible directly: the class is exported for type annotations only.

Type Parameters ​

Type Parameter
TContract extends ContractDefinition

Methods ​

create() ​
ts
create<TWorkflowName>(workflowName, options): AsyncResult<TypedScheduleHandle, 
  | WorkflowNotInContractError
  | WorkflowValidationError
  | ScheduleAlreadyExistsError>;

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

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 — but transmits the caller's ORIGINAL args (the worker parses them when each scheduled run starts, so a transforming schema applies exactly once, on the receiving side). 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.

A colliding running schedule (same scheduleId, not deleted) surfaces as ScheduleAlreadyExistsError on the Err channel.

Type Parameters ​
Type Parameter
TWorkflowName extends string
Parameters ​
ParameterType
workflowNameTWorkflowName
optionsTypedScheduleCreateOptions<TContract, TWorkflowName>
Returns ​

AsyncResult<TypedScheduleHandle, | WorkflowNotInContractError | WorkflowValidationError | ScheduleAlreadyExistsError>

getHandle() ​
ts
getHandle(scheduleId): TypedScheduleHandle;

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

Get a typed handle to an existing schedule. Does not validate that the schedule exists — handle methods (describe, pause, etc.) surface a ScheduleNotFoundError if the underlying ID is unknown.

Parameters ​
ParameterType
scheduleIdstring
Returns ​

TypedScheduleHandle

list() ​
ts
list(options?): AsyncIterable<ScheduleSummary>;

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

List schedules in the namespace — a typed async-iterable passthrough of Temporal's ScheduleClient.list. Not filtered to this contract: Temporal's visibility API lists every schedule the namespace knows about (use a query option to narrow server-side).

Parameters ​
ParameterType
options?ListScheduleOptions
Returns ​

AsyncIterable<ScheduleSummary>


UpdateFailedError ​

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

Surfaced on the Err channel when an admitted update's handler failed — Temporal's WorkflowUpdateFailedError, minus the admission rejections classified as UpdateRejectedError. A routine business failure of the update itself (the handler threw an ApplicationFailure), not a technical fault, so it rides the Err channel instead of the defect channel.

cause is the unwrapped underlying failure (typically an ApplicationFailure) lifted from Temporal's wrapper, mirroring WorkflowFailedError.cause.

Returned from the typed handle's updates.* proxies, startUpdate, and the update handle's result().

Extends ​

  • TaggedErrorInstance<"@temporal-contract/UpdateFailedError", { cause?: unknown; updateName: string; }>

Constructors ​

Constructor ​
ts
new UpdateFailedError(updateName, cause?): UpdateFailedError;

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

Parameters ​
ParameterType
updateNamestring
cause?unknown
Returns ​

UpdateFailedError

Overrides ​
ts
TaggedError(UPDATE_FAILED_ERROR_TAG, {
  name: "UpdateFailedError",
})<{
  updateName: string;
  cause?: unknown;
}>.constructor

Properties ​

PropertyModifierTypeInherited fromDefined in
_tagreadonly"@temporal-contract/UpdateFailedError"TaggedError(UPDATE_FAILED_ERROR_TAG, { name: "UpdateFailedError", })._tagnode_modules/.pnpm/unthrown@5.7.0/node_modules/unthrown/dist/index.d.mts:2011
cause?publicunknownQueryValidationError.causenode_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2022.error.d.ts:24
messagepublicstringTaggedError(UPDATE_FAILED_ERROR_TAG, { name: "UpdateFailedError", }).messagenode_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es5.d.ts:1075
namepublicstringTaggedError(UPDATE_FAILED_ERROR_TAG, { name: "UpdateFailedError", }).namenode_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es5.d.ts:1074
stack?publicstringTaggedError(UPDATE_FAILED_ERROR_TAG, { name: "UpdateFailedError", }).stacknode_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es5.d.ts:1076
updateNamereadonlystringTaggedError(UPDATE_FAILED_ERROR_TAG, { name: "UpdateFailedError", }).updateNamepackages/client/src/errors.ts:385

UpdateRejectedError ​

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

Surfaced on the Err channel when an update was rejected at admission by the worker-side input validator — the update handler never ran. With a @temporal-contract/worker on the other side of the task queue, this is the update-input schema rejecting the payload (the worker's UpdateInputValidationError, whose message summarizes the failing fields); cause keeps that original ApplicationFailure.

Distinct from UpdateValidationError (the client-side schema check, which fails before anything is sent) and from UpdateFailedError (the handler was admitted and then failed).

Returned from the typed handle's updates.* proxies, startUpdate, and the update handle's result().

Extends ​

  • TaggedErrorInstance<"@temporal-contract/UpdateRejectedError", { cause?: unknown; updateName: string; }>

Constructors ​

Constructor ​
ts
new UpdateRejectedError(updateName, cause?): UpdateRejectedError;

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

Parameters ​
ParameterType
updateNamestring
cause?unknown
Returns ​

UpdateRejectedError

Overrides ​
ts
TaggedError(UPDATE_REJECTED_ERROR_TAG, {
  name: "UpdateRejectedError",
})<{
  updateName: string;
  cause?: unknown;
}>.constructor

Properties ​

PropertyModifierTypeInherited fromDefined in
_tagreadonly"@temporal-contract/UpdateRejectedError"TaggedError(UPDATE_REJECTED_ERROR_TAG, { name: "UpdateRejectedError", })._tagnode_modules/.pnpm/unthrown@5.7.0/node_modules/unthrown/dist/index.d.mts:2011
cause?publicunknownQueryValidationError.causenode_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2022.error.d.ts:24
messagepublicstringTaggedError(UPDATE_REJECTED_ERROR_TAG, { name: "UpdateRejectedError", }).messagenode_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es5.d.ts:1075
namepublicstringTaggedError(UPDATE_REJECTED_ERROR_TAG, { name: "UpdateRejectedError", }).namenode_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es5.d.ts:1074
stack?publicstringTaggedError(UPDATE_REJECTED_ERROR_TAG, { name: "UpdateRejectedError", }).stacknode_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es5.d.ts:1076
updateNamereadonlystringTaggedError(UPDATE_REJECTED_ERROR_TAG, { name: "UpdateRejectedError", }).updateNamepackages/client/src/errors.ts:414

UpdateValidationError ​

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

Surfaced on the Err channel when update input or output validation fails

Extends ​

  • TaggedErrorInstance<"@temporal-contract/UpdateValidationError", { direction: "input" | "output"; issues: readonly Issue[]; updateName: string; }>

Constructors ​

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

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

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

UpdateValidationError

Overrides ​
ts
TaggedError(UPDATE_VALIDATION_ERROR_TAG, {
  name: "UpdateValidationError",
})<{
  updateName: string;
  direction: "input" | "output";
  issues: ReadonlyArray<StandardSchemaV1.Issue>;
}>.constructor

Properties ​

PropertyModifierTypeInherited fromDefined in
_tagreadonly"@temporal-contract/UpdateValidationError"TaggedError(UPDATE_VALIDATION_ERROR_TAG, { name: "UpdateValidationError", })._tagnode_modules/.pnpm/unthrown@5.7.0/node_modules/unthrown/dist/index.d.mts:2011
cause?publicunknownTaggedError(UPDATE_VALIDATION_ERROR_TAG, { name: "UpdateValidationError", }).causenode_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2022.error.d.ts:24
directionreadonly"input" | "output"TaggedError(UPDATE_VALIDATION_ERROR_TAG, { name: "UpdateValidationError", }).directionpackages/client/src/errors.ts:354
issuesreadonlyreadonly Issue[]TaggedError(UPDATE_VALIDATION_ERROR_TAG, { name: "UpdateValidationError", }).issuespackages/client/src/errors.ts:355
messagepublicstringTaggedError(UPDATE_VALIDATION_ERROR_TAG, { name: "UpdateValidationError", }).messagenode_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es5.d.ts:1075
namepublicstringTaggedError(UPDATE_VALIDATION_ERROR_TAG, { name: "UpdateValidationError", }).namenode_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es5.d.ts:1074
stack?publicstringTaggedError(UPDATE_VALIDATION_ERROR_TAG, { name: "UpdateValidationError", }).stacknode_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es5.d.ts:1076
updateNamereadonlystringTaggedError(UPDATE_VALIDATION_ERROR_TAG, { name: "UpdateValidationError", }).updateNamepackages/client/src/errors.ts:353

WorkflowAlreadyStartedError ​

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

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 ​

  • TaggedErrorInstance<"@temporal-contract/WorkflowAlreadyStartedError", { cause?: unknown; workflowId: string; workflowType: string; }>

Constructors ​

Constructor ​
ts
new WorkflowAlreadyStartedError(
   workflowType, 
   workflowId, 
   cause?
): WorkflowAlreadyStartedError;

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

Parameters ​
ParameterType
workflowTypestring
workflowIdstring
cause?unknown
Returns ​

WorkflowAlreadyStartedError

Overrides ​
ts
TaggedError(WORKFLOW_ALREADY_STARTED_ERROR_TAG, {
  name: "WorkflowAlreadyStartedError",
})<{
  workflowType: string;
  workflowId: string;
  cause?: unknown;
}>.constructor

Properties ​

PropertyModifierTypeInherited fromDefined in
_tagreadonly"@temporal-contract/WorkflowAlreadyStartedError"TaggedError(WORKFLOW_ALREADY_STARTED_ERROR_TAG, { name: "WorkflowAlreadyStartedError", })._tagnode_modules/.pnpm/unthrown@5.7.0/node_modules/unthrown/dist/index.d.mts:2011
cause?publicunknownQueryValidationError.causenode_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2022.error.d.ts:24
messagepublicstringTaggedError(WORKFLOW_ALREADY_STARTED_ERROR_TAG, { name: "WorkflowAlreadyStartedError", }).messagenode_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es5.d.ts:1075
namepublicstringTaggedError(WORKFLOW_ALREADY_STARTED_ERROR_TAG, { name: "WorkflowAlreadyStartedError", }).namenode_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es5.d.ts:1074
stack?publicstringTaggedError(WORKFLOW_ALREADY_STARTED_ERROR_TAG, { name: "WorkflowAlreadyStartedError", }).stacknode_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es5.d.ts:1076
workflowIdreadonlystringTaggedError(WORKFLOW_ALREADY_STARTED_ERROR_TAG, { name: "WorkflowAlreadyStartedError", }).workflowIdpackages/client/src/errors.ts:110
workflowTypereadonlystringTaggedError(WORKFLOW_ALREADY_STARTED_ERROR_TAG, { name: "WorkflowAlreadyStartedError", }).workflowTypepackages/client/src/errors.ts:109

WorkflowCancelledError ​

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

Surfaced on the Err channel when the awaited workflow execution ended Cancelled — Temporal's WorkflowFailedError wrapping a CancelledFailure. cause keeps the original CancelledFailure.

Swallowing this error hides the cancellation. Cancellation rides the modeled Err(...) channel here (mirroring the worker package's cancellation errors), so generic error handling that maps every Err to a blanket "failed" outcome silently conflates "the workflow was cancelled on purpose" with "the workflow broke". Give cancellation its own matcher arm when the two must diverge.

Returned from executeWorkflow and handle.result().

Extends ​

  • TaggedErrorInstance<"@temporal-contract/WorkflowCancelledError", { cause?: CancelledFailure; workflowId: string; }>

Constructors ​

Constructor ​
ts
new WorkflowCancelledError(workflowId, cause?): WorkflowCancelledError;

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

Parameters ​
ParameterType
workflowIdstring
cause?CancelledFailure
Returns ​

WorkflowCancelledError

Overrides ​
ts
TaggedError(WORKFLOW_CANCELLED_ERROR_TAG, {
  name: "WorkflowCancelledError",
})<{
  workflowId: string;
  cause?: CancelledFailure | undefined;
}>.constructor

Properties ​

PropertyModifierTypeInherited fromDefined in
_tagreadonly"@temporal-contract/WorkflowCancelledError"TaggedError(WORKFLOW_CANCELLED_ERROR_TAG, { name: "WorkflowCancelledError", })._tagnode_modules/.pnpm/unthrown@5.7.0/node_modules/unthrown/dist/index.d.mts:2011
cause?publicCancelledFailureQueryValidationError.causenode_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2022.error.d.ts:24
messagepublicstringTaggedError(WORKFLOW_CANCELLED_ERROR_TAG, { name: "WorkflowCancelledError", }).messagenode_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es5.d.ts:1075
namepublicstringTaggedError(WORKFLOW_CANCELLED_ERROR_TAG, { name: "WorkflowCancelledError", }).namenode_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es5.d.ts:1074
stack?publicstringTaggedError(WORKFLOW_CANCELLED_ERROR_TAG, { name: "WorkflowCancelledError", }).stacknode_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es5.d.ts:1076
workflowIdreadonlystringTaggedError(WORKFLOW_CANCELLED_ERROR_TAG, { name: "WorkflowCancelledError", }).workflowIdpackages/client/src/errors.ts:200

WorkflowExecutionNotFoundError ​

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

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 WorkflowNotInContractError).

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 ​

  • TaggedErrorInstance<"@temporal-contract/WorkflowExecutionNotFoundError", { cause?: unknown; runId?: string; workflowId: string; }>

Constructors ​

Constructor ​
ts
new WorkflowExecutionNotFoundError(
   workflowId, 
   runId?, 
   cause?
): WorkflowExecutionNotFoundError;

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

Parameters ​
ParameterType
workflowIdstring
runId?string
cause?unknown
Returns ​

WorkflowExecutionNotFoundError

Overrides ​
ts
TaggedError(
  WORKFLOW_EXECUTION_NOT_FOUND_ERROR_TAG,
  { name: "WorkflowExecutionNotFoundError" },
)<{
  workflowId: string;
  runId?: string | undefined;
  cause?: unknown;
}>.constructor

Properties ​

PropertyModifierTypeInherited fromDefined in
_tagreadonly"@temporal-contract/WorkflowExecutionNotFoundError"TaggedError( WORKFLOW_EXECUTION_NOT_FOUND_ERROR_TAG, { name: "WorkflowExecutionNotFoundError" }, )._tagnode_modules/.pnpm/unthrown@5.7.0/node_modules/unthrown/dist/index.d.mts:2011
cause?publicunknownQueryValidationError.causenode_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2022.error.d.ts:24
messagepublicstringTaggedError( WORKFLOW_EXECUTION_NOT_FOUND_ERROR_TAG, { name: "WorkflowExecutionNotFoundError" }, ).messagenode_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es5.d.ts:1075
namepublicstringTaggedError( WORKFLOW_EXECUTION_NOT_FOUND_ERROR_TAG, { name: "WorkflowExecutionNotFoundError" }, ).namenode_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es5.d.ts:1074
runId?readonlystringTaggedError( WORKFLOW_EXECUTION_NOT_FOUND_ERROR_TAG, { name: "WorkflowExecutionNotFoundError" }, ).runIdpackages/client/src/errors.ts:136
stack?publicstringTaggedError( WORKFLOW_EXECUTION_NOT_FOUND_ERROR_TAG, { name: "WorkflowExecutionNotFoundError" }, ).stacknode_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es5.d.ts:1076
workflowIdreadonlystringTaggedError( WORKFLOW_EXECUTION_NOT_FOUND_ERROR_TAG, { name: "WorkflowExecutionNotFoundError" }, ).workflowIdpackages/client/src/errors.ts:135

WorkflowFailedError ​

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

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) 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.

Cancellation, termination, and timeout outcomes do NOT surface here: they are classified into the first-class WorkflowCancelledError, WorkflowTerminatedError, and WorkflowTimeoutError before this generic wrapper is considered, so instanceof digging through cause is never needed to tell them apart.

Returned from executeWorkflow and handle.result().

Extends ​

  • TaggedErrorInstance<"@temporal-contract/WorkflowFailedError", { cause?: TemporalFailure; workflowId: string; }>

Constructors ​

Constructor ​
ts
new WorkflowFailedError(workflowId, cause?): WorkflowFailedError;

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

Parameters ​
ParameterType
workflowIdstring
cause?TemporalFailure
Returns ​

WorkflowFailedError

Overrides ​
ts
TaggedError(WORKFLOW_FAILED_ERROR_TAG, {
  name: "WorkflowFailedError",
})<{
  workflowId: string;
  cause?: TemporalFailure | undefined;
}>.constructor

Properties ​

PropertyModifierTypeInherited fromDefined in
_tagreadonly"@temporal-contract/WorkflowFailedError"TaggedError(WORKFLOW_FAILED_ERROR_TAG, { name: "WorkflowFailedError", })._tagnode_modules/.pnpm/unthrown@5.7.0/node_modules/unthrown/dist/index.d.mts:2011
cause?publicTemporalFailureQueryValidationError.causenode_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2022.error.d.ts:24
messagepublicstringTaggedError(WORKFLOW_FAILED_ERROR_TAG, { name: "WorkflowFailedError", }).messagenode_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es5.d.ts:1075
namepublicstringTaggedError(WORKFLOW_FAILED_ERROR_TAG, { name: "WorkflowFailedError", }).namenode_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es5.d.ts:1074
stack?publicstringTaggedError(WORKFLOW_FAILED_ERROR_TAG, { name: "WorkflowFailedError", }).stacknode_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es5.d.ts:1076
workflowIdreadonlystringTaggedError(WORKFLOW_FAILED_ERROR_TAG, { name: "WorkflowFailedError", }).workflowIdpackages/client/src/errors.ts:172

WorkflowNotInContractError ​

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

Surfaced on the Err channel when a workflow name is not declared in the bound contract. This is a contract-level lookup failure (a typo, a stale contract) — distinct from Temporal's own WorkflowNotFoundError, which is about a missing execution and surfaces here as WorkflowExecutionNotFoundError.

Extends ​

  • TaggedErrorInstance<"@temporal-contract/WorkflowNotInContractError", { availableWorkflows: readonly string[]; workflowName: string; }>

Constructors ​

Constructor ​
ts
new WorkflowNotInContractError(workflowName, availableWorkflows): WorkflowNotInContractError;

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

Parameters ​
ParameterType
workflowNamestring
availableWorkflowsreadonly string[]
Returns ​

WorkflowNotInContractError

Overrides ​
ts
TaggedError(WORKFLOW_NOT_IN_CONTRACT_ERROR_TAG, {
  name: "WorkflowNotInContractError",
})<{
  workflowName: string;
  availableWorkflows: readonly string[];
}>.constructor

Properties ​

PropertyModifierTypeInherited fromDefined in
_tagreadonly"@temporal-contract/WorkflowNotInContractError"TaggedError(WORKFLOW_NOT_IN_CONTRACT_ERROR_TAG, { name: "WorkflowNotInContractError", })._tagnode_modules/.pnpm/unthrown@5.7.0/node_modules/unthrown/dist/index.d.mts:2011
availableWorkflowsreadonlyreadonly string[]TaggedError(WORKFLOW_NOT_IN_CONTRACT_ERROR_TAG, { name: "WorkflowNotInContractError", }).availableWorkflowspackages/client/src/errors.ts:87
cause?publicunknownTaggedError(WORKFLOW_NOT_IN_CONTRACT_ERROR_TAG, { name: "WorkflowNotInContractError", }).causenode_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2022.error.d.ts:24
messagepublicstringTaggedError(WORKFLOW_NOT_IN_CONTRACT_ERROR_TAG, { name: "WorkflowNotInContractError", }).messagenode_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es5.d.ts:1075
namepublicstringTaggedError(WORKFLOW_NOT_IN_CONTRACT_ERROR_TAG, { name: "WorkflowNotInContractError", }).namenode_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es5.d.ts:1074
stack?publicstringTaggedError(WORKFLOW_NOT_IN_CONTRACT_ERROR_TAG, { name: "WorkflowNotInContractError", }).stacknode_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es5.d.ts:1076
workflowNamereadonlystringTaggedError(WORKFLOW_NOT_IN_CONTRACT_ERROR_TAG, { name: "WorkflowNotInContractError", }).workflowNamepackages/client/src/errors.ts:86

WorkflowTerminatedError ​

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

Surfaced on the Err channel when the awaited workflow execution was terminated — Temporal's WorkflowFailedError wrapping a TerminatedFailure. cause keeps the original TerminatedFailure (whose message carries the terminate reason, when one was given).

Returned from executeWorkflow and handle.result().

Extends ​

  • TaggedErrorInstance<"@temporal-contract/WorkflowTerminatedError", { cause?: TerminatedFailure; workflowId: string; }>

Constructors ​

Constructor ​
ts
new WorkflowTerminatedError(workflowId, cause?): WorkflowTerminatedError;

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

Parameters ​
ParameterType
workflowIdstring
cause?TerminatedFailure
Returns ​

WorkflowTerminatedError

Overrides ​
ts
TaggedError(WORKFLOW_TERMINATED_ERROR_TAG, {
  name: "WorkflowTerminatedError",
})<{
  workflowId: string;
  cause?: TerminatedFailure | undefined;
}>.constructor

Properties ​

PropertyModifierTypeInherited fromDefined in
_tagreadonly"@temporal-contract/WorkflowTerminatedError"TaggedError(WORKFLOW_TERMINATED_ERROR_TAG, { name: "WorkflowTerminatedError", })._tagnode_modules/.pnpm/unthrown@5.7.0/node_modules/unthrown/dist/index.d.mts:2011
cause?publicTerminatedFailureQueryValidationError.causenode_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2022.error.d.ts:24
messagepublicstringTaggedError(WORKFLOW_TERMINATED_ERROR_TAG, { name: "WorkflowTerminatedError", }).messagenode_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es5.d.ts:1075
namepublicstringTaggedError(WORKFLOW_TERMINATED_ERROR_TAG, { name: "WorkflowTerminatedError", }).namenode_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es5.d.ts:1074
stack?publicstringTaggedError(WORKFLOW_TERMINATED_ERROR_TAG, { name: "WorkflowTerminatedError", }).stacknode_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es5.d.ts:1076
workflowIdreadonlystringTaggedError(WORKFLOW_TERMINATED_ERROR_TAG, { name: "WorkflowTerminatedError", }).workflowIdpackages/client/src/errors.ts:220

WorkflowTimeoutError ​

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

Surfaced on the Err channel when the awaited workflow execution timed out — Temporal's WorkflowFailedError wrapping a TimeoutFailure. cause keeps the original TimeoutFailure (whose timeoutType names which timeout fired).

Returned from executeWorkflow and handle.result().

Extends ​

  • TaggedErrorInstance<"@temporal-contract/WorkflowTimeoutError", { cause?: TimeoutFailure; workflowId: string; }>

Constructors ​

Constructor ​
ts
new WorkflowTimeoutError(workflowId, cause?): WorkflowTimeoutError;

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

Parameters ​
ParameterType
workflowIdstring
cause?TimeoutFailure
Returns ​

WorkflowTimeoutError

Overrides ​
ts
TaggedError(WORKFLOW_TIMEOUT_ERROR_TAG, {
  name: "WorkflowTimeoutError",
})<{
  workflowId: string;
  cause?: TimeoutFailure | undefined;
}>.constructor

Properties ​

PropertyModifierTypeInherited fromDefined in
_tagreadonly"@temporal-contract/WorkflowTimeoutError"TaggedError(WORKFLOW_TIMEOUT_ERROR_TAG, { name: "WorkflowTimeoutError", })._tagnode_modules/.pnpm/unthrown@5.7.0/node_modules/unthrown/dist/index.d.mts:2011
cause?publicTimeoutFailureQueryValidationError.causenode_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2022.error.d.ts:24
messagepublicstringTaggedError(WORKFLOW_TIMEOUT_ERROR_TAG, { name: "WorkflowTimeoutError", }).messagenode_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es5.d.ts:1075
namepublicstringTaggedError(WORKFLOW_TIMEOUT_ERROR_TAG, { name: "WorkflowTimeoutError", }).namenode_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es5.d.ts:1074
stack?publicstringTaggedError(WORKFLOW_TIMEOUT_ERROR_TAG, { name: "WorkflowTimeoutError", }).stacknode_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es5.d.ts:1076
workflowIdreadonlystringTaggedError(WORKFLOW_TIMEOUT_ERROR_TAG, { name: "WorkflowTimeoutError", }).workflowIdpackages/client/src/errors.ts:242

WorkflowValidationError ​

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

Surfaced on the Err channel when workflow input or output validation fails.

workflowId identifies the targeted execution when the failing call knows it (start/execute/signalWithStart options, a handle's bound execution); it is absent for call sites without one (e.g. schedule.create, where runs are spawned later).

Extends ​

  • TaggedErrorInstance<"@temporal-contract/WorkflowValidationError", { direction: "input" | "output"; issues: readonly Issue[]; workflowId?: string; workflowName: string; }>

Constructors ​

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

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

Parameters ​
ParameterType
workflowNamestring
direction"input" | "output"
issuesreadonly Issue[]
workflowId?string
Returns ​

WorkflowValidationError

Overrides ​
ts
TaggedError(WORKFLOW_VALIDATION_ERROR_TAG, {
  name: "WorkflowValidationError",
})<{
  workflowName: string;
  direction: "input" | "output";
  issues: ReadonlyArray<StandardSchemaV1.Issue>;
  workflowId?: string | undefined;
}>.constructor

Properties ​

PropertyModifierTypeInherited fromDefined in
_tagreadonly"@temporal-contract/WorkflowValidationError"TaggedError(WORKFLOW_VALIDATION_ERROR_TAG, { name: "WorkflowValidationError", })._tagnode_modules/.pnpm/unthrown@5.7.0/node_modules/unthrown/dist/index.d.mts:2011
cause?publicunknownTaggedError(WORKFLOW_VALIDATION_ERROR_TAG, { name: "WorkflowValidationError", }).causenode_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2022.error.d.ts:24
directionreadonly"input" | "output"TaggedError(WORKFLOW_VALIDATION_ERROR_TAG, { name: "WorkflowValidationError", }).directionpackages/client/src/errors.ts:268
issuesreadonlyreadonly Issue[]TaggedError(WORKFLOW_VALIDATION_ERROR_TAG, { name: "WorkflowValidationError", }).issuespackages/client/src/errors.ts:269
messagepublicstringTaggedError(WORKFLOW_VALIDATION_ERROR_TAG, { name: "WorkflowValidationError", }).messagenode_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es5.d.ts:1075
namepublicstringTaggedError(WORKFLOW_VALIDATION_ERROR_TAG, { name: "WorkflowValidationError", }).namenode_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es5.d.ts:1074
stack?publicstringTaggedError(WORKFLOW_VALIDATION_ERROR_TAG, { name: "WorkflowValidationError", }).stacknode_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es5.d.ts:1076
workflowId?readonlystringTaggedError(WORKFLOW_VALIDATION_ERROR_TAG, { name: "WorkflowValidationError", }).workflowIdpackages/client/src/errors.ts:270
workflowNamereadonlystringTaggedError(WORKFLOW_VALIDATION_ERROR_TAG, { name: "WorkflowValidationError", }).workflowNamepackages/client/src/errors.ts:267

Type Aliases ​

AnyContractError ​

ts
type AnyContractError = ContractError<string, unknown>;

Defined in: packages/contract/dist/errors-impl-BxWuCbUU.d.mts:63

Widest ContractError instantiation — useful as a constraint or for instanceof-style narrowing before discriminating on errorName.


ClientInferInput ​

ts
type ClientInferInput<T> = StandardSchemaV1.InferInput<T["input"]>;

Defined in: packages/contract/dist/types-Do36Wf1g.d.mts:466

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/contract/dist/types-Do36Wf1g.d.mts:473

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) => AsyncResult<ClientInferOutput<TQuery>, 
  | QueryValidationError
  | QueryFailedError
  | WorkflowExecutionNotFoundError>;

Defined in: packages/client/src/types.ts:59

Infer query handler signature from client perspective. Client sends the query input type and receives the output type wrapped in an AsyncResult; the payload argument is omittable when the schema accepts undefined (e.g. argument-less defineQuery({ output })). The error union names exactly what the handle's query proxy produces: input/output-validation failure, a query the execution could not serve (unregistered handler or a throwing handler — QueryFailedError), or a missing execution.

Type Parameters ​

Type Parameter
TQuery extends QueryDefinition

Parameters ​

ParameterType
...argsundefined extends ClientInferInput<TQuery> ? [ClientInferInput<TQuery>] : [ClientInferInput<TQuery>]

Returns ​

AsyncResult<ClientInferOutput<TQuery>, | QueryValidationError | QueryFailedError | WorkflowExecutionNotFoundError>


ClientInferSignal ​

ts
type ClientInferSignal<TSignal> = (...args) => AsyncResult<void, 
  | SignalValidationError
  | WorkflowExecutionNotFoundError>;

Defined in: packages/client/src/types.ts:43

Infer signal handler signature from client perspective. Client sends the signal input type; the payload argument is omittable when the schema accepts undefined (e.g. payload-less defineSignal()). The error union names exactly what the handle's signal proxy produces: input-validation failure or a missing execution.

Type Parameters ​

Type Parameter
TSignal extends SignalDefinition

Parameters ​

ParameterType
...argsundefined extends ClientInferInput<TSignal> ? [ClientInferInput<TSignal>] : [ClientInferInput<TSignal>]

Returns ​

AsyncResult<void, | SignalValidationError | WorkflowExecutionNotFoundError>


ClientInferUpdate ​

ts
type ClientInferUpdate<TUpdate> = (...args) => AsyncResult<ClientInferOutput<TUpdate>, 
  | UpdateValidationError
  | UpdateRejectedError
  | UpdateFailedError
  | WorkflowExecutionNotFoundError>;

Defined in: packages/client/src/types.ts:78

Infer update handler signature from client perspective. Client sends the update input type and receives the output type wrapped in an AsyncResult; the payload argument is omittable when the schema accepts undefined (e.g. argument-less defineUpdate({ output })). The error union names exactly what the handle's update proxy produces: input/output-validation failure, a worker-side admission rejection (UpdateRejectedError), a failed admitted handler (UpdateFailedError), or a missing execution.

Type Parameters ​

Type Parameter
TUpdate extends UpdateDefinition

Parameters ​

ParameterType
...argsundefined extends ClientInferInput<TUpdate> ? [ClientInferInput<TUpdate>] : [ClientInferInput<TUpdate>]

Returns ​

AsyncResult<ClientInferOutput<TUpdate>, | UpdateValidationError | UpdateRejectedError | UpdateFailedError | WorkflowExecutionNotFoundError>


ClientInferWorkflowQueries ​

ts
type ClientInferWorkflowQueries<T> = T["queries"] extends Record<string, QueryDefinition> ? { [K in keyof T["queries"]]: ClientInferQuery<T["queries"][K]> } : Record<never, never>;

Defined in: packages/client/src/types.ts:100

Infer queries from a workflow definition (client perspective)

Type Parameters ​

Type Parameter
T extends AnyWorkflowDefinition

ClientInferWorkflowSignals ​

ts
type ClientInferWorkflowSignals<T> = T["signals"] extends Record<string, SignalDefinition> ? { [K in keyof T["signals"]]: ClientInferSignal<T["signals"][K]> } : Record<never, never>;

Defined in: packages/client/src/types.ts:90

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]> } : Record<never, never>;

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

Infer updates from a workflow definition (client perspective)

Type Parameters ​

Type Parameter
T extends AnyWorkflowDefinition

ContractErrorUnion ​

ts
type ContractErrorUnion<TErrors> = { [K in keyof TErrors & string]: ContractError<K, InferErrorData<TErrors[K]>> }[keyof TErrors & string];

Defined in: packages/contract/dist/errors-impl-BxWuCbUU.d.mts:79

Consumer-side union of ContractError instances for a declared errors map — data is typed with each schema's output (post-transform) shape. This is the union surfaced on the error channel of workflow-side activity calls and client-side workflow results.

Type Parameters ​

Type Parameter
TErrors extends Record<string, ErrorDefinition>

CreateClientOptions ​

ts
type CreateClientOptions = object;

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

Options for TypedClient.create — the single options-object shape shared by the org's Typed*.create() factories.

Properties ​

PropertyTypeDescriptionDefined in
clientClientThe underlying @temporalio/client Client.packages/client/src/client.ts:583

TemporalFailure ​

ts
type TemporalFailure = 
  | ApplicationFailure
  | CancelledFailure
  | TerminatedFailure
  | TimeoutFailure
  | ChildWorkflowFailure
  | ServerFailure
  | ActivityFailure;

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

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.

Note that the cancellation/termination/timeout members are classified into their own first-class errors (WorkflowCancelledError, WorkflowTerminatedError, WorkflowTimeoutError) before a generic WorkflowFailedError is ever surfaced, so in practice a WorkflowFailedError.cause carries one of the remaining members.

Re-exported from the package entry point so consumers can import it directly: import type { TemporalFailure } from "@temporal-contract/client".


TypedGetHandleOptions ​

ts
type TypedGetHandleOptions = GetWorkflowHandleOptions & object;

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

Options for ContractClient.getHandle. Extends Temporal's GetWorkflowHandleOptions (followRuns, firstExecutionRunId — the chain interlock ensuring mutating methods don't cross into another execution chain) with the optional runId of the specific execution to bind.

Type Declaration ​

NameTypeDescriptionDefined in
runId?stringRun ID of the specific execution to bind the handle to. Omitted, the handle addresses the latest execution of the workflow ID.packages/client/src/client.ts:270

TypedScheduleActionOverrides ​

ts
type TypedScheduleActionOverrides = Pick<ScheduleOptionsStartWorkflowAction<never>, 
  | "workflowId"
  | "workflowExecutionTimeout"
  | "workflowRunTimeout"
  | "workflowTaskTimeout"
  | "retry"
  | "memo"
  | "staticDetails"
  | "staticSummary">;

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

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

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:98
argsClientInferInput<TContract["workflows"][TWorkflowName]>Workflow input — validated against the contract's input schema.packages/client/src/schedule.ts:75
memo?ScheduleOptions["memo"]Schedule-level memo (non-indexed metadata on the schedule itself).packages/client/src/schedule.ts:90
policies?ScheduleOptions["policies"]Temporal schedule policies (overlap, catchupWindow, pauseOnFailure, etc.).packages/client/src/schedule.ts:86
scheduleIdstringSchedule ID. Recommended to use a meaningful business identifier.packages/client/src/schedule.ts:71
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:84
specScheduleSpecWhen the schedule should fire (cron, interval, calendar).packages/client/src/schedule.ts:73
state?ScheduleOptions["state"]Temporal schedule state (paused, note, limited, etc.).packages/client/src/schedule.ts:88

TypedScheduleHandle ​

ts
type TypedScheduleHandle = object;

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

Typed handle to a schedule. Mirrors Temporal's ScheduleHandle lifecycle methods (pause, unpause, trigger, update, backfill, describe, delete) wrapped in the unthrown AsyncResult pattern so call sites match the rest of the typed client.

Every method surfaces a missing schedule (Temporal's ScheduleNotFoundError — wrong ID, or the schedule was deleted) as the modeled ScheduleNotFoundError on the Err channel; any other failure is a technical fault routed to the Defect channel with a RuntimeClientError cause.

Properties ​

PropertyModifierTypeDescriptionDefined in
backfillpublic(options) => AsyncResult<void, ScheduleNotFoundError>Run the schedule's action for historical time ranges, as if the schedule had been active over them. Passthrough of Temporal's ScheduleHandle.backfill.packages/client/src/schedule.ts:158
deletepublic() => AsyncResult<void, ScheduleNotFoundError>Delete the schedule.packages/client/src/schedule.ts:160
describepublic() => AsyncResult<ScheduleDescription, ScheduleNotFoundError>Fetch the schedule's current description from the server.packages/client/src/schedule.ts:162
pausepublic(note?) => AsyncResult<void, ScheduleNotFoundError>Pause the schedule. Optional note becomes part of the audit trail.packages/client/src/schedule.ts:117
scheduleIdreadonlystringThis schedule's identifier.packages/client/src/schedule.ts:115
triggerpublic(overlap?) => AsyncResult<void, ScheduleNotFoundError>Fire the schedule's action immediately.packages/client/src/schedule.ts:121
unpausepublic(note?) => AsyncResult<void, ScheduleNotFoundError>Resume a paused schedule.packages/client/src/schedule.ts:119
updatepublic(updateFn) => AsyncResult<void, | ScheduleNotFoundError | WorkflowValidationError>Update the schedule definition: the handle fetches the current description, hands it to updateFn, and persists the returned options. When the returned action's workflowType names a workflow declared on the bound contract, the action's args are validated against that workflow's input schema before anything is persisted — a mismatch surfaces as WorkflowValidationError on the Err channel and the schedule is left untouched. An action whose workflowType is NOT declared on the contract is persisted as-is (passthrough — the contract has no schema to check it against); prefer delete + create for contract-level changes. Concurrency: last writer wins. Temporal's UpdateSchedule RPC is unconditional — the TypeScript SDK sends no conflict token and does not re-run updateFn on a conflict — so a concurrent modification landing between the read and the write is overwritten. That is true of the raw SDK too; this wrapper does not weaken it, but it does widen the window slightly: validation is asynchronous (schemas may be), so the wrapper fetches the description itself and hands the already-computed options to ScheduleHandle.update, which describes again internally. updateFn is invoked exactly once per call, and the options that are validated are exactly the options that are persisted. If two writers can race on one schedule, serialize them yourself.packages/client/src/schedule.ts:148

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

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 ​

ts
type TypedSignalWithStartOptions<TContract, TWorkflowName, TSignalName> = Omit<WorkflowSignalWithStartOptions, 
  | "taskQueue"
  | "args"
  | "signal"
  | "signalArgs"
  | "searchAttributes"
  | "typedSearchAttributes"> & WorkflowArgsField<TContract["workflows"][TWorkflowName]> & SignalArgsField<TContract["workflows"][TWorkflowName]["signals"][TSignalName]> & object;

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

Options for ContractClient.signalWithStart — typed against both the workflow's input schema and the named signal's input schema. The signal is addressed by the signalName field of this options bag (there is no positional signal parameter), keeping the method at two positional arguments like the rest of the surface.

Type Declaration ​

NameTypeDescriptionDefined in
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:255
signalNameTSignalName-packages/client/src/client.ts:248

Type Parameters ​

Type Parameter
TContract extends ContractDefinition
TWorkflowName extends keyof TContract["workflows"] & string
TSignalName extends InferSignalNames<TContract["workflows"][TWorkflowName]>

TypedStartUpdateOptions ​

ts
type TypedStartUpdateOptions<TUpdate> = object & undefined extends ClientInferInput<TUpdate> ? object : object;

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

Options for TypedWorkflowHandle.startUpdate — the update payload plus the passthrough subset of Temporal's WorkflowUpdateOptions. Passed as the second (positional) argument after the update name.

Type Declaration ​

NameTypeDescriptionDefined in
updateId?stringUnique ID for this update request (passthrough of Temporal's updateId). Meaningful business IDs enable deduplication.packages/client/src/client.ts:283
waitForStage?"ACCEPTED"Update lifecycle stage to wait for before the handle is returned. Temporal currently only supports "ACCEPTED", which is also the default — the option exists as a forward-compatible passthrough.packages/client/src/client.ts:289

Type Parameters ​

Type Parameter
TUpdate extends UpdateDefinition

TypedWorkflowHandle ​

ts
type TypedWorkflowHandle<TWorkflow> = object;

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

Typed workflow handle with validated results using unthrown Result/AsyncResult

Type Parameters ​

Type Parameter
TWorkflow extends AnyWorkflowDefinition

Properties ​

PropertyModifierTypeDescriptionDefined in
cancelpublic() => AsyncResult<void, WorkflowExecutionNotFoundError>Cancel workflow with Result patternpackages/client/src/client.ts:449
describepublic() => AsyncResult<Awaited<ReturnType<WorkflowHandle["describe"]>>, WorkflowExecutionNotFoundError>Get workflow execution description including status and metadatapackages/client/src/client.ts:454
fetchHistorypublic() => AsyncResult<Awaited<ReturnType<WorkflowHandle["fetchHistory"]>>, WorkflowExecutionNotFoundError>Fetch the workflow execution historypackages/client/src/client.ts:462
firstExecutionRunIdreadonlystring | undefinedRun ID of the first execution in the workflow chain, when known (set on handles returned by startWorkflow, and on getHandle handles when the caller passed firstExecutionRunId).packages/client/src/client.ts:361
queriespublicClientInferWorkflowQueries<TWorkflow>Type-safe queries based on workflow definition with Result pattern. Each query returns an AsyncResult — erring with QueryValidationError (payload/result schema mismatch), QueryFailedError (no handler registered on the execution, or the handler threw), or WorkflowExecutionNotFoundError — instead of a throwing Promise; the error union is carried by ClientInferWorkflowQueries directly.packages/client/src/client.ts:379
rawreadonlyWorkflowHandleThe underlying @temporalio/client WorkflowHandle — the escape hatch for anything the typed surface doesn't cover yet (e.g. raw.getUpdateHandle(...), raw.cancel() with SDK-specific options). Calls made through raw bypass contract validation. Mirrors TypedClient.raw at the handle level.packages/client/src/client.ts:369
resultpublic() => AsyncResult<ClientInferOutput<TWorkflow>, WorkflowResultErrorsOf<TWorkflow>>Get workflow result with Result pattern. When the workflow declares contract errors, a failed execution whose failure matches a declared error surfaces as that typed error instead of the generic WorkflowFailedError. A cancelled / terminated / timed-out execution surfaces as the first-class WorkflowCancelledError / WorkflowTerminatedError / WorkflowTimeoutError — no instanceof digging through WorkflowFailedError.cause required. Cancellation is a modeled Err(...): give it its own matcher arm rather than folding it into a blanket "failed" branch, so a deliberate cancel isn't reported as a breakage.packages/client/src/client.ts:439
runIdreadonlystring | undefinedRun ID of the execution this handle is bound to, when known: the started run's ID for startWorkflow handles, the caller-provided runId for getHandle handles, undefined otherwise (the handle then addresses the latest execution).packages/client/src/client.ts:354
signalspublicClientInferWorkflowSignals<TWorkflow>Type-safe signals based on workflow definition with Result pattern. Each signal returns an AsyncResult — erring with SignalValidationError or WorkflowExecutionNotFoundError — instead of a throwing Promise; the error union is carried by ClientInferWorkflowSignals directly.packages/client/src/client.ts:388
startUpdatepublic<TUpdateName>(updateName, ...options) => AsyncResult<TypedWorkflowUpdateHandle<TWorkflow["updates"][TUpdateName] extends UpdateDefinition ? TWorkflow["updates"][TUpdateName] : never>, UpdateCallError>Start an update without waiting for its completion — Temporal's startUpdate beside the updates map's execute-and-wait shape. The update is addressed positionally (startUpdate(updateName, options)); everything else rides the TypedStartUpdateOptions bag. Returns a TypedWorkflowUpdateHandle whose result() parses the outcome against the contract's output schema on receive. The options parameter is omittable when the update's input schema accepts undefined (e.g. an argument-less defineUpdate({ output })).packages/client/src/client.ts:411
terminatepublic(reason?) => AsyncResult<void, WorkflowExecutionNotFoundError>Terminate workflow with Result patternpackages/client/src/client.ts:444
updatespublicClientInferWorkflowUpdates<TWorkflow>Type-safe updates based on workflow definition with Result pattern. Each update starts the update AND waits for its result (Temporal's executeUpdate), returning an AsyncResult that errs with UpdateValidationError, UpdateRejectedError (worker-side admission rejection), UpdateFailedError (the admitted handler failed), or WorkflowExecutionNotFoundError; use startUpdate to obtain an update handle without waiting for completion.packages/client/src/client.ts:399
workflowIdreadonlystring-packages/client/src/client.ts:346

TypedWorkflowHandleWithSignaledRunId ​

ts
type TypedWorkflowHandleWithSignaledRunId<TWorkflow> = TypedWorkflowHandle<TWorkflow> & object;

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

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

Type Parameters ​

Type Parameter
TWorkflow extends AnyWorkflowDefinition

TypedWorkflowStartOptions ​

ts
type TypedWorkflowStartOptions<TContract, TWorkflowName> = Omit<WorkflowStartOptions, 
  | "taskQueue"
  | "args"
  | "searchAttributes"
  | "typedSearchAttributes"
  | "workflowId"> & WorkflowIdField<TContract["workflows"][TWorkflowName]> & WorkflowArgsField<TContract["workflows"][TWorkflowName]> & object;

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

Type Declaration ​

NameTypeDescriptionDefined in
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:217

Type Parameters ​

Type Parameter
TContract extends ContractDefinition
TWorkflowName extends keyof TContract["workflows"] & string

TypedWorkflowUpdateHandle ​

ts
type TypedWorkflowUpdateHandle<TUpdate> = object;

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

Typed handle to an in-flight update, returned by TypedWorkflowHandle.startUpdate. result() parses the update's outcome against the contract's output schema on receive (the worker transmits its original return value — D1).

Type Parameters ​

Type Parameter
TUpdate extends UpdateDefinition

Properties ​

PropertyModifierTypeDescriptionDefined in
resultpublic() => AsyncResult<ClientInferOutput<TUpdate>, UpdateCallError>Wait for and return the update's result, parsed against the contract's output schema. A worker-side admission rejection surfaces as UpdateRejectedError; a failed (admitted) handler as UpdateFailedError — both on the Err channel, never as defects.packages/client/src/client.ts:324
updateIdreadonlystringThe ID of this update request.packages/client/src/client.ts:313
workflowIdreadonlystringThe ID of the workflow execution targeted by this update.packages/client/src/client.ts:315
workflowRunIdreadonlystring | undefinedThe run ID of the targeted execution, when known.packages/client/src/client.ts:317

WorkflowContractErrorsOf ​

ts
type WorkflowContractErrorsOf<TWorkflow> = TWorkflow extends object ? ContractErrorUnion<TErrors> : never;

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

Union of typed ContractErrors declared on a workflow's errors map, or never when the workflow declares none — in which case the member simply vanishes from the surfaced error union.

Surfaced by executeWorkflow and handle.result() when the execution failed with a matching ApplicationFailure (type = declared error name, details[0] validating against the declared data schema).

Type Parameters ​

Type Parameter
TWorkflow extends AnyWorkflowDefinition

WorkflowResultErrorsOf ​

ts
type WorkflowResultErrorsOf<TWorkflow> = 
  | WorkflowContractErrorsOf<TWorkflow>
  | WorkflowValidationError
  | WorkflowFailedError
  | WorkflowCancelledError
  | WorkflowTerminatedError
  | WorkflowTimeoutError
  | WorkflowExecutionNotFoundError;

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

Union of the modeled errors a result-awaiting call can surface for a workflow — the shared tail of ContractClient.executeWorkflow and TypedWorkflowHandle.result: any contract error declared on the workflow, plus output validation, the generic completion failure, the three first-class workflow outcomes (cancelled / terminated / timed out), and a missing execution.

Type Parameters ​

Type Parameter
TWorkflow extends AnyWorkflowDefinition

Variables ​

QUERY_FAILED_ERROR_TAG ​

ts
const QUERY_FAILED_ERROR_TAG: "@temporal-contract/QueryFailedError" = "@temporal-contract/QueryFailedError";

Defined in: packages/client/src/error-tags.ts:55

_tag of QueryFailedError — the query could not be served (unregistered handler or handler failure).


QUERY_PATTERNS ​

ts
const QUERY_PATTERNS: readonly [{
  _tag: "@temporal-contract/QueryValidationError";
}, {
  _tag: "@temporal-contract/QueryFailedError";
}, {
  _tag: "@temporal-contract/WorkflowExecutionNotFoundError";
}];

Defined in: packages/client/src/error-patterns.ts:119

Every error a handle.queries.* call can produce.


QUERY_VALIDATION_ERROR_TAG ​

ts
const QUERY_VALIDATION_ERROR_TAG: "@temporal-contract/QueryValidationError" = "@temporal-contract/QueryValidationError";

Defined in: packages/client/src/error-tags.ts:52

_tag of QueryValidationError — query input/output failed schema validation.


RUNTIME_CLIENT_ERROR_TAG ​

ts
const RUNTIME_CLIENT_ERROR_TAG: "@temporal-contract/RuntimeClientError" = "@temporal-contract/RuntimeClientError";

Defined in: packages/client/src/error-tags.ts:18

_tag of RuntimeClientError — generic technical-failure wrapper (rides the defect channel).


SCHEDULE_ALREADY_EXISTS_ERROR_TAG ​

ts
const SCHEDULE_ALREADY_EXISTS_ERROR_TAG: "@temporal-contract/ScheduleAlreadyExistsError" = "@temporal-contract/ScheduleAlreadyExistsError";

Defined in: packages/client/src/error-tags.ts:70

_tag of ScheduleAlreadyExistsError — schedule.create collided with a running schedule.


SCHEDULE_CREATE_PATTERNS ​

ts
const SCHEDULE_CREATE_PATTERNS: readonly [{
  _tag: "@temporal-contract/ScheduleAlreadyExistsError";
}, {
  _tag: "@temporal-contract/WorkflowNotInContractError";
}, {
  _tag: "@temporal-contract/WorkflowValidationError";
}];

Defined in: packages/client/src/error-patterns.ts:134

Every error schedule.create can produce.


SCHEDULE_NOT_FOUND_ERROR_TAG ​

ts
const SCHEDULE_NOT_FOUND_ERROR_TAG: "@temporal-contract/ScheduleNotFoundError" = "@temporal-contract/ScheduleNotFoundError";

Defined in: packages/client/src/error-tags.ts:73

_tag of ScheduleNotFoundError — the schedule ID is unknown to the Temporal server.


SIGNAL_PATTERNS ​

ts
const SIGNAL_PATTERNS: readonly [{
  _tag: "@temporal-contract/SignalValidationError";
}, {
  _tag: "@temporal-contract/WorkflowExecutionNotFoundError";
}];

Defined in: packages/client/src/error-patterns.ts:113

Every error a handle.signals.* call can produce.


SIGNAL_VALIDATION_ERROR_TAG ​

ts
const SIGNAL_VALIDATION_ERROR_TAG: "@temporal-contract/SignalValidationError" = "@temporal-contract/SignalValidationError";

Defined in: packages/client/src/error-tags.ts:58

_tag of SignalValidationError — signal input failed schema validation.


UPDATE_FAILED_ERROR_TAG ​

ts
const UPDATE_FAILED_ERROR_TAG: "@temporal-contract/UpdateFailedError" = "@temporal-contract/UpdateFailedError";

Defined in: packages/client/src/error-tags.ts:64

_tag of UpdateFailedError — the update handler failed after admission.


UPDATE_PATTERNS ​

ts
const UPDATE_PATTERNS: readonly [{
  _tag: "@temporal-contract/UpdateValidationError";
}, {
  _tag: "@temporal-contract/UpdateRejectedError";
}, {
  _tag: "@temporal-contract/UpdateFailedError";
}, {
  _tag: "@temporal-contract/WorkflowExecutionNotFoundError";
}];

Defined in: packages/client/src/error-patterns.ts:126

Every error a handle.updates.* call can produce.


UPDATE_REJECTED_ERROR_TAG ​

ts
const UPDATE_REJECTED_ERROR_TAG: "@temporal-contract/UpdateRejectedError" = "@temporal-contract/UpdateRejectedError";

Defined in: packages/client/src/error-tags.ts:67

_tag of UpdateRejectedError — the update was rejected at admission by the worker-side validator.


UPDATE_VALIDATION_ERROR_TAG ​

ts
const UPDATE_VALIDATION_ERROR_TAG: "@temporal-contract/UpdateValidationError" = "@temporal-contract/UpdateValidationError";

Defined in: packages/client/src/error-tags.ts:61

_tag of UpdateValidationError — update input/output failed schema validation (client side).


WORKFLOW_ALREADY_STARTED_ERROR_TAG ​

ts
const WORKFLOW_ALREADY_STARTED_ERROR_TAG: "@temporal-contract/WorkflowAlreadyStartedError" = "@temporal-contract/WorkflowAlreadyStartedError";

Defined in: packages/client/src/error-tags.ts:24

_tag of WorkflowAlreadyStartedError — starting collided with an existing execution.


WORKFLOW_CANCELLED_ERROR_TAG ​

ts
const WORKFLOW_CANCELLED_ERROR_TAG: "@temporal-contract/WorkflowCancelledError" = "@temporal-contract/WorkflowCancelledError";

Defined in: packages/client/src/error-tags.ts:40

_tag of the client's WorkflowCancelledError — the execution ended Cancelled. Deliberately the same literal as the worker package's in-workflow WorkflowCancelledError tag: both mean "this workflow was cancelled", observed from different sides of the task queue, so grouped matchers treat them alike.


WORKFLOW_EXECUTE_PATTERNS ​

ts
const WORKFLOW_EXECUTE_PATTERNS: readonly [{
  _tag: "@temporal-contract/WorkflowNotInContractError";
}, {
  _tag: "@temporal-contract/WorkflowAlreadyStartedError";
}, {
  _tag: "@temporal-contract/WorkflowValidationError";
}, {
  _tag: "@temporal-contract/WorkflowFailedError";
}, {
  _tag: "@temporal-contract/WorkflowCancelledError";
}, {
  _tag: "@temporal-contract/WorkflowTerminatedError";
}, {
  _tag: "@temporal-contract/WorkflowTimeoutError";
}, {
  _tag: "@temporal-contract/WorkflowExecutionNotFoundError";
}];

Defined in: packages/client/src/error-patterns.ts:89

ContractClient.executeWorkflow is start + result, so its union is the widest: both phases, minus the workflow's own declared errors.


WORKFLOW_EXECUTION_NOT_FOUND_ERROR_TAG ​

ts
const WORKFLOW_EXECUTION_NOT_FOUND_ERROR_TAG: "@temporal-contract/WorkflowExecutionNotFoundError" = "@temporal-contract/WorkflowExecutionNotFoundError";

Defined in: packages/client/src/error-tags.ts:27

_tag of WorkflowExecutionNotFoundError — the targeted execution doesn't exist in the namespace.


WORKFLOW_FAILED_ERROR_TAG ​

ts
const WORKFLOW_FAILED_ERROR_TAG: "@temporal-contract/WorkflowFailedError" = "@temporal-contract/WorkflowFailedError";

Defined in: packages/client/src/error-tags.ts:31

_tag of WorkflowFailedError — the execution completed with a (non-outcome) failure.


WORKFLOW_NOT_IN_CONTRACT_ERROR_TAG ​

ts
const WORKFLOW_NOT_IN_CONTRACT_ERROR_TAG: "@temporal-contract/WorkflowNotInContractError" = "@temporal-contract/WorkflowNotInContractError";

Defined in: packages/client/src/error-tags.ts:21

_tag of WorkflowNotInContractError — the workflow name isn't declared on the bound contract.


WORKFLOW_RESULT_PATTERNS ​

ts
const WORKFLOW_RESULT_PATTERNS: readonly [{
  _tag: "@temporal-contract/WorkflowValidationError";
}, {
  _tag: "@temporal-contract/WorkflowFailedError";
}, {
  _tag: "@temporal-contract/WorkflowCancelledError";
}, {
  _tag: "@temporal-contract/WorkflowTerminatedError";
}, {
  _tag: "@temporal-contract/WorkflowTimeoutError";
}, {
  _tag: "@temporal-contract/WorkflowExecutionNotFoundError";
}];

Defined in: packages/client/src/error-patterns.ts:76

The non-contract-error tail of WorkflowResultErrorsOf — everything TypedWorkflowHandle.result() can produce besides the workflow's own declared errors: output validation, a generic completion failure, the three first-class stopped outcomes, and a missing execution.


WORKFLOW_START_PATTERNS ​

ts
const WORKFLOW_START_PATTERNS: readonly [{
  _tag: "@temporal-contract/WorkflowNotInContractError";
}, {
  _tag: "@temporal-contract/WorkflowValidationError";
}, {
  _tag: "@temporal-contract/WorkflowAlreadyStartedError";
}];

Defined in: packages/client/src/error-patterns.ts:64

Every error ContractClient.startWorkflow / signalWithStart can produce: the workflow name is not on the contract, its input failed validation, or an execution under this workflow ID already exists.


WORKFLOW_STOPPED_PATTERNS ​

ts
const WORKFLOW_STOPPED_PATTERNS: readonly [{
  _tag: "@temporal-contract/WorkflowCancelledError";
}, {
  _tag: "@temporal-contract/WorkflowTerminatedError";
}, {
  _tag: "@temporal-contract/WorkflowTimeoutError";
}];

Defined in: packages/client/src/error-patterns.ts:106

The three outcomes that mean "the execution was stopped, and not by completing" — cancelled, terminated, timed out. A subset of WORKFLOW_RESULT_PATTERNS, for callers that treat those alike but want the remaining failures branched separately.


WORKFLOW_TERMINATED_ERROR_TAG ​

ts
const WORKFLOW_TERMINATED_ERROR_TAG: "@temporal-contract/WorkflowTerminatedError" = "@temporal-contract/WorkflowTerminatedError";

Defined in: packages/client/src/error-tags.ts:43

_tag of WorkflowTerminatedError — the execution was terminated.


WORKFLOW_TIMEOUT_ERROR_TAG ​

ts
const WORKFLOW_TIMEOUT_ERROR_TAG: "@temporal-contract/WorkflowTimeoutError" = "@temporal-contract/WorkflowTimeoutError";

Defined in: packages/client/src/error-tags.ts:46

_tag of WorkflowTimeoutError — the execution timed out.


WORKFLOW_VALIDATION_ERROR_TAG ​

ts
const WORKFLOW_VALIDATION_ERROR_TAG: "@temporal-contract/WorkflowValidationError" = "@temporal-contract/WorkflowValidationError";

Defined in: packages/client/src/error-tags.ts:49

_tag of WorkflowValidationError — workflow input/output failed schema validation.

Functions ​

readTypedSearchAttributes() ​

ts
function readTypedSearchAttributes<TWorkflow>(workflowDef, instance): Partial<TypedSearchAttributeMap<TWorkflow>>;

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

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.