@temporal-contract/client
@temporal-contract/client
Classes
QueryValidationError
Defined in: packages/client/src/errors.ts:206
Thrown when query input or output validation fails
Extends
TaggedErrorInstance<"@temporal-contract/QueryValidationError", {direction:"input"|"output";issues: readonlyIssue[];message:string;queryName:string; }>
Constructors
Constructor
new QueryValidationError(
queryName,
direction,
issues): QueryValidationError;Defined in: packages/client/src/errors.ts:214
Parameters
| Parameter | Type |
|---|---|
queryName | string |
direction | "input" | "output" |
issues | readonly Issue[] |
Returns
Overrides
TaggedError("@temporal-contract/QueryValidationError", {
name: "QueryValidationError",
})<{
queryName: string;
direction: "input" | "output";
issues: ReadonlyArray<StandardSchemaV1.Issue>;
message: string;
}>.constructorProperties
| Property | Modifier | Type | Inherited from | Defined in |
|---|---|---|---|---|
_tag | readonly | "@temporal-contract/QueryValidationError" | TaggedError("@temporal-contract/QueryValidationError", { name: "QueryValidationError", })._tag | node_modules/.pnpm/unthrown@0.2.0/node_modules/unthrown/dist/index.d.mts:638 |
cause? | public | unknown | TaggedError("@temporal-contract/QueryValidationError", { name: "QueryValidationError", }).cause | node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2022.error.d.ts:24 |
direction | readonly | "input" | "output" | TaggedError("@temporal-contract/QueryValidationError", { name: "QueryValidationError", }).direction | packages/client/src/errors.ts:210 |
issues | readonly | readonly Issue[] | TaggedError("@temporal-contract/QueryValidationError", { name: "QueryValidationError", }).issues | packages/client/src/errors.ts:211 |
message | public | string | TaggedError("@temporal-contract/QueryValidationError", { name: "QueryValidationError", }).message | node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es5.d.ts:1075 |
name | public | string | TaggedError("@temporal-contract/QueryValidationError", { name: "QueryValidationError", }).name | node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es5.d.ts:1074 |
queryName | readonly | string | TaggedError("@temporal-contract/QueryValidationError", { name: "QueryValidationError", }).queryName | packages/client/src/errors.ts:209 |
stack? | public | string | TaggedError("@temporal-contract/QueryValidationError", { name: "QueryValidationError", }).stack | node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es5.d.ts:1076 |
RuntimeClientError
Defined in: packages/client/src/errors.ts:36
Generic runtime failure wrapper when no specific error type applies
Extends
TaggedErrorInstance<"@temporal-contract/RuntimeClientError", {cause?:unknown;message:string;operation:string; }>
Constructors
Constructor
new RuntimeClientError(operation, cause?): RuntimeClientError;Defined in: packages/client/src/errors.ts:43
Parameters
| Parameter | Type |
|---|---|
operation | string |
cause? | unknown |
Returns
Overrides
TaggedError("@temporal-contract/RuntimeClientError", {
name: "RuntimeClientError",
})<{
operation: string;
cause?: unknown;
message: string;
}>.constructorProperties
| Property | Modifier | Type | Inherited from | Defined in |
|---|---|---|---|---|
_tag | readonly | "@temporal-contract/RuntimeClientError" | TaggedError("@temporal-contract/RuntimeClientError", { name: "RuntimeClientError", })._tag | node_modules/.pnpm/unthrown@0.2.0/node_modules/unthrown/dist/index.d.mts:638 |
cause? | public | unknown | WorkflowNotFoundError.cause | node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2022.error.d.ts:24 |
message | public | string | TaggedError("@temporal-contract/RuntimeClientError", { name: "RuntimeClientError", }).message | node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es5.d.ts:1075 |
name | public | string | TaggedError("@temporal-contract/RuntimeClientError", { name: "RuntimeClientError", }).name | node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es5.d.ts:1074 |
operation | readonly | string | TaggedError("@temporal-contract/RuntimeClientError", { name: "RuntimeClientError", }).operation | packages/client/src/errors.ts:39 |
stack? | public | string | TaggedError("@temporal-contract/RuntimeClientError", { name: "RuntimeClientError", }).stack | node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es5.d.ts:1076 |
SignalValidationError
Defined in: packages/client/src/errors.ts:231
Thrown when signal input validation fails
Extends
TaggedErrorInstance<"@temporal-contract/SignalValidationError", {issues: readonlyIssue[];message:string;signalName:string; }>
Constructors
Constructor
new SignalValidationError(signalName, issues): SignalValidationError;Defined in: packages/client/src/errors.ts:238
Parameters
| Parameter | Type |
|---|---|
signalName | string |
issues | readonly Issue[] |
Returns
Overrides
TaggedError("@temporal-contract/SignalValidationError", {
name: "SignalValidationError",
})<{
signalName: string;
issues: ReadonlyArray<StandardSchemaV1.Issue>;
message: string;
}>.constructorProperties
| Property | Modifier | Type | Inherited from | Defined in |
|---|---|---|---|---|
_tag | readonly | "@temporal-contract/SignalValidationError" | TaggedError("@temporal-contract/SignalValidationError", { name: "SignalValidationError", })._tag | node_modules/.pnpm/unthrown@0.2.0/node_modules/unthrown/dist/index.d.mts:638 |
cause? | public | unknown | TaggedError("@temporal-contract/SignalValidationError", { name: "SignalValidationError", }).cause | node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2022.error.d.ts:24 |
issues | readonly | readonly Issue[] | TaggedError("@temporal-contract/SignalValidationError", { name: "SignalValidationError", }).issues | packages/client/src/errors.ts:235 |
message | public | string | TaggedError("@temporal-contract/SignalValidationError", { name: "SignalValidationError", }).message | node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es5.d.ts:1075 |
name | public | string | TaggedError("@temporal-contract/SignalValidationError", { name: "SignalValidationError", }).name | node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es5.d.ts:1074 |
signalName | readonly | string | TaggedError("@temporal-contract/SignalValidationError", { name: "SignalValidationError", }).signalName | packages/client/src/errors.ts:234 |
stack? | public | string | TaggedError("@temporal-contract/SignalValidationError", { name: "SignalValidationError", }).stack | node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es5.d.ts:1076 |
TypedClient
Defined in: packages/client/src/client.ts:349
Typed Temporal client with unthrown Result/AsyncResult pattern based on a contract
Provides type-safe methods to start and execute workflows defined in the contract, with explicit error handling using Result pattern.
Type Parameters
| Type Parameter |
|---|
TContract extends ContractDefinition |
Properties
| Property | Modifier | Type | Description | Defined in |
|---|---|---|---|---|
schedule | readonly | TypedScheduleClient<TContract> | Typed wrapper around Temporal's client.schedule.create(...) and related lifecycle methods. Fires the underlying startWorkflow action with args validated against the contract's input schema. Requires @temporalio/client 1.16+. The Schedule API was added in 1.16; on older versions this property is unset and any access throws. The package's peer dep allows the whole ^1 range to stay permissive about the installed Temporal version, so consumers on < 1.16 who never touch schedules keep working — the constructor below fails fast with a clear message for anyone who does reach for the Schedule API too early. Example const result = await client.schedule.create("processOrder", { scheduleId: "daily-sweep", spec: { cronExpressions: ["0 2 * * *"] }, args: { orderId: "sweep" }, }); await result.match({ ok: async (handle) => { await handle.pause("maintenance"); }, err: (error) => console.error("schedule create failed", error), defect: (cause) => console.error("unexpected failure", cause), }); | packages/client/src/client.ts:377 |
Methods
executeWorkflow()
executeWorkflow<TWorkflowName>(workflowName, __namedParameters): AsyncResult<ClientInferOutput<TContract["workflows"][TWorkflowName]>,
| WorkflowNotFoundError
| WorkflowValidationError
| WorkflowAlreadyStartedError
| RuntimeClientError
| WorkflowFailedError
| WorkflowExecutionNotFoundError>;Defined in: packages/client/src/client.ts:620
Execute a workflow (start and wait for result) with AsyncResult pattern
Type Parameters
| Type Parameter |
|---|
TWorkflowName extends string |
Parameters
| Parameter | Type |
|---|---|
workflowName | TWorkflowName |
__namedParameters | TypedWorkflowStartOptions<TContract, TWorkflowName> |
Returns
AsyncResult<ClientInferOutput<TContract["workflows"][TWorkflowName]>, | WorkflowNotFoundError | WorkflowValidationError | WorkflowAlreadyStartedError | RuntimeClientError | WorkflowFailedError | WorkflowExecutionNotFoundError>
Example
const result = await client.executeWorkflow('processOrder', {
workflowId: 'order-123',
args: { orderId: 'ORD-123' },
workflowExecutionTimeout: '1 day',
retry: { maximumAttempts: 3 },
});
await result.match({
ok: (output) => console.log('Order processed:', output.status),
err: (error) => console.error('Processing failed:', error),
defect: (cause) => console.error('Unexpected failure:', cause),
});getHandle()
getHandle<TWorkflowName>(workflowName, workflowId): AsyncResult<TypedWorkflowHandle<TContract["workflows"][TWorkflowName]>,
| WorkflowNotFoundError
| RuntimeClientError>;Defined in: packages/client/src/client.ts:727
Get a handle to an existing workflow with AsyncResult pattern
Type Parameters
| Type Parameter |
|---|
TWorkflowName extends string |
Parameters
| Parameter | Type |
|---|---|
workflowName | TWorkflowName |
workflowId | string |
Returns
AsyncResult<TypedWorkflowHandle<TContract["workflows"][TWorkflowName]>, | WorkflowNotFoundError | RuntimeClientError>
Example
const handleResult = await client.getHandle('processOrder', 'order-123');
handleResult.match(
async (handle) => {
const result = await handle.result();
// ... handle result
},
(error) => console.error('Failed to get handle:', error),
);signalWithStart()
signalWithStart<TWorkflowName, TSignalName>(workflowName, __namedParameters): AsyncResult<TypedWorkflowHandleWithSignaledRunId<TContract["workflows"][TWorkflowName]>,
| WorkflowNotFoundError
| WorkflowValidationError
| WorkflowAlreadyStartedError
| RuntimeClientError
| SignalValidationError>;Defined in: packages/client/src/client.ts:521
Send a signal to a workflow, starting it first if it doesn't already exist.
Validates both halves of the call against the contract:
argsagainst the workflow's input schemasignalArgsagainst the named signal's input schema
Returns a TypedWorkflowHandleWithSignaledRunId — the same shape as startWorkflow's handle, plus a signaledRunId field for correlating the signal with the (possibly pre-existing) workflow execution chain.
Type Parameters
| Type Parameter |
|---|
TWorkflowName extends string |
TSignalName extends string |
Parameters
| Parameter | Type |
|---|---|
workflowName | TWorkflowName |
__namedParameters | TypedSignalWithStartOptions<TContract, TWorkflowName, TSignalName> |
Returns
AsyncResult<TypedWorkflowHandleWithSignaledRunId<TContract["workflows"][TWorkflowName]>, | WorkflowNotFoundError | WorkflowValidationError | WorkflowAlreadyStartedError | RuntimeClientError | SignalValidationError>
Example
const result = await client.signalWithStart('processOrder', {
workflowId: 'order-123',
args: { orderId: 'ORD-123', customerId: 'CUST-1' },
signalName: 'cancel',
signalArgs: { reason: 'duplicate' },
});
await result.match({
ok: (handle) => console.log('signaled run', handle.signaledRunId),
err: (error) => console.error('signalWithStart failed', error),
defect: (cause) => console.error('unexpected failure', cause),
});startWorkflow()
startWorkflow<TWorkflowName>(workflowName, __namedParameters): AsyncResult<TypedWorkflowHandle<TContract["workflows"][TWorkflowName]>,
| WorkflowNotFoundError
| WorkflowValidationError
| WorkflowAlreadyStartedError
| RuntimeClientError>;Defined in: packages/client/src/client.ts:447
Start a workflow and return a typed handle with AsyncResult pattern
Type Parameters
| Type Parameter |
|---|
TWorkflowName extends string |
Parameters
| Parameter | Type |
|---|---|
workflowName | TWorkflowName |
__namedParameters | TypedWorkflowStartOptions<TContract, TWorkflowName> |
Returns
AsyncResult<TypedWorkflowHandle<TContract["workflows"][TWorkflowName]>, | WorkflowNotFoundError | WorkflowValidationError | WorkflowAlreadyStartedError | RuntimeClientError>
Example
const handleResult = await client.startWorkflow('processOrder', {
workflowId: 'order-123',
args: { orderId: 'ORD-123' },
workflowExecutionTimeout: '1 day',
retry: { maximumAttempts: 3 },
});
await handleResult.match({
ok: async (handle) => {
const result = await handle.result();
// ... handle result
},
err: (error) => console.error('Failed to start:', error),
defect: (cause) => console.error('Unexpected failure:', cause),
});create()
static create<TContract>(contract, client): TypedClient<TContract>;Defined in: packages/client/src/client.ts:418
Create a typed Temporal client with unthrown pattern from a contract
Type Parameters
| Type Parameter |
|---|
TContract extends ContractDefinition |
Parameters
| Parameter | Type |
|---|---|
contract | TContract |
client | Client |
Returns
TypedClient<TContract>
Example
const connection = await Connection.connect();
const temporalClient = new Client({ connection });
const client = TypedClient.create(myContract, temporalClient);
const result = await client.executeWorkflow('processOrder', {
workflowId: 'order-123',
args: { ... },
});
await result.match({
ok: (output) => console.log('Success:', output),
err: (error) => console.error('Failed:', error),
defect: (cause) => console.error('Unexpected failure:', cause),
});TypedScheduleClient
Defined in: packages/client/src/schedule.ts:109
Typed wrapper around Temporal's ScheduleClient. Exposed as typedClient.schedule — keeps the typed-client surface organized the same way Temporal's own Client.schedule does.
Type Parameters
| Type Parameter |
|---|
TContract extends ContractDefinition |
Constructors
Constructor
new TypedScheduleClient<TContract>(contract, scheduleClient): TypedScheduleClient<TContract>;Defined in: packages/client/src/schedule.ts:110
Parameters
| Parameter | Type |
|---|---|
contract | TContract |
scheduleClient | ScheduleClient |
Returns
TypedScheduleClient<TContract>
Methods
create()
create<TWorkflowName>(workflowName, options): AsyncResult<TypedScheduleHandle,
| WorkflowNotFoundError
| WorkflowValidationError
| RuntimeClientError>;Defined in: packages/client/src/schedule.ts:124
Create a new schedule that, on each fire, starts the named contract workflow with validated args.
Validates args against the workflow's input schema before dispatching the create request to Temporal. The workflow's taskQueue and workflowType are pulled from the contract automatically; the typed options shape omits them so call sites don't have to repeat themselves.
Type Parameters
| Type Parameter |
|---|
TWorkflowName extends string |
Parameters
| Parameter | Type |
|---|---|
workflowName | TWorkflowName |
options | TypedScheduleCreateOptions<TContract, TWorkflowName> |
Returns
AsyncResult<TypedScheduleHandle, | WorkflowNotFoundError | WorkflowValidationError | RuntimeClientError>
getHandle()
getHandle(scheduleId): TypedScheduleHandle;Defined in: packages/client/src/schedule.ts:209
Get a typed handle to an existing schedule. Does not validate that the schedule exists — handle methods (describe, pause, etc.) will surface a RuntimeClientError if the underlying ID is unknown.
Parameters
| Parameter | Type |
|---|---|
scheduleId | string |
Returns
UpdateValidationError
Defined in: packages/client/src/errors.ts:250
Thrown when update input or output validation fails
Extends
TaggedErrorInstance<"@temporal-contract/UpdateValidationError", {direction:"input"|"output";issues: readonlyIssue[];message:string;updateName:string; }>
Constructors
Constructor
new UpdateValidationError(
updateName,
direction,
issues): UpdateValidationError;Defined in: packages/client/src/errors.ts:258
Parameters
| Parameter | Type |
|---|---|
updateName | string |
direction | "input" | "output" |
issues | readonly Issue[] |
Returns
Overrides
TaggedError("@temporal-contract/UpdateValidationError", {
name: "UpdateValidationError",
})<{
updateName: string;
direction: "input" | "output";
issues: ReadonlyArray<StandardSchemaV1.Issue>;
message: string;
}>.constructorProperties
| Property | Modifier | Type | Inherited from | Defined in |
|---|---|---|---|---|
_tag | readonly | "@temporal-contract/UpdateValidationError" | TaggedError("@temporal-contract/UpdateValidationError", { name: "UpdateValidationError", })._tag | node_modules/.pnpm/unthrown@0.2.0/node_modules/unthrown/dist/index.d.mts:638 |
cause? | public | unknown | TaggedError("@temporal-contract/UpdateValidationError", { name: "UpdateValidationError", }).cause | node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2022.error.d.ts:24 |
direction | readonly | "input" | "output" | TaggedError("@temporal-contract/UpdateValidationError", { name: "UpdateValidationError", }).direction | packages/client/src/errors.ts:254 |
issues | readonly | readonly Issue[] | TaggedError("@temporal-contract/UpdateValidationError", { name: "UpdateValidationError", }).issues | packages/client/src/errors.ts:255 |
message | public | string | TaggedError("@temporal-contract/UpdateValidationError", { name: "UpdateValidationError", }).message | node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es5.d.ts:1075 |
name | public | string | TaggedError("@temporal-contract/UpdateValidationError", { name: "UpdateValidationError", }).name | node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es5.d.ts:1074 |
stack? | public | string | TaggedError("@temporal-contract/UpdateValidationError", { name: "UpdateValidationError", }).stack | node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es5.d.ts:1076 |
updateName | readonly | string | TaggedError("@temporal-contract/UpdateValidationError", { name: "UpdateValidationError", }).updateName | packages/client/src/errors.ts:253 |
WorkflowAlreadyStartedError
Defined in: packages/client/src/errors.ts:85
Discriminated variant of RuntimeClientError surfaced when starting a workflow collides with an existing execution — Temporal's WorkflowExecutionAlreadyStartedError. The most common cause is a workflowId reuse policy that rejects duplicates while a previous run is still in retention.
Distinguishing this from RuntimeClientError lets idempotent callers branch on it explicitly (e.g. fetch the existing handle and continue) without inspecting error.cause against a Temporal SDK class.
Extends
TaggedErrorInstance<"@temporal-contract/WorkflowAlreadyStartedError", {cause?:unknown;message:string;workflowId:string;workflowType:string; }>
Constructors
Constructor
new WorkflowAlreadyStartedError(
workflowType,
workflowId,
cause?): WorkflowAlreadyStartedError;Defined in: packages/client/src/errors.ts:94
Parameters
| Parameter | Type |
|---|---|
workflowType | string |
workflowId | string |
cause? | unknown |
Returns
Overrides
TaggedError(
"@temporal-contract/WorkflowAlreadyStartedError",
{ name: "WorkflowAlreadyStartedError" },
)<{
workflowType: string;
workflowId: string;
cause?: unknown;
message: string;
}>.constructorProperties
| Property | Modifier | Type | Inherited from | Defined in |
|---|---|---|---|---|
_tag | readonly | "@temporal-contract/WorkflowAlreadyStartedError" | TaggedError( "@temporal-contract/WorkflowAlreadyStartedError", { name: "WorkflowAlreadyStartedError" }, )._tag | node_modules/.pnpm/unthrown@0.2.0/node_modules/unthrown/dist/index.d.mts:638 |
cause? | public | unknown | WorkflowNotFoundError.cause | node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2022.error.d.ts:24 |
message | public | string | TaggedError( "@temporal-contract/WorkflowAlreadyStartedError", { name: "WorkflowAlreadyStartedError" }, ).message | node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es5.d.ts:1075 |
name | public | string | TaggedError( "@temporal-contract/WorkflowAlreadyStartedError", { name: "WorkflowAlreadyStartedError" }, ).name | node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es5.d.ts:1074 |
stack? | public | string | TaggedError( "@temporal-contract/WorkflowAlreadyStartedError", { name: "WorkflowAlreadyStartedError" }, ).stack | node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es5.d.ts:1076 |
workflowId | readonly | string | TaggedError( "@temporal-contract/WorkflowAlreadyStartedError", { name: "WorkflowAlreadyStartedError" }, ).workflowId | packages/client/src/errors.ts:90 |
workflowType | readonly | string | TaggedError( "@temporal-contract/WorkflowAlreadyStartedError", { name: "WorkflowAlreadyStartedError" }, ).workflowType | packages/client/src/errors.ts:89 |
WorkflowExecutionNotFoundError
Defined in: packages/client/src/errors.ts:116
Discriminated variant of RuntimeClientError surfaced when an operation targets a workflow execution that doesn't exist in the namespace — Temporal's WorkflowNotFoundError (distinct from this package's contract-level WorkflowNotFoundError).
Returned from:
- handle methods:
signal,query,executeUpdate,result,terminate,cancel,describe,fetchHistory executeWorkflow(when the underlying execute call hits a missing execution mid-flight)
Extends
TaggedErrorInstance<"@temporal-contract/WorkflowExecutionNotFoundError", {cause?:unknown;message:string;runId?:string;workflowId:string; }>
Constructors
Constructor
new WorkflowExecutionNotFoundError(
workflowId,
runId?,
cause?): WorkflowExecutionNotFoundError;Defined in: packages/client/src/errors.ts:125
Parameters
| Parameter | Type |
|---|---|
workflowId | string |
runId? | string |
cause? | unknown |
Returns
WorkflowExecutionNotFoundError
Overrides
TaggedError(
"@temporal-contract/WorkflowExecutionNotFoundError",
{ name: "WorkflowExecutionNotFoundError" },
)<{
workflowId: string;
runId?: string | undefined;
cause?: unknown;
message: string;
}>.constructorProperties
| Property | Modifier | Type | Inherited from | Defined in |
|---|---|---|---|---|
_tag | readonly | "@temporal-contract/WorkflowExecutionNotFoundError" | TaggedError( "@temporal-contract/WorkflowExecutionNotFoundError", { name: "WorkflowExecutionNotFoundError" }, )._tag | node_modules/.pnpm/unthrown@0.2.0/node_modules/unthrown/dist/index.d.mts:638 |
cause? | public | unknown | WorkflowNotFoundError.cause | node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2022.error.d.ts:24 |
message | public | string | TaggedError( "@temporal-contract/WorkflowExecutionNotFoundError", { name: "WorkflowExecutionNotFoundError" }, ).message | node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es5.d.ts:1075 |
name | public | string | TaggedError( "@temporal-contract/WorkflowExecutionNotFoundError", { name: "WorkflowExecutionNotFoundError" }, ).name | node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es5.d.ts:1074 |
runId? | readonly | string | TaggedError( "@temporal-contract/WorkflowExecutionNotFoundError", { name: "WorkflowExecutionNotFoundError" }, ).runId | packages/client/src/errors.ts:121 |
stack? | public | string | TaggedError( "@temporal-contract/WorkflowExecutionNotFoundError", { name: "WorkflowExecutionNotFoundError" }, ).stack | node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es5.d.ts:1076 |
workflowId | readonly | string | TaggedError( "@temporal-contract/WorkflowExecutionNotFoundError", { name: "WorkflowExecutionNotFoundError" }, ).workflowId | packages/client/src/errors.ts:120 |
WorkflowFailedError
Defined in: packages/client/src/errors.ts:154
Discriminated variant of RuntimeClientError surfaced when waiting on a workflow's result and the workflow completes with a failure — Temporal's WorkflowFailedError.
cause is the unwrapped underlying TemporalFailure (typically an ApplicationFailure, CancelledFailure, TerminatedFailure, or TimeoutFailure) lifted from Temporal's wrapper, so callers can branch on the failure category in one step (err.cause instanceof ApplicationFailure) instead of unwrapping twice via the SDK wrapper. The SDK declares WorkflowFailedError.cause as the wider Error | undefined (since cause lives on Error), but the runtime guarantee — driven by Temporal's wire format — is that it is always a TemporalFailure subclass when the wrapper is surfaced. classifyResultError narrows that wider static type to the public TemporalFailure union with a cast, so consumers see the precise leaf-failure typing instead of a bare Error.
Returned from executeWorkflow and handle.result().
Extends
TaggedErrorInstance<"@temporal-contract/WorkflowFailedError", {cause?:TemporalFailure;message:string;workflowId:string; }>
Constructors
Constructor
new WorkflowFailedError(workflowId, cause?): WorkflowFailedError;Defined in: packages/client/src/errors.ts:161
Parameters
| Parameter | Type |
|---|---|
workflowId | string |
cause? | TemporalFailure |
Returns
Overrides
TaggedError("@temporal-contract/WorkflowFailedError", {
name: "WorkflowFailedError",
})<{
workflowId: string;
cause?: TemporalFailure | undefined;
message: string;
}>.constructorProperties
| Property | Modifier | Type | Inherited from | Defined in |
|---|---|---|---|---|
_tag | readonly | "@temporal-contract/WorkflowFailedError" | TaggedError("@temporal-contract/WorkflowFailedError", { name: "WorkflowFailedError", })._tag | node_modules/.pnpm/unthrown@0.2.0/node_modules/unthrown/dist/index.d.mts:638 |
cause? | public | TemporalFailure | WorkflowNotFoundError.cause | node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2022.error.d.ts:24 |
message | public | string | TaggedError("@temporal-contract/WorkflowFailedError", { name: "WorkflowFailedError", }).message | node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es5.d.ts:1075 |
name | public | string | TaggedError("@temporal-contract/WorkflowFailedError", { name: "WorkflowFailedError", }).name | node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es5.d.ts:1074 |
stack? | public | string | TaggedError("@temporal-contract/WorkflowFailedError", { name: "WorkflowFailedError", }).stack | node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es5.d.ts:1076 |
workflowId | readonly | string | TaggedError("@temporal-contract/WorkflowFailedError", { name: "WorkflowFailedError", }).workflowId | packages/client/src/errors.ts:157 |
WorkflowNotFoundError
Defined in: packages/client/src/errors.ts:58
Thrown when a workflow is not found in the contract
Extends
TaggedErrorInstance<"@temporal-contract/WorkflowNotFoundError", {availableWorkflows:string[];message:string;workflowName:string; }>
Constructors
Constructor
new WorkflowNotFoundError(workflowName, availableWorkflows): WorkflowNotFoundError;Defined in: packages/client/src/errors.ts:65
Parameters
| Parameter | Type |
|---|---|
workflowName | string |
availableWorkflows | string[] |
Returns
Overrides
TaggedError("@temporal-contract/WorkflowNotFoundError", {
name: "WorkflowNotFoundError",
})<{
workflowName: string;
availableWorkflows: string[];
message: string;
}>.constructorProperties
| Property | Modifier | Type | Inherited from | Defined in |
|---|---|---|---|---|
_tag | readonly | "@temporal-contract/WorkflowNotFoundError" | TaggedError("@temporal-contract/WorkflowNotFoundError", { name: "WorkflowNotFoundError", })._tag | node_modules/.pnpm/unthrown@0.2.0/node_modules/unthrown/dist/index.d.mts:638 |
availableWorkflows | readonly | string[] | TaggedError("@temporal-contract/WorkflowNotFoundError", { name: "WorkflowNotFoundError", }).availableWorkflows | packages/client/src/errors.ts:62 |
cause? | public | unknown | TaggedError("@temporal-contract/WorkflowNotFoundError", { name: "WorkflowNotFoundError", }).cause | node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2022.error.d.ts:24 |
message | public | string | TaggedError("@temporal-contract/WorkflowNotFoundError", { name: "WorkflowNotFoundError", }).message | node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es5.d.ts:1075 |
name | public | string | TaggedError("@temporal-contract/WorkflowNotFoundError", { name: "WorkflowNotFoundError", }).name | node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es5.d.ts:1074 |
stack? | public | string | TaggedError("@temporal-contract/WorkflowNotFoundError", { name: "WorkflowNotFoundError", }).stack | node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es5.d.ts:1076 |
workflowName | readonly | string | TaggedError("@temporal-contract/WorkflowNotFoundError", { name: "WorkflowNotFoundError", }).workflowName | packages/client/src/errors.ts:61 |
WorkflowValidationError
Defined in: packages/client/src/errors.ts:180
Thrown when workflow input or output validation fails
Extends
TaggedErrorInstance<"@temporal-contract/WorkflowValidationError", {direction:"input"|"output";issues: readonlyIssue[];message:string;workflowName:string; }>
Constructors
Constructor
new WorkflowValidationError(
workflowName,
direction,
issues): WorkflowValidationError;Defined in: packages/client/src/errors.ts:189
Parameters
| Parameter | Type |
|---|---|
workflowName | string |
direction | "input" | "output" |
issues | readonly Issue[] |
Returns
Overrides
TaggedError(
"@temporal-contract/WorkflowValidationError",
{ name: "WorkflowValidationError" },
)<{
workflowName: string;
direction: "input" | "output";
issues: ReadonlyArray<StandardSchemaV1.Issue>;
message: string;
}>.constructorProperties
| Property | Modifier | Type | Inherited from | Defined in |
|---|---|---|---|---|
_tag | readonly | "@temporal-contract/WorkflowValidationError" | TaggedError( "@temporal-contract/WorkflowValidationError", { name: "WorkflowValidationError" }, )._tag | node_modules/.pnpm/unthrown@0.2.0/node_modules/unthrown/dist/index.d.mts:638 |
cause? | public | unknown | TaggedError( "@temporal-contract/WorkflowValidationError", { name: "WorkflowValidationError" }, ).cause | node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2022.error.d.ts:24 |
direction | readonly | "input" | "output" | TaggedError( "@temporal-contract/WorkflowValidationError", { name: "WorkflowValidationError" }, ).direction | packages/client/src/errors.ts:185 |
issues | readonly | readonly Issue[] | TaggedError( "@temporal-contract/WorkflowValidationError", { name: "WorkflowValidationError" }, ).issues | packages/client/src/errors.ts:186 |
message | public | string | TaggedError( "@temporal-contract/WorkflowValidationError", { name: "WorkflowValidationError" }, ).message | node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es5.d.ts:1075 |
name | public | string | TaggedError( "@temporal-contract/WorkflowValidationError", { name: "WorkflowValidationError" }, ).name | node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es5.d.ts:1074 |
stack? | public | string | TaggedError( "@temporal-contract/WorkflowValidationError", { name: "WorkflowValidationError" }, ).stack | node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es5.d.ts:1076 |
workflowName | readonly | string | TaggedError( "@temporal-contract/WorkflowValidationError", { name: "WorkflowValidationError" }, ).workflowName | packages/client/src/errors.ts:184 |
Type Aliases
ClientInferActivities
type ClientInferActivities<TContract> = TContract["activities"] extends Record<string, ActivityDefinition> ? { [K in keyof TContract["activities"]]: ClientInferActivity<TContract["activities"][K]> } : object;Defined in: packages/client/src/types.ts:88
Infer all activities from a contract (client perspective)
Type Parameters
| Type Parameter |
|---|
TContract extends ContractDefinition |
ClientInferActivity
type ClientInferActivity<TActivity> = (args) => Promise<ClientInferOutput<TActivity>>;Defined in: packages/client/src/types.ts:46
Infer activity function signature from client perspective Client sends z.output and receives z.input
Type Parameters
| Type Parameter |
|---|
TActivity extends ActivityDefinition |
Parameters
| Parameter | Type |
|---|---|
args | ClientInferInput<TActivity> |
Returns
Promise<ClientInferOutput<TActivity>>
ClientInferInput
type ClientInferInput<T> = StandardSchemaV1.InferInput<T["input"]>;Defined in: packages/client/src/types.ts:17
Infer input type from a definition (client perspective) Client sends the input type (before input schema parsing/transformation)
Type Parameters
| Type Parameter |
|---|
T extends object |
ClientInferOutput
type ClientInferOutput<T> = StandardSchemaV1.InferOutput<T["output"]>;Defined in: packages/client/src/types.ts:25
Infer output type from a definition (client perspective) Client receives the output type (after output schema parsing/transformation)
Type Parameters
| Type Parameter |
|---|
T extends object |
ClientInferQuery
type ClientInferQuery<TQuery> = (args) => AsyncResult<ClientInferOutput<TQuery>, Error>;Defined in: packages/client/src/types.ts:62
Infer query handler signature from client perspective Client sends z.output and receives z.input wrapped in AsyncResult<T, Error>
Type Parameters
| Type Parameter |
|---|
TQuery extends QueryDefinition |
Parameters
| Parameter | Type |
|---|---|
args | ClientInferInput<TQuery> |
Returns
AsyncResult<ClientInferOutput<TQuery>, Error>
ClientInferSignal
type ClientInferSignal<TSignal> = (args) => AsyncResult<void, Error>;Defined in: packages/client/src/types.ts:54
Infer signal handler signature from client perspective Client sends z.output and returns AsyncResult<void, Error>
Type Parameters
| Type Parameter |
|---|
TSignal extends SignalDefinition |
Parameters
| Parameter | Type |
|---|---|
args | ClientInferInput<TSignal> |
Returns
AsyncResult<void, Error>
ClientInferUpdate
type ClientInferUpdate<TUpdate> = (args) => AsyncResult<ClientInferOutput<TUpdate>, Error>;Defined in: packages/client/src/types.ts:70
Infer update handler signature from client perspective Client sends z.output and receives z.input wrapped in AsyncResult<T, Error>
Type Parameters
| Type Parameter |
|---|
TUpdate extends UpdateDefinition |
Parameters
| Parameter | Type |
|---|---|
args | ClientInferInput<TUpdate> |
Returns
AsyncResult<ClientInferOutput<TUpdate>, Error>
ClientInferWorkflow
type ClientInferWorkflow<TWorkflow> = (args) => Promise<ClientInferOutput<TWorkflow>>;Defined in: packages/client/src/types.ts:38
Infer workflow function signature from client perspective Client sends z.output and receives z.input
Type Parameters
| Type Parameter |
|---|
TWorkflow extends AnyWorkflowDefinition |
Parameters
| Parameter | Type |
|---|---|
args | ClientInferInput<TWorkflow> |
Returns
Promise<ClientInferOutput<TWorkflow>>
ClientInferWorkflowActivities
type ClientInferWorkflowActivities<T> = T["activities"] extends Record<string, ActivityDefinition> ? { [K in keyof T["activities"]]: ClientInferActivity<T["activities"][K]> } : object;Defined in: packages/client/src/types.ts:98
Infer activities from a workflow definition (client perspective)
Type Parameters
| Type Parameter |
|---|
T extends AnyWorkflowDefinition |
ClientInferWorkflowContextActivities
type ClientInferWorkflowContextActivities<TContract, TWorkflowName> = ClientInferWorkflowActivities<TContract["workflows"][TWorkflowName]> & ClientInferActivities<TContract>;Defined in: packages/client/src/types.ts:139
Infer all activities available in a workflow context (client perspective) Combines workflow-specific activities with global activities
Type Parameters
| Type Parameter |
|---|
TContract extends ContractDefinition |
TWorkflowName extends keyof TContract["workflows"] & string |
ClientInferWorkflowQueries
type ClientInferWorkflowQueries<T> = T["queries"] extends Record<string, QueryDefinition> ? { [K in keyof T["queries"]]: ClientInferQuery<T["queries"][K]> } : object;Defined in: packages/client/src/types.ts:118
Infer queries from a workflow definition (client perspective)
Type Parameters
| Type Parameter |
|---|
T extends AnyWorkflowDefinition |
ClientInferWorkflows
type ClientInferWorkflows<TContract> = { [K in keyof TContract["workflows"]]: ClientInferWorkflow<TContract["workflows"][K]> };Defined in: packages/client/src/types.ts:81
Infer all workflows from a contract (client perspective)
Type Parameters
| Type Parameter |
|---|
TContract extends ContractDefinition |
ClientInferWorkflowSignals
type ClientInferWorkflowSignals<T> = T["signals"] extends Record<string, SignalDefinition> ? { [K in keyof T["signals"]]: ClientInferSignal<T["signals"][K]> } : object;Defined in: packages/client/src/types.ts:108
Infer signals from a workflow definition (client perspective)
Type Parameters
| Type Parameter |
|---|
T extends AnyWorkflowDefinition |
ClientInferWorkflowUpdates
type ClientInferWorkflowUpdates<T> = T["updates"] extends Record<string, UpdateDefinition> ? { [K in keyof T["updates"]]: ClientInferUpdate<T["updates"][K]> } : object;Defined in: packages/client/src/types.ts:128
Infer updates from a workflow definition (client perspective)
Type Parameters
| Type Parameter |
|---|
T extends AnyWorkflowDefinition |
TemporalFailure
type TemporalFailure =
| ApplicationFailure
| CancelledFailure
| TerminatedFailure
| TimeoutFailure
| ChildWorkflowFailure
| ServerFailure
| ActivityFailure;Defined in: packages/client/src/errors.ts:24
Union of the actionable Temporal failure types that can surface as the cause of a WorkflowFailedError. These all extend Temporal's internal TemporalFailure base class — we list them by leaf type rather than by the base class so consumer code can use a single switch (true) over instanceof discriminants without an exhaustiveness escape hatch.
Re-exported from the package entry point so consumers can import it directly: import type { TemporalFailure } from "@temporal-contract/client".
TypedScheduleActionOverrides
type TypedScheduleActionOverrides = Pick<ScheduleOptionsStartWorkflowAction<never>,
| "workflowId"
| "workflowExecutionTimeout"
| "workflowRunTimeout"
| "workflowTaskTimeout"
| "retry"
| "memo"
| "staticDetails"
| "staticSummary">;Defined in: packages/client/src/schedule.ts:27
Workflow-action–level overrides forwarded to Temporal's ScheduleOptionsStartWorkflowAction. These live under a nested action field so the workflow-level memo (per-action workflow metadata) can be set independently from the schedule-level memo (metadata on the schedule itself) — Temporal honours both, and they have separate lifecycles.
workflowType and taskQueue are owned by the contract and not exposed.
TypedScheduleCreateOptions
type TypedScheduleCreateOptions<TContract, TWorkflowName> = object;Defined in: packages/client/src/schedule.ts:48
Options for TypedScheduleClient.create.
scheduleId and spec come from Temporal's ScheduleOptions. args is typed against the destination workflow's input schema. policies, state, and memo mirror Temporal's own schedule-level options. Workflow-action–level overrides nest under action so memo and other fields with the same name don't collide between the two scopes.
Type Parameters
| Type Parameter |
|---|
TContract extends ContractDefinition |
TWorkflowName extends keyof TContract["workflows"] & string |
Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
action? | TypedScheduleActionOverrides | Workflow-action–level overrides. workflowType and taskQueue are derived from the contract, so they don't appear here. Note that action.memo is a workflow-level memo applied to each spawned run, distinct from the top-level memo (which is metadata on the schedule itself). | packages/client/src/schedule.ts:80 |
args | ClientInferInput<TContract["workflows"][TWorkflowName]> | Workflow input — validated against the contract's input schema. | packages/client/src/schedule.ts:57 |
memo? | ScheduleOptions["memo"] | Schedule-level memo (non-indexed metadata on the schedule itself). | packages/client/src/schedule.ts:72 |
policies? | ScheduleOptions["policies"] | Temporal schedule policies (overlap, catchupWindow, pauseOnFailure, etc.). | packages/client/src/schedule.ts:68 |
scheduleId | string | Schedule ID. Recommended to use a meaningful business identifier. | packages/client/src/schedule.ts:53 |
searchAttributes? | TypedSearchAttributeMap<TContract["workflows"][TWorkflowName]> | Indexed search attributes for each workflow run spawned by this schedule. Keys and value types are constrained to those declared on the destination workflow's contract via defineSearchAttribute. Translated to Temporal's typedSearchAttributes and attached to the schedule's startWorkflow action so each spawned run is indexed identically to one started directly via client.startWorkflow. | packages/client/src/schedule.ts:66 |
spec | ScheduleSpec | When the schedule should fire (cron, interval, calendar). | packages/client/src/schedule.ts:55 |
state? | ScheduleOptions["state"] | Temporal schedule state (paused, note, limited, etc.). | packages/client/src/schedule.ts:70 |
TypedScheduleHandle
type TypedScheduleHandle = object;Defined in: packages/client/src/schedule.ts:89
Typed handle to a schedule. Mirrors Temporal's ScheduleHandle lifecycle methods (pause, unpause, trigger, describe, delete) wrapped in the unthrown AsyncResult pattern so call sites match the rest of the typed client.
Properties
| Property | Modifier | Type | Description | Defined in |
|---|---|---|---|---|
delete | public | () => AsyncResult<void, RuntimeClientError> | Delete the schedule. | packages/client/src/schedule.ts:99 |
describe | public | () => AsyncResult<ScheduleDescription, RuntimeClientError> | Fetch the schedule's current description from the server. | packages/client/src/schedule.ts:101 |
pause | public | (note?) => AsyncResult<void, RuntimeClientError> | Pause the schedule. Optional note becomes part of the audit trail. | packages/client/src/schedule.ts:93 |
scheduleId | readonly | string | This schedule's identifier. | packages/client/src/schedule.ts:91 |
trigger | public | (overlap?) => AsyncResult<void, RuntimeClientError> | Fire the schedule's action immediately. | packages/client/src/schedule.ts:97 |
unpause | public | (note?) => AsyncResult<void, RuntimeClientError> | Resume a paused schedule. | packages/client/src/schedule.ts:95 |
TypedSearchAttributeMap
type TypedSearchAttributeMap<TWorkflow> = TWorkflow["searchAttributes"] extends Record<string, SearchAttributeDefinition> ? { [K in keyof TWorkflow["searchAttributes"]]?: SearchAttributeKindToType<TWorkflow["searchAttributes"][K]["kind"]> } : never;Defined in: packages/client/src/client.ts:57
Typed searchAttributes map for a workflow, derived from the workflow's declared searchAttributes. Each key is constrained to a declared attribute name; each value's type is determined by the attribute's kind (e.g. KEYWORD → string, INT → number, DATETIME → Date, KEYWORD_LIST → string[]).
If the workflow declares no search attributes, this resolves to never, meaning the searchAttributes field is effectively absent from the start options for that workflow.
Type Parameters
| Type Parameter |
|---|
TWorkflow extends AnyWorkflowDefinition |
TypedSignalWithStartOptions
type TypedSignalWithStartOptions<TContract, TWorkflowName, TSignalName> = Omit<WorkflowSignalWithStartOptions,
| "taskQueue"
| "args"
| "signal"
| "signalArgs"
| "searchAttributes"
| "typedSearchAttributes"> & object;Defined in: packages/client/src/client.ts:136
Options for TypedClient.signalWithStart — typed against both the workflow's input schema and the named signal's input schema.
Type Declaration
| Name | Type | Description | Defined in |
|---|---|---|---|
args | ClientInferInput<TContract["workflows"][TWorkflowName]> | - | packages/client/src/client.ts:144 |
searchAttributes? | TypedSearchAttributeMap<TContract["workflows"][TWorkflowName]> | Indexed search attributes for the started workflow. Keys and value types are constrained to those declared on the workflow's contract via defineSearchAttribute. Translated to Temporal's typedSearchAttributes before the signalWithStart request is dispatched. | packages/client/src/client.ts:155 |
signalArgs | TContract["workflows"][TWorkflowName]["signals"][TSignalName] extends SignalDefinition ? ClientInferInput<TContract["workflows"][TWorkflowName]["signals"][TSignalName]> : never | - | packages/client/src/client.ts:146 |
signalName | TSignalName | - | packages/client/src/client.ts:145 |
Type Parameters
| Type Parameter |
|---|
TContract extends ContractDefinition |
TWorkflowName extends keyof TContract["workflows"] & string |
TSignalName extends SignalNamesOf<TContract["workflows"][TWorkflowName]> |
TypedWorkflowHandle
type TypedWorkflowHandle<TWorkflow> = object;Defined in: packages/client/src/client.ts:176
Typed workflow handle with validated results using unthrown Result/AsyncResult
Type Parameters
| Type Parameter |
|---|
TWorkflow extends AnyWorkflowDefinition |
Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
cancel | () => AsyncResult<void, | WorkflowExecutionNotFoundError | RuntimeClientError> | Cancel workflow with Result pattern | packages/client/src/client.ts:251 |
describe | () => AsyncResult<Awaited<ReturnType<WorkflowHandle["describe"]>>, | WorkflowExecutionNotFoundError | RuntimeClientError> | Get workflow execution description including status and metadata | packages/client/src/client.ts:256 |
fetchHistory | () => AsyncResult<Awaited<ReturnType<WorkflowHandle["fetchHistory"]>>, | WorkflowExecutionNotFoundError | RuntimeClientError> | Fetch the workflow execution history | packages/client/src/client.ts:264 |
queries | { [K in keyof ClientInferWorkflowQueries<TWorkflow>]: ClientInferWorkflowQueries<TWorkflow>[K] extends (args: infer Args) => AsyncResult<infer R, Error> ? (args: Args) => AsyncResult<R, QueryValidationError | WorkflowExecutionNotFoundError | RuntimeClientError> : never } | Type-safe queries based on workflow definition with Result pattern Each query returns AsyncResult<T, Error> instead of Promise<T> | packages/client/src/client.ts:183 |
result | () => AsyncResult<ClientInferOutput<TWorkflow>, | WorkflowValidationError | WorkflowFailedError | WorkflowExecutionNotFoundError | RuntimeClientError> | Get workflow result with Result pattern | packages/client/src/client.ts:233 |
signals | { [K in keyof ClientInferWorkflowSignals<TWorkflow>]: ClientInferWorkflowSignals<TWorkflow>[K] extends (args: infer Args) => AsyncResult<void, Error> ? (args: Args) => AsyncResult<void, SignalValidationError | WorkflowExecutionNotFoundError | RuntimeClientError> : never } | Type-safe signals based on workflow definition with Result pattern Each signal returns AsyncResult<void, Error> instead of Promise<void> | packages/client/src/client.ts:200 |
terminate | (reason?) => AsyncResult<void, | WorkflowExecutionNotFoundError | RuntimeClientError> | Terminate workflow with Result pattern | packages/client/src/client.ts:244 |
updates | { [K in keyof ClientInferWorkflowUpdates<TWorkflow>]: ClientInferWorkflowUpdates<TWorkflow>[K] extends (args: infer Args) => AsyncResult<infer R, Error> ? (args: Args) => AsyncResult<R, UpdateValidationError | WorkflowExecutionNotFoundError | RuntimeClientError> : never } | Type-safe updates based on workflow definition with Result pattern Each update returns AsyncResult<T, Error> instead of Promise<T> | packages/client/src/client.ts:217 |
workflowId | string | - | packages/client/src/client.ts:177 |
TypedWorkflowHandleWithSignaledRunId
type TypedWorkflowHandleWithSignaledRunId<TWorkflow> = TypedWorkflowHandle<TWorkflow> & object;Defined in: packages/client/src/client.ts:163
Typed workflow handle returned by signalWithStart. Adds signaledRunId to the standard handle so callers can correlate the signal with the (possibly pre-existing) workflow execution chain.
Type Declaration
| Name | Type | Description | Defined in |
|---|---|---|---|
signaledRunId | string | The Run Id of the bound Workflow at the time of signalWithStart. Since signalWithStart may have signaled an existing Workflow Chain, this is not necessarily the firstExecutionRunId. | packages/client/src/client.ts:170 |
Type Parameters
| Type Parameter |
|---|
TWorkflow extends AnyWorkflowDefinition |
TypedWorkflowStartOptions
type TypedWorkflowStartOptions<TContract, TWorkflowName> = Omit<WorkflowStartOptions, "taskQueue" | "args" | "searchAttributes" | "typedSearchAttributes"> & object;Defined in: packages/client/src/client.ts:115
Type Declaration
| Name | Type | Description | Defined in |
|---|---|---|---|
args | ClientInferInput<TContract["workflows"][TWorkflowName]> | - | packages/client/src/client.ts:122 |
searchAttributes? | TypedSearchAttributeMap<TContract["workflows"][TWorkflowName]> | Indexed search attributes for the started workflow. Keys and value types are constrained to those declared on the workflow's contract via defineSearchAttribute. Translated to Temporal's typedSearchAttributes before the start request is dispatched. | packages/client/src/client.ts:129 |
Type Parameters
| Type Parameter |
|---|
TContract extends ContractDefinition |
TWorkflowName extends keyof TContract["workflows"] & string |
Functions
readTypedSearchAttributes()
function readTypedSearchAttributes<TWorkflow>(workflowDef, instance): Partial<TypedSearchAttributeMap<TWorkflow>>;Defined in: packages/client/src/client.ts:95
Read declared search attributes off a TypedSearchAttributes instance — the read-side counterpart to the write-side searchAttributes option on startWorkflow / signalWithStart / executeWorkflow / schedule.create.
Use it on the result of handle.describe() (or a schedule's describe) to recover the typed shape of indexed attributes. The Temporal SDK only exposes a .get(key) accessor on TypedSearchAttributes and requires the caller to reconstruct each SearchAttributeKey from the contract's declared kind — this helper does that lookup once for every declared attribute, returning a Partial<TypedSearchAttributeMap<TWorkflow>> (each declared key may or may not have been set on the workflow).
Workflows without declared searchAttributes get an empty object back.
Type Parameters
| Type Parameter |
|---|
TWorkflow extends AnyWorkflowDefinition |
Parameters
| Parameter | Type |
|---|---|
workflowDef | TWorkflow |
instance | TypedSearchAttributes |
Returns
Partial<TypedSearchAttributeMap<TWorkflow>>
Example
const description = await handle.describe();
if (description.isOk()) {
const attrs = readTypedSearchAttributes(
myContract.workflows.processOrder,
description.value.typedSearchAttributes,
);
// attrs.customerId: string | undefined
// attrs.priority: number | undefined
}