@temporal-contract/client
@temporal-contract/client
Classes
QueryValidationError
Defined in: packages/client/src/errors.ts:64
Thrown when query input or output validation fails
Extends
TypedClientError
Constructors
Constructor
new QueryValidationError(
queryName,
direction,
issues): QueryValidationError;Defined in: packages/client/src/errors.ts:65
Parameters
| Parameter | Type |
|---|---|
queryName | string |
direction | "output" | "input" |
issues | readonly Issue[] |
Returns
Overrides
TypedClientError.constructorProperties
| Property | Modifier | Type | Description | Inherited from | Defined in |
|---|---|---|---|---|---|
cause? | public | unknown | - | TypedClientError.cause | node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2022.error.d.ts:26 |
direction | readonly | "output" | "input" | - | - | packages/client/src/errors.ts:67 |
issues | readonly | readonly Issue[] | - | - | packages/client/src/errors.ts:68 |
message | public | string | - | TypedClientError.message | node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es5.d.ts:1077 |
name | public | string | - | TypedClientError.name | node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es5.d.ts:1076 |
queryName | readonly | string | - | - | packages/client/src/errors.ts:66 |
stack? | public | string | - | TypedClientError.stack | node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es5.d.ts:1078 |
stackTraceLimit | static | number | The Error.stackTraceLimit property specifies the number of stack frames collected by a stack trace (whether generated by new Error().stack or Error.captureStackTrace(obj)). The default value is 10 but may be set to any valid JavaScript number. Changes will affect any stack trace captured after the value has been changed. If set to a non-number value, or set to a negative number, stack traces will not capture any frames. | TypedClientError.stackTraceLimit | node_modules/.pnpm/@types+node@25.3.2/node_modules/@types/node/globals.d.ts:67 |
Methods
captureStackTrace()
static captureStackTrace(targetObject, constructorOpt?): void;Defined in: node_modules/.pnpm/@types+node@25.3.2/node_modules/@types/node/globals.d.ts:51
Creates a .stack property on targetObject, which when accessed returns a string representing the location in the code at which Error.captureStackTrace() was called.
const myObject = {};
Error.captureStackTrace(myObject);
myObject.stack; // Similar to `new Error().stack`The first line of the trace will be prefixed with ${myObject.name}: ${myObject.message}.
The optional constructorOpt argument accepts a function. If given, all frames above constructorOpt, including constructorOpt, will be omitted from the generated stack trace.
The constructorOpt argument is useful for hiding implementation details of error generation from the user. For instance:
function a() {
b();
}
function b() {
c();
}
function c() {
// Create an error without stack trace to avoid calculating the stack trace twice.
const { stackTraceLimit } = Error;
Error.stackTraceLimit = 0;
const error = new Error();
Error.stackTraceLimit = stackTraceLimit;
// Capture the stack trace above function b
Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace
throw error;
}
a();Parameters
| Parameter | Type |
|---|---|
targetObject | object |
constructorOpt? | Function |
Returns
void
Inherited from
TypedClientError.captureStackTraceprepareStackTrace()
static prepareStackTrace(err, stackTraces): any;Defined in: node_modules/.pnpm/@types+node@25.3.2/node_modules/@types/node/globals.d.ts:55
Parameters
| Parameter | Type |
|---|---|
err | Error |
stackTraces | CallSite[] |
Returns
any
See
https://v8.dev/docs/stack-trace-api#customizing-stack-traces
Inherited from
TypedClientError.prepareStackTraceSignalValidationError
Defined in: packages/client/src/errors.ts:77
Thrown when signal input validation fails
Extends
TypedClientError
Constructors
Constructor
new SignalValidationError(signalName, issues): SignalValidationError;Defined in: packages/client/src/errors.ts:78
Parameters
| Parameter | Type |
|---|---|
signalName | string |
issues | readonly Issue[] |
Returns
Overrides
TypedClientError.constructorProperties
| Property | Modifier | Type | Description | Inherited from | Defined in |
|---|---|---|---|---|---|
cause? | public | unknown | - | TypedClientError.cause | node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2022.error.d.ts:26 |
issues | readonly | readonly Issue[] | - | - | packages/client/src/errors.ts:80 |
message | public | string | - | TypedClientError.message | node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es5.d.ts:1077 |
name | public | string | - | TypedClientError.name | node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es5.d.ts:1076 |
signalName | readonly | string | - | - | packages/client/src/errors.ts:79 |
stack? | public | string | - | TypedClientError.stack | node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es5.d.ts:1078 |
stackTraceLimit | static | number | The Error.stackTraceLimit property specifies the number of stack frames collected by a stack trace (whether generated by new Error().stack or Error.captureStackTrace(obj)). The default value is 10 but may be set to any valid JavaScript number. Changes will affect any stack trace captured after the value has been changed. If set to a non-number value, or set to a negative number, stack traces will not capture any frames. | TypedClientError.stackTraceLimit | node_modules/.pnpm/@types+node@25.3.2/node_modules/@types/node/globals.d.ts:67 |
Methods
captureStackTrace()
static captureStackTrace(targetObject, constructorOpt?): void;Defined in: node_modules/.pnpm/@types+node@25.3.2/node_modules/@types/node/globals.d.ts:51
Creates a .stack property on targetObject, which when accessed returns a string representing the location in the code at which Error.captureStackTrace() was called.
const myObject = {};
Error.captureStackTrace(myObject);
myObject.stack; // Similar to `new Error().stack`The first line of the trace will be prefixed with ${myObject.name}: ${myObject.message}.
The optional constructorOpt argument accepts a function. If given, all frames above constructorOpt, including constructorOpt, will be omitted from the generated stack trace.
The constructorOpt argument is useful for hiding implementation details of error generation from the user. For instance:
function a() {
b();
}
function b() {
c();
}
function c() {
// Create an error without stack trace to avoid calculating the stack trace twice.
const { stackTraceLimit } = Error;
Error.stackTraceLimit = 0;
const error = new Error();
Error.stackTraceLimit = stackTraceLimit;
// Capture the stack trace above function b
Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace
throw error;
}
a();Parameters
| Parameter | Type |
|---|---|
targetObject | object |
constructorOpt? | Function |
Returns
void
Inherited from
TypedClientError.captureStackTraceprepareStackTrace()
static prepareStackTrace(err, stackTraces): any;Defined in: node_modules/.pnpm/@types+node@25.3.2/node_modules/@types/node/globals.d.ts:55
Parameters
| Parameter | Type |
|---|---|
err | Error |
stackTraces | CallSite[] |
Returns
any
See
https://v8.dev/docs/stack-trace-api#customizing-stack-traces
Inherited from
TypedClientError.prepareStackTraceTypedClient
Defined in: packages/client/src/client.ts:115
Typed Temporal client with Result/Future 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 |
Methods
executeWorkflow()
executeWorkflow<TWorkflowName>(workflowName, __namedParameters): Future<Result<ClientInferOutput<TContract["workflows"][TWorkflowName]>,
| WorkflowNotFoundError
| WorkflowValidationError
| RuntimeClientError>>;Defined in: packages/client/src/client.ts:235
Execute a workflow (start and wait for result) with Future/Result pattern
Type Parameters
| Type Parameter |
|---|
TWorkflowName extends string | number | symbol |
Parameters
| Parameter | Type |
|---|---|
workflowName | TWorkflowName |
__namedParameters | TypedWorkflowStartOptions<TContract, TWorkflowName> |
Returns
Future<Result<ClientInferOutput<TContract["workflows"][TWorkflowName]>, | WorkflowNotFoundError | WorkflowValidationError | RuntimeClientError>>
Example
const result = await client.executeWorkflow('processOrder', {
workflowId: 'order-123',
args: { orderId: 'ORD-123' },
workflowExecutionTimeout: '1 day',
retry: { maximumAttempts: 3 },
});
result.match({
Ok: (output) => console.log('Order processed:', output.status),
Error: (error) => console.error('Processing failed:', error),
});getHandle()
getHandle<TWorkflowName>(workflowName, workflowId): Future<Result<TypedWorkflowHandle<TContract["workflows"][TWorkflowName]>, WorkflowNotFoundError | RuntimeClientError>>;Defined in: packages/client/src/client.ts:306
Get a handle to an existing workflow with Future/Result pattern
Type Parameters
| Type Parameter |
|---|
TWorkflowName extends string | number | symbol |
Parameters
| Parameter | Type |
|---|---|
workflowName | TWorkflowName |
workflowId | string |
Returns
Future<Result<TypedWorkflowHandle<TContract["workflows"][TWorkflowName]>, WorkflowNotFoundError | RuntimeClientError>>
Example
const handleResult = await client.getHandle('processOrder', 'order-123');
handleResult.match({
Ok: async (handle) => {
const result = await handle.result();
// ... handle result
},
Error: (error) => console.error('Failed to get handle:', error),
});startWorkflow()
startWorkflow<TWorkflowName>(workflowName, __namedParameters): Future<Result<TypedWorkflowHandle<TContract["workflows"][TWorkflowName]>,
| WorkflowNotFoundError
| WorkflowValidationError
| RuntimeClientError>>;Defined in: packages/client/src/client.ts:169
Start a workflow and return a typed handle with Future pattern
Type Parameters
| Type Parameter |
|---|
TWorkflowName extends string | number | symbol |
Parameters
| Parameter | Type |
|---|---|
workflowName | TWorkflowName |
__namedParameters | TypedWorkflowStartOptions<TContract, TWorkflowName> |
Returns
Future<Result<TypedWorkflowHandle<TContract["workflows"][TWorkflowName]>, | WorkflowNotFoundError | WorkflowValidationError | RuntimeClientError>>
Example
const handleResult = await client.startWorkflow('processOrder', {
workflowId: 'order-123',
args: { orderId: 'ORD-123' },
workflowExecutionTimeout: '1 day',
retry: { maximumAttempts: 3 },
});
handleResult.match({
Ok: async (handle) => {
const result = await handle.result();
// ... handle result
},
Error: (error) => console.error('Failed to start:', error),
});create()
static create<TContract>(contract, client): TypedClient<TContract>;Defined in: packages/client/src/client.ts:141
Create a typed Temporal client with boxed pattern from a contract
Type Parameters
| Type Parameter |
|---|
TContract extends ContractDefinition |
Parameters
| Parameter | Type |
|---|---|
contract | TContract |
client | Client |
Returns
TypedClient<TContract>
Example
const connection = await Connection.connect();
const temporalClient = new Client({ connection });
const client = TypedClient.create(myContract, temporalClient);
const result = await client.executeWorkflow('processOrder', {
workflowId: 'order-123',
args: { ... },
});
result.match({
Ok: (output) => console.log('Success:', output),
Error: (error) => console.error('Failed:', error),
});UpdateValidationError
Defined in: packages/client/src/errors.ts:89
Thrown when update input or output validation fails
Extends
TypedClientError
Constructors
Constructor
new UpdateValidationError(
updateName,
direction,
issues): UpdateValidationError;Defined in: packages/client/src/errors.ts:90
Parameters
| Parameter | Type |
|---|---|
updateName | string |
direction | "output" | "input" |
issues | readonly Issue[] |
Returns
Overrides
TypedClientError.constructorProperties
| Property | Modifier | Type | Description | Inherited from | Defined in |
|---|---|---|---|---|---|
cause? | public | unknown | - | TypedClientError.cause | node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2022.error.d.ts:26 |
direction | readonly | "output" | "input" | - | - | packages/client/src/errors.ts:92 |
issues | readonly | readonly Issue[] | - | - | packages/client/src/errors.ts:93 |
message | public | string | - | TypedClientError.message | node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es5.d.ts:1077 |
name | public | string | - | TypedClientError.name | node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es5.d.ts:1076 |
stack? | public | string | - | TypedClientError.stack | node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es5.d.ts:1078 |
updateName | readonly | string | - | - | packages/client/src/errors.ts:91 |
stackTraceLimit | static | number | The Error.stackTraceLimit property specifies the number of stack frames collected by a stack trace (whether generated by new Error().stack or Error.captureStackTrace(obj)). The default value is 10 but may be set to any valid JavaScript number. Changes will affect any stack trace captured after the value has been changed. If set to a non-number value, or set to a negative number, stack traces will not capture any frames. | TypedClientError.stackTraceLimit | node_modules/.pnpm/@types+node@25.3.2/node_modules/@types/node/globals.d.ts:67 |
Methods
captureStackTrace()
static captureStackTrace(targetObject, constructorOpt?): void;Defined in: node_modules/.pnpm/@types+node@25.3.2/node_modules/@types/node/globals.d.ts:51
Creates a .stack property on targetObject, which when accessed returns a string representing the location in the code at which Error.captureStackTrace() was called.
const myObject = {};
Error.captureStackTrace(myObject);
myObject.stack; // Similar to `new Error().stack`The first line of the trace will be prefixed with ${myObject.name}: ${myObject.message}.
The optional constructorOpt argument accepts a function. If given, all frames above constructorOpt, including constructorOpt, will be omitted from the generated stack trace.
The constructorOpt argument is useful for hiding implementation details of error generation from the user. For instance:
function a() {
b();
}
function b() {
c();
}
function c() {
// Create an error without stack trace to avoid calculating the stack trace twice.
const { stackTraceLimit } = Error;
Error.stackTraceLimit = 0;
const error = new Error();
Error.stackTraceLimit = stackTraceLimit;
// Capture the stack trace above function b
Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace
throw error;
}
a();Parameters
| Parameter | Type |
|---|---|
targetObject | object |
constructorOpt? | Function |
Returns
void
Inherited from
TypedClientError.captureStackTraceprepareStackTrace()
static prepareStackTrace(err, stackTraces): any;Defined in: node_modules/.pnpm/@types+node@25.3.2/node_modules/@types/node/globals.d.ts:55
Parameters
| Parameter | Type |
|---|---|
err | Error |
stackTraces | CallSite[] |
Returns
any
See
https://v8.dev/docs/stack-trace-api#customizing-stack-traces
Inherited from
TypedClientError.prepareStackTraceWorkflowNotFoundError
Defined in: packages/client/src/errors.ts:35
Thrown when a workflow is not found in the contract
Extends
TypedClientError
Constructors
Constructor
new WorkflowNotFoundError(workflowName, availableWorkflows): WorkflowNotFoundError;Defined in: packages/client/src/errors.ts:36
Parameters
| Parameter | Type |
|---|---|
workflowName | string |
availableWorkflows | string[] |
Returns
Overrides
TypedClientError.constructorProperties
| Property | Modifier | Type | Description | Inherited from | Defined in |
|---|---|---|---|---|---|
availableWorkflows | readonly | string[] | - | - | packages/client/src/errors.ts:38 |
cause? | public | unknown | - | TypedClientError.cause | node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2022.error.d.ts:26 |
message | public | string | - | TypedClientError.message | node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es5.d.ts:1077 |
name | public | string | - | TypedClientError.name | node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es5.d.ts:1076 |
stack? | public | string | - | TypedClientError.stack | node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es5.d.ts:1078 |
workflowName | readonly | string | - | - | packages/client/src/errors.ts:37 |
stackTraceLimit | static | number | The Error.stackTraceLimit property specifies the number of stack frames collected by a stack trace (whether generated by new Error().stack or Error.captureStackTrace(obj)). The default value is 10 but may be set to any valid JavaScript number. Changes will affect any stack trace captured after the value has been changed. If set to a non-number value, or set to a negative number, stack traces will not capture any frames. | TypedClientError.stackTraceLimit | node_modules/.pnpm/@types+node@25.3.2/node_modules/@types/node/globals.d.ts:67 |
Methods
captureStackTrace()
static captureStackTrace(targetObject, constructorOpt?): void;Defined in: node_modules/.pnpm/@types+node@25.3.2/node_modules/@types/node/globals.d.ts:51
Creates a .stack property on targetObject, which when accessed returns a string representing the location in the code at which Error.captureStackTrace() was called.
const myObject = {};
Error.captureStackTrace(myObject);
myObject.stack; // Similar to `new Error().stack`The first line of the trace will be prefixed with ${myObject.name}: ${myObject.message}.
The optional constructorOpt argument accepts a function. If given, all frames above constructorOpt, including constructorOpt, will be omitted from the generated stack trace.
The constructorOpt argument is useful for hiding implementation details of error generation from the user. For instance:
function a() {
b();
}
function b() {
c();
}
function c() {
// Create an error without stack trace to avoid calculating the stack trace twice.
const { stackTraceLimit } = Error;
Error.stackTraceLimit = 0;
const error = new Error();
Error.stackTraceLimit = stackTraceLimit;
// Capture the stack trace above function b
Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace
throw error;
}
a();Parameters
| Parameter | Type |
|---|---|
targetObject | object |
constructorOpt? | Function |
Returns
void
Inherited from
TypedClientError.captureStackTraceprepareStackTrace()
static prepareStackTrace(err, stackTraces): any;Defined in: node_modules/.pnpm/@types+node@25.3.2/node_modules/@types/node/globals.d.ts:55
Parameters
| Parameter | Type |
|---|---|
err | Error |
stackTraces | CallSite[] |
Returns
any
See
https://v8.dev/docs/stack-trace-api#customizing-stack-traces
Inherited from
TypedClientError.prepareStackTraceWorkflowValidationError
Defined in: packages/client/src/errors.ts:49
Thrown when workflow input or output validation fails
Extends
TypedClientError
Constructors
Constructor
new WorkflowValidationError(
workflowName,
direction,
issues): WorkflowValidationError;Defined in: packages/client/src/errors.ts:50
Parameters
| Parameter | Type |
|---|---|
workflowName | string |
direction | "output" | "input" |
issues | readonly Issue[] |
Returns
Overrides
TypedClientError.constructorProperties
| Property | Modifier | Type | Description | Inherited from | Defined in |
|---|---|---|---|---|---|
cause? | public | unknown | - | TypedClientError.cause | node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2022.error.d.ts:26 |
direction | readonly | "output" | "input" | - | - | packages/client/src/errors.ts:52 |
issues | readonly | readonly Issue[] | - | - | packages/client/src/errors.ts:53 |
message | public | string | - | TypedClientError.message | node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es5.d.ts:1077 |
name | public | string | - | TypedClientError.name | node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es5.d.ts:1076 |
stack? | public | string | - | TypedClientError.stack | node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es5.d.ts:1078 |
workflowName | readonly | string | - | - | packages/client/src/errors.ts:51 |
stackTraceLimit | static | number | The Error.stackTraceLimit property specifies the number of stack frames collected by a stack trace (whether generated by new Error().stack or Error.captureStackTrace(obj)). The default value is 10 but may be set to any valid JavaScript number. Changes will affect any stack trace captured after the value has been changed. If set to a non-number value, or set to a negative number, stack traces will not capture any frames. | TypedClientError.stackTraceLimit | node_modules/.pnpm/@types+node@25.3.2/node_modules/@types/node/globals.d.ts:67 |
Methods
captureStackTrace()
static captureStackTrace(targetObject, constructorOpt?): void;Defined in: node_modules/.pnpm/@types+node@25.3.2/node_modules/@types/node/globals.d.ts:51
Creates a .stack property on targetObject, which when accessed returns a string representing the location in the code at which Error.captureStackTrace() was called.
const myObject = {};
Error.captureStackTrace(myObject);
myObject.stack; // Similar to `new Error().stack`The first line of the trace will be prefixed with ${myObject.name}: ${myObject.message}.
The optional constructorOpt argument accepts a function. If given, all frames above constructorOpt, including constructorOpt, will be omitted from the generated stack trace.
The constructorOpt argument is useful for hiding implementation details of error generation from the user. For instance:
function a() {
b();
}
function b() {
c();
}
function c() {
// Create an error without stack trace to avoid calculating the stack trace twice.
const { stackTraceLimit } = Error;
Error.stackTraceLimit = 0;
const error = new Error();
Error.stackTraceLimit = stackTraceLimit;
// Capture the stack trace above function b
Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace
throw error;
}
a();Parameters
| Parameter | Type |
|---|---|
targetObject | object |
constructorOpt? | Function |
Returns
void
Inherited from
TypedClientError.captureStackTraceprepareStackTrace()
static prepareStackTrace(err, stackTraces): any;Defined in: node_modules/.pnpm/@types+node@25.3.2/node_modules/@types/node/globals.d.ts:55
Parameters
| Parameter | Type |
|---|---|
err | Error |
stackTraces | CallSite[] |
Returns
any
See
https://v8.dev/docs/stack-trace-api#customizing-stack-traces
Inherited from
TypedClientError.prepareStackTraceType Aliases
ClientInferActivities
type ClientInferActivities<TContract> = TContract["activities"] extends Record<string, ActivityDefinition> ? { [K in keyof TContract["activities"]]: ClientInferActivity<TContract["activities"][K]> } : object;Defined in: packages/client/src/types.ts:88
Infer all activities from a contract (client perspective)
Type Parameters
| Type Parameter |
|---|
TContract extends ContractDefinition |
ClientInferActivity()
type ClientInferActivity<TActivity> = (args) => Promise<ClientInferOutput<TActivity>>;Defined in: packages/client/src/types.ts:46
Infer activity function signature from client perspective Client sends z.output and receives z.input
Type Parameters
| Type Parameter |
|---|
TActivity extends ActivityDefinition |
Parameters
| Parameter | Type |
|---|---|
args | ClientInferInput<TActivity> |
Returns
Promise<ClientInferOutput<TActivity>>
ClientInferInput
type ClientInferInput<T> = StandardSchemaV1.InferInput<T["input"]>;Defined in: packages/client/src/types.ts:17
Infer input type from a definition (client perspective) Client sends the input type (before input schema parsing/transformation)
Type Parameters
| Type Parameter |
|---|
T extends object |
ClientInferOutput
type ClientInferOutput<T> = StandardSchemaV1.InferOutput<T["output"]>;Defined in: packages/client/src/types.ts:25
Infer output type from a definition (client perspective) Client receives the output type (after output schema parsing/transformation)
Type Parameters
| Type Parameter |
|---|
T extends object |
ClientInferQuery()
type ClientInferQuery<TQuery> = (args) => Future<Result<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 Future<Result<T, Error>>
Type Parameters
| Type Parameter |
|---|
TQuery extends QueryDefinition |
Parameters
| Parameter | Type |
|---|---|
args | ClientInferInput<TQuery> |
Returns
Future<Result<ClientInferOutput<TQuery>, Error>>
ClientInferSignal()
type ClientInferSignal<TSignal> = (args) => Future<Result<void, Error>>;Defined in: packages/client/src/types.ts:54
Infer signal handler signature from client perspective Client sends z.output and returns Future<Result<void, Error>>
Type Parameters
| Type Parameter |
|---|
TSignal extends SignalDefinition |
Parameters
| Parameter | Type |
|---|---|
args | ClientInferInput<TSignal> |
Returns
Future<Result<void, Error>>
ClientInferUpdate()
type ClientInferUpdate<TUpdate> = (args) => Future<Result<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 Future<Result<T, Error>>
Type Parameters
| Type Parameter |
|---|
TUpdate extends UpdateDefinition |
Parameters
| Parameter | Type |
|---|---|
args | ClientInferInput<TUpdate> |
Returns
Future<Result<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 WorkflowDefinition |
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 WorkflowDefinition |
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"] |
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 WorkflowDefinition |
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 WorkflowDefinition |
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 WorkflowDefinition |
TypedWorkflowHandle
type TypedWorkflowHandle<TWorkflow> = object;Defined in: packages/client/src/client.ts:38
Typed workflow handle with validated results using Result/Future pattern
Type Parameters
| Type Parameter |
|---|
TWorkflow extends WorkflowDefinition |
Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
cancel | () => Future<Result<void, RuntimeClientError>> | Cancel workflow with Result pattern | packages/client/src/client.ts:92 |
describe | () => Future<Result<Awaited<ReturnType<WorkflowHandle["describe"]>>, RuntimeClientError>> | Get workflow execution description including status and metadata | packages/client/src/client.ts:97 |
fetchHistory | () => Future<Result<Awaited<ReturnType<WorkflowHandle["fetchHistory"]>>, RuntimeClientError>> | Fetch the workflow execution history | packages/client/src/client.ts:104 |
queries | { [K in keyof ClientInferWorkflowQueries<TWorkflow>]: ClientInferWorkflowQueries<TWorkflow>[K] extends (args: infer Args) => Future<Result<infer R, Error>> ? (args: Args) => Future<Result<R, QueryValidationError | RuntimeClientError>> : never } | Type-safe queries based on workflow definition with Result pattern Each query returns Future<Result<T, Error>> instead of Promise<T> | packages/client/src/client.ts:45 |
result | () => Future<Result<ClientInferOutput<TWorkflow>, | WorkflowValidationError | RuntimeClientError>> | Get workflow result with Result pattern | packages/client/src/client.ts:80 |
signals | { [K in keyof ClientInferWorkflowSignals<TWorkflow>]: ClientInferWorkflowSignals<TWorkflow>[K] extends (args: infer Args) => Future<Result<void, Error>> ? (args: Args) => Future<Result<void, SignalValidationError | RuntimeClientError>> : never } | Type-safe signals based on workflow definition with Result pattern Each signal returns Future<Result<void, Error>> instead of Promise<void> | packages/client/src/client.ts:57 |
terminate | (reason?) => Future<Result<void, RuntimeClientError>> | Terminate workflow with Result pattern | packages/client/src/client.ts:87 |
updates | { [K in keyof ClientInferWorkflowUpdates<TWorkflow>]: ClientInferWorkflowUpdates<TWorkflow>[K] extends (args: infer Args) => Future<Result<infer R, Error>> ? (args: Args) => Future<Result<R, UpdateValidationError | RuntimeClientError>> : never } | Type-safe updates based on workflow definition with Result pattern Each update returns Future<Result<T, Error>> instead of Promise<T> | packages/client/src/client.ts:69 |
workflowId | string | - | packages/client/src/client.ts:39 |
TypedWorkflowStartOptions
type TypedWorkflowStartOptions<TContract, TWorkflowName> = Omit<WorkflowStartOptions, "taskQueue" | "args"> & object;Defined in: packages/client/src/client.ts:28
Type Declaration
| Name | Type | Defined in |
|---|---|---|
args | ClientInferInput<TContract["workflows"][TWorkflowName]> | packages/client/src/client.ts:32 |
Type Parameters
| Type Parameter |
|---|
TContract extends ContractDefinition |
TWorkflowName extends keyof TContract["workflows"] |