A Temporal Workflow function type
Get a typed handle to an existing workflow execution.
result() on the handle returns Promise<WorkflowResultType<T>>.
OptionalrunId: stringQuery the workflow using a typed QueryDefinition created with defineQuery.
TResult and TArgs are both inferred from the definition.
// in workflow file: export const statusQuery = defineQuery<OrderStatus>('getStatus');
const status = await this.orderProxy.query('order-42', statusQuery); // typed: OrderStatus
// query with args:
// export const itemQuery = defineQuery<Item, [string]>('getItem');
const item = await this.orderProxy.query('order-42', itemQuery, 'item-id');
Query by string name. Use when a QueryDefinition is unavailable.
Caller must supply TResult explicitly (e.g. queryByName<OrderStatus>(...)).
Optionalargs: readonly unknown[]Send a typed signal using a SignalDefinition created with defineSignal.
TypeScript infers TArgs from the definition — call site is fully type-checked.
Send a signal by string name. Use when a SignalDefinition is unavailable.
Args are readonly unknown[] — no implicit any.
Optionalargs: readonly unknown[]Atomically start the workflow and send a signal.
If the workflow is already running, only the signal is delivered (no duplicate start).
Both signalArgs and workflowArgs are fully typed via the respective definitions.
Optionaloptions: WorkflowStartOptions// export const addItemSignal = defineSignal<[CartItem]>('addItem');
await this.cartProxy.signalWithStart(
addItemSignal,
[{ sku: 'SKU-123', qty: 2 }], // signalArgs — typed
[userId], // workflowArgs — typed as Parameters<cartWorkflow>
{ workflowId: `cart-${userId}`, taskQueue: 'carts' },
);
Start a new execution of this workflow.
Args are typed as Parameters<T> — TypeScript enforces the workflow's signature.
Optionaloptions: WorkflowStartOptions
Typed proxy interface for interacting with a specific workflow type.
Tmust be a Temporal workflow function type (e.g.typeof myWorkflow). All method signatures are inferred fromT— noany, nounknown[]at the call site.Example