Skip to content

@temporal-contract/client


@temporal-contract/client ​

Classes ​

ActivityAlreadyStartedError ​

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

Surfaced on the Err channel when starting a standalone activity collides with a running execution under the same activity ID — Temporal's ActivityExecutionAlreadyStartedError (the default idConflictPolicy: "FAIL"), or a closed one the idReusePolicy rejects.

Extends ​

  • TaggedErrorInstance<"@temporal-contract/ActivityAlreadyStartedError", { activityId: string; activityType: string; cause?: unknown; }>

Constructors ​

Constructor ​
ts
new ActivityAlreadyStartedError(
   activityType, 
   activityId, 
   cause?
): ActivityAlreadyStartedError;

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

Parameters ​
ParameterType
activityTypestring
activityIdstring
cause?unknown
Returns ​

ActivityAlreadyStartedError

Overrides ​
ts
TaggedError(ACTIVITY_ALREADY_STARTED_ERROR_TAG, {
  name: "ActivityAlreadyStartedError",
})<{
  activityType: string;
  activityId: string;
  cause?: unknown;
}>.constructor

Properties ​

PropertyModifierTypeInherited fromDefined in
_tagreadonly"@temporal-contract/ActivityAlreadyStartedError"TaggedError(ACTIVITY_ALREADY_STARTED_ERROR_TAG, { name: "ActivityAlreadyStartedError", })._tagnode_modules/.pnpm/unthrown@5.11.0/node_modules/unthrown/dist/index.d.mts:2332
activityIdreadonlystringTaggedError(ACTIVITY_ALREADY_STARTED_ERROR_TAG, { name: "ActivityAlreadyStartedError", }).activityIdpackages/client/src/errors.ts:489
activityTypereadonlystringTaggedError(ACTIVITY_ALREADY_STARTED_ERROR_TAG, { name: "ActivityAlreadyStartedError", }).activityTypepackages/client/src/errors.ts:488
cause?publicunknownActivityValidationError.causenode_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2022.error.d.ts:24
messagepublicstringTaggedError(ACTIVITY_ALREADY_STARTED_ERROR_TAG, { name: "ActivityAlreadyStartedError", }).messagenode_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es5.d.ts:1075
namepublicstringTaggedError(ACTIVITY_ALREADY_STARTED_ERROR_TAG, { name: "ActivityAlreadyStartedError", }).namenode_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es5.d.ts:1074
stack?publicstringTaggedError(ACTIVITY_ALREADY_STARTED_ERROR_TAG, { name: "ActivityAlreadyStartedError", }).stacknode_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es5.d.ts:1076

ActivityCancelledError ​

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

Surfaced on the Err channel when the awaited standalone activity ended Canceled. cause keeps the original CancelledFailure. Like WorkflowCancelledError, give it its own matcher arm so a deliberate cancel isn't reported as a breakage.

Extends ​

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

Constructors ​

Constructor ​
ts
new ActivityCancelledError(activityId, cause?): ActivityCancelledError;

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

Parameters ​
ParameterType
activityIdstring
cause?CancelledFailure
Returns ​

ActivityCancelledError

Overrides ​
ts
TaggedError(ACTIVITY_CANCELLED_ERROR_TAG, {
  name: "ActivityCancelledError",
})<{
  activityId: string;
  cause?: CancelledFailure | undefined;
}>.constructor

Properties ​

PropertyModifierTypeInherited fromDefined in
_tagreadonly"@temporal-contract/ActivityCancelledError"TaggedError(ACTIVITY_CANCELLED_ERROR_TAG, { name: "ActivityCancelledError", })._tagnode_modules/.pnpm/unthrown@5.11.0/node_modules/unthrown/dist/index.d.mts:2332
activityIdreadonlystringTaggedError(ACTIVITY_CANCELLED_ERROR_TAG, { name: "ActivityCancelledError", }).activityIdpackages/client/src/errors.ts:548
cause?publicCancelledFailureActivityValidationError.causenode_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2022.error.d.ts:24
messagepublicstringTaggedError(ACTIVITY_CANCELLED_ERROR_TAG, { name: "ActivityCancelledError", }).messagenode_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es5.d.ts:1075
namepublicstringTaggedError(ACTIVITY_CANCELLED_ERROR_TAG, { name: "ActivityCancelledError", }).namenode_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es5.d.ts:1074
stack?publicstringTaggedError(ACTIVITY_CANCELLED_ERROR_TAG, { name: "ActivityCancelledError", }).stacknode_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es5.d.ts:1076

ActivityExecutionNotFoundError ​

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

Surfaced on the Err channel when an operation targets a standalone activity execution that doesn't exist in the namespace — Temporal's ActivityNotFoundError. Returned from every activity handle method.

Extends ​

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

Constructors ​

Constructor ​
ts
new ActivityExecutionNotFoundError(
   activityId, 
   runId?, 
   cause?
): ActivityExecutionNotFoundError;

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

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

ActivityExecutionNotFoundError

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

Properties ​

PropertyModifierTypeInherited fromDefined in
_tagreadonly"@temporal-contract/ActivityExecutionNotFoundError"TaggedError( ACTIVITY_EXECUTION_NOT_FOUND_ERROR_TAG, { name: "ActivityExecutionNotFoundError" }, )._tagnode_modules/.pnpm/unthrown@5.11.0/node_modules/unthrown/dist/index.d.mts:2332
activityIdreadonlystringTaggedError( ACTIVITY_EXECUTION_NOT_FOUND_ERROR_TAG, { name: "ActivityExecutionNotFoundError" }, ).activityIdpackages/client/src/errors.ts:507
cause?publicunknownActivityValidationError.causenode_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2022.error.d.ts:24
messagepublicstringTaggedError( ACTIVITY_EXECUTION_NOT_FOUND_ERROR_TAG, { name: "ActivityExecutionNotFoundError" }, ).messagenode_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es5.d.ts:1075
namepublicstringTaggedError( ACTIVITY_EXECUTION_NOT_FOUND_ERROR_TAG, { name: "ActivityExecutionNotFoundError" }, ).namenode_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es5.d.ts:1074
runId?readonlystringTaggedError( ACTIVITY_EXECUTION_NOT_FOUND_ERROR_TAG, { name: "ActivityExecutionNotFoundError" }, ).runIdpackages/client/src/errors.ts:508
stack?publicstringTaggedError( ACTIVITY_EXECUTION_NOT_FOUND_ERROR_TAG, { name: "ActivityExecutionNotFoundError" }, ).stacknode_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es5.d.ts:1076

ActivityFailedError ​

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

Surfaced on the Err channel when a standalone activity completes with a failure that is neither one of its declared contract errors nor a cancel/terminate/timeout outcome — Temporal's ActivityExecutionFailedError, with cause the unwrapped failure.

Returned from executeActivity and the activity handle's result().

Extends ​

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

Constructors ​

Constructor ​
ts
new ActivityFailedError(activityId, cause?): ActivityFailedError;

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

Parameters ​
ParameterType
activityIdstring
cause?TemporalFailure
Returns ​

ActivityFailedError

Overrides ​
ts
TaggedError(ACTIVITY_FAILED_ERROR_TAG, {
  name: "ActivityFailedError",
})<{
  activityId: string;
  cause?: TemporalFailure | undefined;
}>.constructor

Properties ​

PropertyModifierTypeInherited fromDefined in
_tagreadonly"@temporal-contract/ActivityFailedError"TaggedError(ACTIVITY_FAILED_ERROR_TAG, { name: "ActivityFailedError", })._tagnode_modules/.pnpm/unthrown@5.11.0/node_modules/unthrown/dist/index.d.mts:2332
activityIdreadonlystringTaggedError(ACTIVITY_FAILED_ERROR_TAG, { name: "ActivityFailedError", }).activityIdpackages/client/src/errors.ts:528
cause?publicTemporalFailureActivityValidationError.causenode_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2022.error.d.ts:24
messagepublicstringTaggedError(ACTIVITY_FAILED_ERROR_TAG, { name: "ActivityFailedError", }).messagenode_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es5.d.ts:1075
namepublicstringTaggedError(ACTIVITY_FAILED_ERROR_TAG, { name: "ActivityFailedError", }).namenode_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es5.d.ts:1074
stack?publicstringTaggedError(ACTIVITY_FAILED_ERROR_TAG, { name: "ActivityFailedError", }).stacknode_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es5.d.ts:1076

ActivityTerminatedError ​

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

Surfaced on the Err channel when the awaited standalone activity was terminated. cause keeps the original TerminatedFailure, whose message carries the terminate reason.

Extends ​

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

Constructors ​

Constructor ​
ts
new ActivityTerminatedError(activityId, cause?): ActivityTerminatedError;

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

Parameters ​
ParameterType
activityIdstring
cause?TerminatedFailure
Returns ​

ActivityTerminatedError

Overrides ​
ts
TaggedError(ACTIVITY_TERMINATED_ERROR_TAG, {
  name: "ActivityTerminatedError",
})<{
  activityId: string;
  cause?: TerminatedFailure | undefined;
}>.constructor

Properties ​

PropertyModifierTypeInherited fromDefined in
_tagreadonly"@temporal-contract/ActivityTerminatedError"TaggedError(ACTIVITY_TERMINATED_ERROR_TAG, { name: "ActivityTerminatedError", })._tagnode_modules/.pnpm/unthrown@5.11.0/node_modules/unthrown/dist/index.d.mts:2332
activityIdreadonlystringTaggedError(ACTIVITY_TERMINATED_ERROR_TAG, { name: "ActivityTerminatedError", }).activityIdpackages/client/src/errors.ts:565
cause?publicTerminatedFailureActivityValidationError.causenode_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2022.error.d.ts:24
messagepublicstringTaggedError(ACTIVITY_TERMINATED_ERROR_TAG, { name: "ActivityTerminatedError", }).messagenode_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es5.d.ts:1075
namepublicstringTaggedError(ACTIVITY_TERMINATED_ERROR_TAG, { name: "ActivityTerminatedError", }).namenode_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es5.d.ts:1074
stack?publicstringTaggedError(ACTIVITY_TERMINATED_ERROR_TAG, { name: "ActivityTerminatedError", }).stacknode_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es5.d.ts:1076

ActivityTimeoutError ​

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

Surfaced on the Err channel when the awaited standalone activity timed out. cause keeps the original TimeoutFailure, whose timeoutType names which timeout fired.

Extends ​

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

Constructors ​

Constructor ​
ts
new ActivityTimeoutError(activityId, cause?): ActivityTimeoutError;

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

Parameters ​
ParameterType
activityIdstring
cause?TimeoutFailure
Returns ​

ActivityTimeoutError

Overrides ​
ts
TaggedError(ACTIVITY_TIMEOUT_ERROR_TAG, {
  name: "ActivityTimeoutError",
})<{
  activityId: string;
  cause?: TimeoutFailure | undefined;
}>.constructor

Properties ​

PropertyModifierTypeInherited fromDefined in
_tagreadonly"@temporal-contract/ActivityTimeoutError"TaggedError(ACTIVITY_TIMEOUT_ERROR_TAG, { name: "ActivityTimeoutError", })._tagnode_modules/.pnpm/unthrown@5.11.0/node_modules/unthrown/dist/index.d.mts:2332
activityIdreadonlystringTaggedError(ACTIVITY_TIMEOUT_ERROR_TAG, { name: "ActivityTimeoutError", }).activityIdpackages/client/src/errors.ts:584
cause?publicTimeoutFailureActivityValidationError.causenode_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2022.error.d.ts:24
messagepublicstringTaggedError(ACTIVITY_TIMEOUT_ERROR_TAG, { name: "ActivityTimeoutError", }).messagenode_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es5.d.ts:1075
namepublicstringTaggedError(ACTIVITY_TIMEOUT_ERROR_TAG, { name: "ActivityTimeoutError", }).namenode_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es5.d.ts:1074
stack?publicstringTaggedError(ACTIVITY_TIMEOUT_ERROR_TAG, { name: "ActivityTimeoutError", }).stacknode_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es5.d.ts:1076

ActivityValidationError ​

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

Surfaced on the Err channel when a standalone activity's input (before the start) or output (on receive) fails its contract schema.

Extends ​

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

Constructors ​

Constructor ​
ts
new ActivityValidationError(
   activityName, 
   direction, 
   issues, 
   activityId
): ActivityValidationError;

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

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

ActivityValidationError

Overrides ​
ts
TaggedError(ACTIVITY_VALIDATION_ERROR_TAG, {
  name: "ActivityValidationError",
})<{
  activityName: string;
  direction: "input" | "output";
  issues: ReadonlyArray<StandardSchemaV1.Issue>;
  activityId: string;
}>.constructor

Properties ​

PropertyModifierTypeInherited fromDefined in
_tagreadonly"@temporal-contract/ActivityValidationError"TaggedError(ACTIVITY_VALIDATION_ERROR_TAG, { name: "ActivityValidationError", })._tagnode_modules/.pnpm/unthrown@5.11.0/node_modules/unthrown/dist/index.d.mts:2332
activityIdreadonlystringTaggedError(ACTIVITY_VALIDATION_ERROR_TAG, { name: "ActivityValidationError", }).activityIdpackages/client/src/errors.ts:603
activityNamereadonlystringTaggedError(ACTIVITY_VALIDATION_ERROR_TAG, { name: "ActivityValidationError", }).activityNamepackages/client/src/errors.ts:600
cause?publicunknownTaggedError(ACTIVITY_VALIDATION_ERROR_TAG, { name: "ActivityValidationError", }).causenode_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2022.error.d.ts:24
directionreadonly"input" | "output"TaggedError(ACTIVITY_VALIDATION_ERROR_TAG, { name: "ActivityValidationError", }).directionpackages/client/src/errors.ts:601
issuesreadonlyreadonly Issue[]TaggedError(ACTIVITY_VALIDATION_ERROR_TAG, { name: "ActivityValidationError", }).issuespackages/client/src/errors.ts:602
messagepublicstringTaggedError(ACTIVITY_VALIDATION_ERROR_TAG, { name: "ActivityValidationError", }).messagenode_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es5.d.ts:1075
namepublicstringTaggedError(ACTIVITY_VALIDATION_ERROR_TAG, { name: "ActivityValidationError", }).namenode_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es5.d.ts:1074
stack?publicstringTaggedError(ACTIVITY_VALIDATION_ERROR_TAG, { name: "ActivityValidationError", }).stacknode_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es5.d.ts:1076

ContractClient ​

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

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.

Workflow, signal and update names are constrained to the contract's declarations at the type level; a name that slips past the types (a cast, a raw call) is a defect carrying a TechnicalError, not a modeled Err.

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:315
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. Example import { SCHEDULE_CREATE_PATTERNS, SCHEDULE_NOT_FOUND_ERROR_TAG, } from "@temporal-contract/client"; import { P } from "unthrown"; const result = await contractClient.schedule .create("processOrder", { scheduleId: "daily-sweep", spec: { cronExpressions: ["0 2 * * *"] }, args: { orderId: "sweep" }, }) .flatMap((handle) => handle.pause("maintenance")); result.match({ ok: () => console.log("schedule created, paused"), errCases: (matcher) => matcher.with(...SCHEDULE_CREATE_PATTERNS, P.tag(SCHEDULE_NOT_FOUND_ERROR_TAG), (error) => console.error("schedule setup failed", error), ), defect: (cause) => console.error("unexpected failure", cause), });packages/client/src/client.ts:348

Accessors ​

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

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

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 ​

executeActivity() ​
ts
executeActivity<TActivityName>(activityName, options): AsyncResult<ClientInferOutput<ContractActivityOf<TContract, TActivityName>>, 
  | ActivityAlreadyStartedError
  | ActivityResultErrorsOf<ContractActivityOf<TContract, TActivityName>>>;

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

Execute a standalone activity — startActivity then the handle's result(). Beside the start errors, surfaces the activity's declared contract errors and the first-class outcome errors.

Type Parameters ​
Type Parameter
TActivityName extends string
Parameters ​
ParameterType
activityNameTActivityName
optionsTypedActivityStartOptions<ContractActivityOf<TContract, TActivityName>>
Returns ​

AsyncResult<ClientInferOutput<ContractActivityOf<TContract, TActivityName>>, | ActivityAlreadyStartedError | ActivityResultErrorsOf<ContractActivityOf<TContract, TActivityName>>>

Example ​
ts
import { ACTIVITY_EXECUTE_PATTERNS } from "@temporal-contract/client";

const result = await client.for(pdfContract).executeActivity("renderInvoice", {
  activityId: `invoice-${invoiceId}`,
  args: { invoiceId },
});

result.match({
  ok: ({ url }) => console.log("rendered", url),
  errCases: (matcher) =>
    matcher.with(...ACTIVITY_EXECUTE_PATTERNS, (error) => console.error(error)),
  defect: (cause) => console.error("unexpected failure", cause),
});
executeUpdateWithStart() ​
ts
executeUpdateWithStart<TWorkflowName, TUpdateName>(workflowName, options): AsyncResult<ClientInferOutput<UpdateOf<TContract["workflows"][TWorkflowName], TUpdateName>>, 
  | WorkflowValidationError
  | WorkflowAlreadyStartedError
  | UpdateValidationError
  | UpdateRejectedError
  | UpdateFailedError
  | UpdateRpcTimeoutOrCancelledError>;

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

Start a workflow (or, under workflowIdConflictPolicy: "USE_EXISTING", reuse the running one) and send it an update in one request, waiting for the update's result — Temporal's executeUpdateWithStart.

Validates both the workflow input (args) and the update input (updateArgs, for the update named by updateName) before anything is sent, and parses the update's result against its output schema. To reach the workflow afterwards, getHandle it by ID (workflowIdFor for a derived ID).

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

AsyncResult<ClientInferOutput<UpdateOf<TContract["workflows"][TWorkflowName], TUpdateName>>, | WorkflowValidationError | WorkflowAlreadyStartedError | UpdateValidationError | UpdateRejectedError | UpdateFailedError | UpdateRpcTimeoutOrCancelledError>

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

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

Execute a workflow (start and wait for result) with AsyncResult pattern — startWorkflow(...) then handle.result().

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]>, | WorkflowAlreadyStartedError | WorkflowResultErrorsOf<TContract["workflows"][TWorkflowName]>>

Example ​
ts
import { CONTRACT_ERROR_TAG, WORKFLOW_EXECUTE_PATTERNS } 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(CONTRACT_ERROR_TAG), (error) =>
        console.error('Domain failure:', error.errorName),
      )
      .with(...WORKFLOW_EXECUTE_PATTERNS, (error) =>
        console.error('Processing failed:', error),
      ),
  defect: (cause) => console.error('Unexpected failure:', cause),
});
getActivityHandle() ​
ts
getActivityHandle<TActivityName>(
   activityName, 
   activityId, 
   options?
): TypedActivityHandle<ContractActivityOf<TContract, TActivityName>>;

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

Get a typed handle to an existing standalone activity execution — synchronous and infallible, like Temporal's getHandle. Without a runId the handle targets the latest run under activityId.

Type Parameters ​
Type Parameter
TActivityName extends string
Parameters ​
ParameterType
activityNameTActivityName
activityIdstring
options?{ runId?: string; }
options.runId?string
Returns ​

TypedActivityHandle<ContractActivityOf<TContract, TActivityName>>

getHandle() ​
ts
getHandle<TWorkflowName>(
   workflowName, 
   workflowId, 
   options?
): TypedWorkflowHandle<TContract["workflows"][TWorkflowName]>;

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

Get a typed handle to an existing workflow execution — synchronous and infallible, like Temporal's getHandle. 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 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 ​

TypedWorkflowHandle<TContract["workflows"][TWorkflowName]>

Example ​
ts
const handle = contractClient.getHandle('processOrder', 'order-123');
const result = await handle.result();
signalWithStart() ​
ts
signalWithStart<TWorkflowName, TSignalName>(workflowName, options): AsyncResult<TypedWorkflowHandleWithSignaledRunId<TContract["workflows"][TWorkflowName]>, 
  | WorkflowValidationError
  | WorkflowAlreadyStartedError
  | SignalValidationError>;

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

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]>, | WorkflowValidationError | WorkflowAlreadyStartedError | SignalValidationError>

Example ​
ts
import {
  SIGNAL_VALIDATION_ERROR_TAG,
  WORKFLOW_START_PATTERNS,
} 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(...WORKFLOW_START_PATTERNS, (error) =>
        console.error('signalWithStart failed', error),
      ),
  defect: (cause) => console.error('unexpected failure', cause),
});
startActivity() ​
ts
startActivity<TActivityName>(activityName, options): AsyncResult<TypedActivityHandle<ContractActivityOf<TContract, TActivityName>>, 
  | ActivityValidationError
  | ActivityAlreadyStartedError>;

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

Start a standalone activity — one of the contract's global activities, run directly on the contract's task queue with no workflow around it (Temporal's client.activity.start; needs Temporal Server ≥ 1.32). The worker side is the ordinary declareActivitiesHandler registration, so its input validation and failure mapping apply.

args is validated against the activity's input schema before anything is sent. The activity's contract-level activityOptions are the defaults for the call's options; the merged options need a per-attempt and a total bound, or the call is a defect.

Type Parameters ​
Type Parameter
TActivityName extends string
Parameters ​
ParameterType
activityNameTActivityName
optionsTypedActivityStartOptions<ContractActivityOf<TContract, TActivityName>>
Returns ​

AsyncResult<TypedActivityHandle<ContractActivityOf<TContract, TActivityName>>, | ActivityValidationError | ActivityAlreadyStartedError>

Example ​
ts
const started = await client.for(pdfContract).startActivity("renderInvoice", {
  activityId: `invoice-${invoiceId}`,
  args: { invoiceId },
});
startWorkflow() ​
ts
startWorkflow<TWorkflowName>(workflowName, options): AsyncResult<TypedWorkflowHandle<TContract["workflows"][TWorkflowName]>, 
  | WorkflowValidationError
  | WorkflowAlreadyStartedError>;

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

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]>, | WorkflowValidationError | WorkflowAlreadyStartedError>

Example ​
ts
import { WORKFLOW_START_PATTERNS } from "@temporal-contract/client";

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(...WORKFLOW_START_PATTERNS, (error) =>
      console.error('Failed to start:', error),
    ),
  defect: (cause) => console.error('Unexpected failure:', cause),
});
workflowIdFor() ​
ts
workflowIdFor<TWorkflowName>(workflowName, input): AsyncResult<string, WorkflowValidationError>;

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

The workflow ID the contract derives for input — the same validation and derivation a start runs, without starting anything. Use it to getHandle an execution of a workflow whose contract declares workflowId.

Only callable for such workflows (the name is constrained at the type level); invalid input is Err(WorkflowValidationError).

Type Parameters ​
Type Parameter
TWorkflowName extends string
Parameters ​
ParameterType
workflowNameTWorkflowName
inputClientInferInput<TContract["workflows"][TWorkflowName]>
Returns ​

AsyncResult<string, WorkflowValidationError>

Example ​
ts
const handle = await orders
  .workflowIdFor("processOrder", { orderId: "ORD-1" })
  .map((workflowId) => orders.getHandle("processOrder", workflowId));

ContractError ​

Defined in: packages/contract/dist/errors-impl-D7p9uupF.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-D7p9uupF.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.11.0/node_modules/unthrown/dist/index.d.mts:2332
cause?publicunknown-ActivityValidationError.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-D7p9uupF.d.mts:49
errorNamereadonlyTNameDeclared error name — the ApplicationFailure.type discriminator.ContractError_base.errorNamepackages/contract/dist/errors-impl-D7p9uupF.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:310

Surfaced on the Err channel when the server could not serve a query:

  • no handler is registered under the query name on the (possibly older) workflow execution, or the query handler itself threw — Temporal reports both as QueryNotRegisteredError (an INVALID_ARGUMENT gRPC failure whose message carries the underlying reason);
  • the server rejected the query because of the execution's status, under the Temporal client's queryRejectCondition — Temporal's QueryRejectedError, whose status names the execution status.

cause keeps Temporal's original error for inspection. A routine operational outcome — a stale execution predating the handler, a handler bug, a closed execution — 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:316

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.11.0/node_modules/unthrown/dist/index.d.mts:2332
cause?publicunknownActivityValidationError.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:313
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:275

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

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.11.0/node_modules/unthrown/dist/index.d.mts:2332
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:279
issuesreadonlyreadonly Issue[]TaggedError(QUERY_VALIDATION_ERROR_TAG, { name: "QueryValidationError", }).issuespackages/client/src/errors.ts:280
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:278
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:73

Technical-failure wrapper for a Temporal call that failed in a way the typed client does not model. Never surfaced on the Err channel: it is the cause of the defect such a failure becomes, naming the operation that failed.

Extends ​

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

Constructors ​

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

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

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.11.0/node_modules/unthrown/dist/index.d.mts:2332
cause?publicunknownActivityValidationError.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:76
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:449

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

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.11.0/node_modules/unthrown/dist/index.d.mts:2332
cause?publicunknownActivityValidationError.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:452
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:467

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

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.11.0/node_modules/unthrown/dist/index.d.mts:2332
cause?publicunknownActivityValidationError.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:470
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:327

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

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.11.0/node_modules/unthrown/dist/index.d.mts:2332
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:331
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:330
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-D7p9uupF.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-D7p9uupF.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.11.0/node_modules/unthrown/dist/index.d.mts:2332
cause?publicunknownActivityValidationError.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:177

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() 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:184

Methods ​

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

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

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_EXECUTE_PATTERNS } from "@temporal-contract/client";

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(...WORKFLOW_EXECUTE_PATTERNS, (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:227

Create the connection-scoped typed client.

Returns AsyncResult<TypedClient, never> — a setup fault is a technical infrastructure failure, not an anticipated domain error, so it surfaces on the Defect channel (a TechnicalError instance as the defect's cause), never the modeled Err channel: 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:177

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, 
  | WorkflowValidationError
  | ScheduleAlreadyExistsError>;

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

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, | WorkflowValidationError | ScheduleAlreadyExistsError>

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

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

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

List schedules in the namespace — a 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).

The one method outside the Result discipline: a lazy, paginated AsyncIterable has no single outcome to carry, so a page fetch that fails throws from the for await loop, exactly as Temporal's does. Wrap the loop in your own boundary (fromPromise) when you need it as an AsyncResult.

Parameters ​
ParameterType
options?ListScheduleOptions
Returns ​

AsyncIterable<ScheduleSummary>


UpdateFailedError ​

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

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, the update handle's result(), and executeUpdateWithStart.

Extends ​

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

Constructors ​

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

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

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.11.0/node_modules/unthrown/dist/index.d.mts:2332
cause?publicunknownActivityValidationError.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:377

UpdateRejectedError ​

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

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, the update handle's result(), and executeUpdateWithStart — never from startUpdate: Temporal hands back the update handle for a rejected update too, and the rejection surfaces when its result() is awaited.

Extends ​

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

Constructors ​

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

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

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.11.0/node_modules/unthrown/dist/index.d.mts:2332
cause?publicunknownActivityValidationError.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:408

UpdateRpcTimeoutOrCancelledError ​

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

Surfaced on the Err channel when an update call timed out or was cancelled on the client side — Temporal's WorkflowUpdateRPCTimeoutOrCancelledError. It says nothing about the update itself, which may still be admitted and run: retry with the same updateId, or reattach with handle.getUpdateHandle(name, updateId). cause keeps Temporal's original error.

Returned from every update path: the updates.* proxies, startUpdate, the update handle's result(), and executeUpdateWithStart.

Extends ​

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

Constructors ​

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

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

Parameters ​
ParameterType
updateNamestring
cause?unknown
Returns ​

UpdateRpcTimeoutOrCancelledError

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

Properties ​

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

UpdateValidationError ​

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

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

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.11.0/node_modules/unthrown/dist/index.d.mts:2332
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:346
issuesreadonlyreadonly Issue[]TaggedError(UPDATE_VALIDATION_ERROR_TAG, { name: "UpdateValidationError", }).issuespackages/client/src/errors.ts:347
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:345

WorkflowAlreadyStartedError ​

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

Surfaced on the Err channel when starting a workflow collides with an existing execution — Temporal's WorkflowExecutionAlreadyStartedError. The most common cause is a startPolicy that rejects duplicates while a previous run is still in retention.

Modeled (rather than left to the defect channel) so idempotent callers can branch on it explicitly — e.g. fetch the existing handle and continue — without inspecting 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:104

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.11.0/node_modules/unthrown/dist/index.d.mts:2332
cause?publicunknownActivityValidationError.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:101
workflowTypereadonlystringTaggedError(WORKFLOW_ALREADY_STARTED_ERROR_TAG, { name: "WorkflowAlreadyStartedError", }).workflowTypepackages/client/src/errors.ts:100

WorkflowCancelledError ​

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

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

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.11.0/node_modules/unthrown/dist/index.d.mts:2332
cause?publicCancelledFailureActivityValidationError.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:193

WorkflowExecutionNotFoundError ​

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

Surfaced on the Err channel when an operation targets a workflow execution that doesn't exist in the namespace — Temporal's WorkflowNotFoundError.

Returned from:

  • handle methods: signal, query, executeUpdate, result, terminate, cancel, describe, fetchHistory
  • executeWorkflow (when the underlying execute call hits a missing execution mid-flight)

Extends ​

  • 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:128

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.11.0/node_modules/unthrown/dist/index.d.mts:2332
cause?publicunknownActivityValidationError.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:125
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:124

WorkflowFailedError ​

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

Surfaced on the Err channel 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.

retryState is Temporal's account of why the execution stopped retrying (e.g. "RETRY_STATE_MAXIMUM_ATTEMPTS_REACHED"), carried over from its wrapper.

Returned from executeWorkflow and handle.result().

Extends ​

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

Constructors ​

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

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

Parameters ​
ParameterType
workflowIdstring
cause?TemporalFailure
retryState?RetryState
Returns ​

WorkflowFailedError

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

Properties ​

PropertyModifierTypeInherited fromDefined in
_tagreadonly"@temporal-contract/WorkflowFailedError"TaggedError(WORKFLOW_FAILED_ERROR_TAG, { name: "WorkflowFailedError", })._tagnode_modules/.pnpm/unthrown@5.11.0/node_modules/unthrown/dist/index.d.mts:2332
cause?publicTemporalFailureActivityValidationError.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
retryState?readonlyRetryStateTaggedError(WORKFLOW_FAILED_ERROR_TAG, { name: "WorkflowFailedError", }).retryStatepackages/client/src/errors.ts:166
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:164

WorkflowTerminatedError ​

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

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

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.11.0/node_modules/unthrown/dist/index.d.mts:2332
cause?publicTerminatedFailureActivityValidationError.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:213

WorkflowTimeoutError ​

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

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

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.11.0/node_modules/unthrown/dist/index.d.mts:2332
cause?publicTimeoutFailureActivityValidationError.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:235

WorkflowValidationError ​

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

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: schedule.create (runs are spawned later), workflowIdFor, and the input check of a workflow whose contract derives its ID (the ID is derived from the validated input).

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

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.11.0/node_modules/unthrown/dist/index.d.mts:2332
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:257
issuesreadonlyreadonly Issue[]TaggedError(WORKFLOW_VALIDATION_ERROR_TAG, { name: "WorkflowValidationError", }).issuespackages/client/src/errors.ts:258
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:259
workflowNamereadonlystringTaggedError(WORKFLOW_VALIDATION_ERROR_TAG, { name: "WorkflowValidationError", }).workflowNamepackages/client/src/errors.ts:256

Type Aliases ​

ActivityContractErrorsOf ​

ts
type ActivityContractErrorsOf<TActivity> = TActivity extends object ? ContractErrorUnion<TErrors> : never;

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

Typed contract-error union for an activity's declared errors map, or never when it declares none.

Type Parameters ​

Type Parameter
TActivity extends ActivityDefinition

ActivityResultErrorsOf ​

ts
type ActivityResultErrorsOf<TActivity> = 
  | ActivityContractErrorsOf<TActivity>
  | ActivityValidationError
  | ActivityFailedError
  | ActivityCancelledError
  | ActivityTerminatedError
  | ActivityTimeoutError
  | ActivityExecutionNotFoundError;

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

Union of the modeled errors awaiting a standalone activity's result can surface — the shared tail of executeActivity and the activity handle's result(): any contract error declared on the activity, output validation, the generic failure, the three first-class outcomes, and a missing execution.

Type Parameters ​

Type Parameter
TActivity extends ActivityDefinition

AnyContractError ​

ts
type AnyContractError = ContractError<string, unknown>;

Defined in: packages/contract/dist/errors-impl-D7p9uupF.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-DjpDZs60.d.mts:454

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-DjpDZs60.d.mts:461

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

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

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
  | UpdateRpcTimeoutOrCancelledError
  | WorkflowExecutionNotFoundError>;

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

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 })), and an optional second argument carries the updateId. 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), a timed-out or cancelled update call, or a missing execution.

Type Parameters ​

Type Parameter
TUpdate extends UpdateDefinition

Parameters ​

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

Returns ​

AsyncResult<ClientInferOutput<TUpdate>, | UpdateValidationError | UpdateRejectedError | UpdateFailedError | UpdateRpcTimeoutOrCancelledError | 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:136

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

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

Infer updates from a workflow definition (client perspective)

Type Parameters ​

Type Parameter
T extends AnyWorkflowDefinition

ContractActivityOf ​

ts
type ContractActivityOf<TContract, TName> = TContract["activities"] extends Record<string, ActivityDefinition> ? TName extends keyof TContract["activities"] ? TContract["activities"][TName] : never : never;

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

The declared global activity named TName on TContract, or never — the activities a standalone call can target.

Type Parameters ​

Type Parameter
TContract extends ContractDefinition
TName

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-D7p9uupF.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/options.ts:25

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/options.ts:27
onRehydrationMiss?(miss) => voidCalled when a failure whose type names a declared contract error does NOT rehydrate into it (its payload fails the declared schema, or a data-less error lacks the wire marker) and degrades to the generic WorkflowFailedError — a signal of schema drift between client and worker, or of a foreign failure reusing a declared name. A throwing hook is swallowed. Library packages don't log; wire your own here.packages/client/src/options.ts:36

DerivedIdWorkflowName ​

ts
type DerivedIdWorkflowName<TContract> = { [K in keyof TContract["workflows"] & string]: TContract["workflows"][K]["workflowId"] extends (input: never) => string ? K : never }[keyof TContract["workflows"] & string];

Defined in: packages/client/src/options.ts:80

Names of the contract's workflows that derive their workflow ID.

Type Parameters ​

Type Parameter
TContract extends ContractDefinition

RehydrationMiss ​

ts
type RehydrationMiss = object;

Defined in: packages/contract/dist/errors-impl-D7p9uupF.d.mts:131

Diagnostic payload describing a rehydration miss: a failure whose type matched a declared error name but that could not be rehydrated as the typed ContractError and degraded to the caller's generic failure classification.

Properties ​

PropertyModifierTypeDescriptionDefined in
errorNamereadonlystringThe declared error name that failure.type matched.packages/contract/dist/errors-impl-D7p9uupF.d.mts:133
failurereadonlyApplicationFailureLikeThe failure that was being rehydrated.packages/contract/dist/errors-impl-D7p9uupF.d.mts:146
issues?readonlyReadonlyArray<StandardSchemaV1.Issue>Validation issues when reason is "data-validation-failed".packages/contract/dist/errors-impl-D7p9uupF.d.mts:144
reasonreadonly"data-validation-failed" | "missing-wire-marker"Why rehydration degraded: - "data-validation-failed" — the declared data schema rejected details[0] (schema drift or a foreign failure with a payload); - "missing-wire-marker" — a data-less declared error without the CONTRACT_ERROR_WIRE_MARKER, i.e. most likely an unrelated ApplicationFailure reusing the declared name as its type.packages/contract/dist/errors-impl-D7p9uupF.d.mts:142

TemporalFailure ​

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

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

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


TypedActivityHandle ​

ts
type TypedActivityHandle<TActivity> = object;

Defined in: packages/client/src/activity.ts:55

Typed handle to a standalone activity execution, returned by ContractClient.startActivity and getActivityHandle.

Type Parameters ​

Type Parameter
TActivity extends ActivityDefinition

Properties ​

PropertyModifierTypeDescriptionDefined in
activityIdreadonlystring-packages/client/src/activity.ts:56
cancelpublic(reason?) => AsyncResult<void, ActivityExecutionNotFoundError>Request cancellation — cooperative: the activity must heartbeat to see it.packages/client/src/activity.ts:81
describepublic(options?) => AsyncResult<ActivityExecutionDescription, ActivityExecutionNotFoundError>Describe the execution (status, attempts, timing, …).packages/client/src/activity.ts:77
rawreadonlyActivityHandleThe underlying @temporalio/client ActivityHandle — the escape hatch for what the typed surface doesn't cover (pause, updateOptions, …).packages/client/src/activity.ts:67
resultpublic() => AsyncResult<ClientInferOutput<TActivity>, ActivityResultErrorsOf<TActivity>>Wait for the activity's result, parsed against its output schema. A failure matching one of the activity's declared errors surfaces as that typed ContractError; a cancelled / terminated / timed-out execution as the first-class ActivityCancelledError / ActivityTerminatedError / ActivityTimeoutError; anything else as ActivityFailedError.packages/client/src/activity.ts:75
runIdreadonlystring | undefinedRun ID of the execution this handle is pinned to: the started run for startActivity handles, the caller-provided runId (or undefined, meaning the latest run) for getActivityHandle handles.packages/client/src/activity.ts:62
terminatepublic(reason?) => AsyncResult<void, ActivityExecutionNotFoundError>Terminate the execution. The worker is not notified and may keep running it.packages/client/src/activity.ts:83

TypedActivityStartOptions ​

ts
type TypedActivityStartOptions<TActivity> = Omit<ActivityOptions, "id" | "taskQueue" | "args" | "typeInfo"> & object & undefined extends ClientInferInput<TActivity> ? object : object;

Defined in: packages/client/src/options.ts:216

Options for ContractClient.startActivity / executeActivity: Temporal's standalone ActivityOptions, minus what the contract owns (the task queue) and with the payload typed against the activity's input schema.

The activity's contract-level activityOptions are the defaults; fields set here shallow-merge over them (a retry here replaces the contract's whole retry block). The merged options need a per-attempt bound (startToCloseTimeout or scheduleToCloseTimeout) and a total bound (scheduleToCloseTimeout, or a finite positive retry.maximumAttempts).

idConflictPolicy accepts only "FAIL" (the default) and "USE_EXISTING": Temporal has no TerminateExisting for activities.

Type Declaration ​

NameTypeDescriptionDefined in
activityIdstringThe activity ID — a meaningful business ID is recommended.packages/client/src/options.ts:221

Type Parameters ​

Type Parameter
TActivity extends ActivityDefinition

TypedGetHandleOptions ​

ts
type TypedGetHandleOptions = Omit<GetWorkflowHandleOptions, "followRuns"> & object;

Defined in: packages/client/src/options.ts:173

Options for ContractClient.getHandle. Temporal's GetWorkflowHandleOptions (firstExecutionRunId — the chain interlock ensuring mutating methods don't cross into another execution chain) with the optional runId of the specific execution to bind. followRuns is not offered: the handle always follows the run chain, so result() never meets Temporal's unmodeled WorkflowContinuedAsNewError.

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/options.ts:178

TypedScheduleActionOverrides ​

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

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

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> = ScheduleCreateFields & WorkflowArgsField<TContract["workflows"][TWorkflowName]> & object;

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

Options for TypedScheduleClient.create.

scheduleId, spec, policies, state, and memo are Temporal's own schedule-level ScheduleOptions. args is typed against the destination workflow's input schema (omittable when the schema accepts undefined). Workflow-action–level overrides nest under action so memo and other fields with the same name don't collide between the two scopes.

Type Declaration ​

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

Type Parameters ​

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

TypedScheduleHandle ​

ts
type TypedScheduleHandle = object;

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

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:164
deletepublic() => AsyncResult<void, ScheduleNotFoundError>Delete the schedule.packages/client/src/schedule.ts:166
describepublic() => AsyncResult<ScheduleDescription, ScheduleNotFoundError>Fetch the schedule's current description from the server.packages/client/src/schedule.ts:168
pausepublic(note?) => AsyncResult<void, ScheduleNotFoundError>Pause the schedule. Optional note becomes part of the audit trail.packages/client/src/schedule.ts:120
rawreadonlyScheduleHandleThe underlying @temporalio/client ScheduleHandle — the escape hatch for anything the typed surface doesn't cover. Calls made through raw bypass contract validation.packages/client/src/schedule.ts:118
scheduleIdreadonlystringThis schedule's identifier.packages/client/src/schedule.ts:112
triggerpublic(overlap?) => AsyncResult<void, ScheduleNotFoundError>Fire the schedule's action immediately.packages/client/src/schedule.ts:124
unpausepublic(note?) => AsyncResult<void, ScheduleNotFoundError>Resume a paused schedule.packages/client/src/schedule.ts:122
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 is re-checked before anything is persisted, the same way create checks it: its args against the workflow's input schema (a mismatch is WorkflowValidationError on the Err channel), and its typedSearchAttributes against the declared attributes and kinds, and its taskQueue against the contract's (either mismatch is a misconfiguration, so a defect). The schedule is left untouched on any of them. 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:154

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/types.ts:195

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> = TypedWorkflowStartOptions<TContract, TWorkflowName> & SignalArgsField<TContract["workflows"][TWorkflowName]["signals"][TSignalName]> & object;

Defined in: packages/client/src/options.ts:121

Options for ContractClient.signalWithStart — the start options of TypedWorkflowStartOptions plus the signal, typed against 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 ​

NameTypeDefined in
signalNameTSignalNamepackages/client/src/options.ts:127

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/options.ts:186

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/options.ts:191
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/options.ts:197

Type Parameters ​

Type Parameter
TUpdate extends UpdateDefinition

TypedUpdateWithStartOptions ​

ts
type TypedUpdateWithStartOptions<TContract, TWorkflowName, TUpdateName> = TypedWorkflowStartOptions<TContract, TWorkflowName> & UpdateArgsField<TContract["workflows"][TWorkflowName]["updates"][TUpdateName]> & object;

Defined in: packages/client/src/options.ts:147

Options for ContractClient.executeUpdateWithStart — the start options of TypedWorkflowStartOptions (with the workflowIdConflictPolicy Temporal requires for update-with-start) plus the update, addressed by updateName like signalWithStart's signal.

Type Declaration ​

NameTypeDescriptionDefined in
updateId?stringUnique ID for this update request (passthrough of Temporal's updateId).packages/client/src/options.ts:162
updateNameTUpdateName-packages/client/src/options.ts:160
workflowIdConflictPolicyWorkflowIdConflictPolicyWhat to do when an execution with this workflow ID is already running: "USE_EXISTING" sends the update to it, "FAIL" surfaces WorkflowAlreadyStartedError. Required by Temporal for update-with-start.packages/client/src/options.ts:159

Type Parameters ​

Type Parameter
TContract extends ContractDefinition
TWorkflowName extends keyof TContract["workflows"] & string
TUpdateName extends InferUpdateNames<TContract["workflows"][TWorkflowName]>

TypedWorkflowHandle ​

ts
type TypedWorkflowHandle<TWorkflow> = object;

Defined in: packages/client/src/handle.ts:126

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/handle.ts:238
describepublic() => AsyncResult<Awaited<ReturnType<WorkflowHandle["describe"]>>, WorkflowExecutionNotFoundError>Get workflow execution description including status and metadatapackages/client/src/handle.ts:243
fetchHistorypublic() => AsyncResult<Awaited<ReturnType<WorkflowHandle["fetchHistory"]>>, WorkflowExecutionNotFoundError>Fetch the workflow execution historypackages/client/src/handle.ts:251
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/handle.ts:143
getUpdateHandlepublic<TUpdateName>(updateName, updateId) => TypedWorkflowUpdateHandle<UpdateOf<TWorkflow, TUpdateName>>Reattach to an update already sent to this execution, by its updateId — Temporal's getUpdateHandle, typed against the named update so result() parses the outcome against its output schema. Synchronous, like Temporal's: nothing is sent until result().packages/client/src/handle.ts:211
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, the handler threw, or the query was rejected), or WorkflowExecutionNotFoundError — instead of a throwing Promise; the error union is carried by ClientInferWorkflowQueries directly.packages/client/src/handle.ts:162
rawreadonlyWorkflowHandleThe underlying @temporalio/client WorkflowHandle — the escape hatch for anything the typed surface doesn't cover yet (e.g. raw.cancel() with SDK-specific options). Calls made through raw bypass contract validation. Mirrors TypedClient.raw at the handle level.packages/client/src/handle.ts:151
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/handle.ts:228
runIdreadonlystring | undefinedRun ID of the execution this handle is pinned to: the caller-provided runId for getHandle handles, undefined otherwise — a started handle follows its run chain (a continue-as-new moves it to the next run), so it is not pinned to the run it started. See firstExecutionRunId for the run a start created.packages/client/src/handle.ts:136
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/handle.ts:171
startUpdatepublic<TUpdateName>(updateName, ...options) => AsyncResult<TypedWorkflowUpdateHandle<UpdateOf<TWorkflow, TUpdateName>>, StartUpdateError>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. The options parameter is omittable when the update's input schema accepts undefined (e.g. an argument-less defineUpdate({ output })). Returns a TypedWorkflowUpdateHandle once the update is accepted or rejected: a worker-side admission rejection (and a failed handler) surfaces on the update handle's result(), not here.packages/client/src/handle.ts:198
terminatepublic(reason?) => AsyncResult<void, WorkflowExecutionNotFoundError>Terminate workflow with Result patternpackages/client/src/handle.ts:233
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) — updates.name(input, { updateId }) — returning an AsyncResult that errs with UpdateValidationError, UpdateRejectedError (worker-side admission rejection), UpdateFailedError (the admitted handler failed), UpdateRpcTimeoutOrCancelledError, or WorkflowExecutionNotFoundError; use startUpdate to obtain an update handle without waiting for completion.packages/client/src/handle.ts:184
workflowIdreadonlystring-packages/client/src/handle.ts:127

TypedWorkflowHandleWithSignaledRunId ​

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

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

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/handle.ts:120

Type Parameters ​

Type Parameter
TWorkflow extends AnyWorkflowDefinition

TypedWorkflowStartOptions ​

ts
type TypedWorkflowStartOptions<TContract, TWorkflowName> = Omit<WorkflowStartOptions, ContractOwnedStartFields> & WorkflowIdField<TContract["workflows"][TWorkflowName]> & WorkflowArgsField<TContract["workflows"][TWorkflowName]> & object;

Defined in: packages/client/src/options.ts:88

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/options.ts:100

Type Parameters ​

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

TypedWorkflowUpdateHandle ​

ts
type TypedWorkflowUpdateHandle<TUpdate> = object;

Defined in: packages/client/src/handle.ts:92

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

Type Parameters ​

Type Parameter
TUpdate extends UpdateDefinition

Properties ​

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

WorkflowContractErrorsOf ​

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

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

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/types.ts:175

Union of the modeled errors a result-awaiting call can surface for a workflow — the shared tail of executeWorkflow and handle.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 ​

ACTIVITY_ALREADY_STARTED_ERROR_TAG ​

ts
const ACTIVITY_ALREADY_STARTED_ERROR_TAG: "@temporal-contract/ActivityAlreadyStartedError" = "@temporal-contract/ActivityAlreadyStartedError";

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

_tag of ActivityAlreadyStartedError — starting a standalone activity collided with a running one.


ACTIVITY_CANCELLED_ERROR_TAG ​

ts
const ACTIVITY_CANCELLED_ERROR_TAG: "@temporal-contract/ActivityCancelledError" = "@temporal-contract/ActivityCancelledError";

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

_tag of the client's ActivityCancelledError — the standalone activity ended Canceled. Deliberately the same literal as the worker package's in-workflow ActivityCancelledError tag, as for WorkflowCancelledError.


ACTIVITY_EXECUTE_PATTERNS ​

ts
const ACTIVITY_EXECUTE_PATTERNS: readonly [{
  _tag: "@temporal-contract/ActivityAlreadyStartedError";
}, {
  _tag: "@temporal-contract/ActivityValidationError";
}, {
  _tag: "@temporal-contract/ActivityFailedError";
}, {
  _tag: "@temporal-contract/ActivityCancelledError";
}, {
  _tag: "@temporal-contract/ActivityTerminatedError";
}, {
  _tag: "@temporal-contract/ActivityTimeoutError";
}, {
  _tag: "@temporal-contract/ActivityExecutionNotFoundError";
}];

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

ContractClient.executeActivity is start + result: both phases, minus the activity's own declared errors.


ACTIVITY_EXECUTION_NOT_FOUND_ERROR_TAG ​

ts
const ACTIVITY_EXECUTION_NOT_FOUND_ERROR_TAG: "@temporal-contract/ActivityExecutionNotFoundError" = "@temporal-contract/ActivityExecutionNotFoundError";

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

_tag of ActivityExecutionNotFoundError — the targeted standalone activity doesn't exist in the namespace.


ACTIVITY_FAILED_ERROR_TAG ​

ts
const ACTIVITY_FAILED_ERROR_TAG: "@temporal-contract/ActivityFailedError" = "@temporal-contract/ActivityFailedError";

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

_tag of ActivityFailedError — the standalone activity completed with a (non-outcome) failure.


ACTIVITY_RESULT_PATTERNS ​

ts
const ACTIVITY_RESULT_PATTERNS: readonly [{
  _tag: "@temporal-contract/ActivityValidationError";
}, {
  _tag: "@temporal-contract/ActivityFailedError";
}, {
  _tag: "@temporal-contract/ActivityCancelledError";
}, {
  _tag: "@temporal-contract/ActivityTerminatedError";
}, {
  _tag: "@temporal-contract/ActivityTimeoutError";
}, {
  _tag: "@temporal-contract/ActivityExecutionNotFoundError";
}];

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

The non-contract-error tail of ActivityResultErrorsOf — everything a standalone activity handle's result() can produce besides the activity's own declared errors.


ACTIVITY_START_PATTERNS ​

ts
const ACTIVITY_START_PATTERNS: readonly [{
  _tag: "@temporal-contract/ActivityValidationError";
}, {
  _tag: "@temporal-contract/ActivityAlreadyStartedError";
}];

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

Every error ContractClient.startActivity can produce: its input failed validation, or a running activity already holds this activity ID.


ACTIVITY_TERMINATED_ERROR_TAG ​

ts
const ACTIVITY_TERMINATED_ERROR_TAG: "@temporal-contract/ActivityTerminatedError" = "@temporal-contract/ActivityTerminatedError";

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

_tag of ActivityTerminatedError — the standalone activity was terminated.


ACTIVITY_TIMEOUT_ERROR_TAG ​

ts
const ACTIVITY_TIMEOUT_ERROR_TAG: "@temporal-contract/ActivityTimeoutError" = "@temporal-contract/ActivityTimeoutError";

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

_tag of ActivityTimeoutError — the standalone activity timed out.


ACTIVITY_VALIDATION_ERROR_TAG ​

ts
const ACTIVITY_VALIDATION_ERROR_TAG: "@temporal-contract/ActivityValidationError" = "@temporal-contract/ActivityValidationError";

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

_tag of ActivityValidationError — standalone activity input/output failed schema validation.


CONTRACT_ERROR_TAG ​

ts
const CONTRACT_ERROR_TAG: "@temporal-contract/ContractError" = "@temporal-contract/ContractError";

Defined in: packages/contract/dist/error-tags-B9RXZ7FP.d.mts:17

_tag of ContractError — a contract-declared typed domain error.


QUERY_FAILED_ERROR_TAG ​

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

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

_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:124

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

_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:71

_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/WorkflowValidationError";
}];

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

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

_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:118

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

_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:61

_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/UpdateRpcTimeoutOrCancelledError";
}, {
  _tag: "@temporal-contract/WorkflowExecutionNotFoundError";
}];

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

Every error a handle.updates.* call (or an update handle's result()) 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:64

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


UPDATE_RPC_TIMEOUT_OR_CANCELLED_ERROR_TAG ​

ts
const UPDATE_RPC_TIMEOUT_OR_CANCELLED_ERROR_TAG: "@temporal-contract/UpdateRpcTimeoutOrCancelledError" = "@temporal-contract/UpdateRpcTimeoutOrCancelledError";

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

_tag of UpdateRpcTimeoutOrCancelledError — the update call timed out or was cancelled client-side.


UPDATE_VALIDATION_ERROR_TAG ​

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

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

_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:21

_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:37

_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/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:95

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

_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:28

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


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

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/WorkflowValidationError";
}, {
  _tag: "@temporal-contract/WorkflowAlreadyStartedError";
}];

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

Every error ContractClient.startWorkflow can produce: its input failed validation, or an execution under this workflow ID already exists (signalWithStart adds SignalValidationError).


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

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

_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:43

_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:46

_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:101

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.