Cancel a workflow execution
OptionalrunId: stringGet client health status
Get raw Temporal client (use with caution)
Get client status for monitoring
Get handle to an existing workflow
OptionalrunId: stringWait for workflow completion and get result
OptionalrunId: stringCheck if client is available and healthy
Query a workflow for its current state
Optionalargs: readonly unknown[]OptionalrunId: stringQuery a workflow using handle
Optionalargs: readonly unknown[]Atomically start a workflow and send a signal to it.
If the workflow is already running, only the signal is delivered.
This is Temporal's signalWithStart operation — useful for ensuring
a workflow is running before sending a signal without a race condition.
Temporal workflow type name
Signal name (string) to send
Arguments for the signal
Arguments to start the workflow with (used only when starting)
Optionaloptions: WorkflowStartOptionsWorkflow start options (taskQueue, workflowId, etc.)
// Idempotent: starts the cart the first time, signals it every time.
await clientService.signalWithStart(
'cartWorkflow',
'addItem',
[{ sku: 'SKU-123', qty: 2 }],
[userId], // args passed to cartWorkflow on first start
{ workflowId: `cart-${userId}`, taskQueue: 'carts' },
);
const handle = await clientService.signalWithStart(
'orderWorkflow',
'approve',
['manager-approval'],
[orderId, customerId],
{
workflowId: `order-${orderId}`,
taskQueue: 'orders',
workflowIdReusePolicy: 'ALLOW_DUPLICATE',
workflowExecutionTimeout: '1h',
memo: { source: 'api' },
},
);
console.log(`Signaled + maybe-started: ${handle.workflowId}`);
Send a signal using workflow handle
Optionalargs: readonly unknown[]Start a new workflow execution
Optionaloptions: WorkflowStartOptionsTerminate a workflow execution
Optionalreason: stringOptionalrunId: string
Temporal Client Service
Provides a clean interface for Temporal client operations including:
Example