The workflow class/type to create a proxy for
Optionaloptions: { taskQueue?: string }// In function-based workflow
export async function orderWorkflow(order: Order): Promise<OrderResult> {
// Start child workflows using startChild from @temporalio/workflow
const reservationHandle = await wf.startChild(inventoryWorkflow, {
args: [order.items],
workflowId: `inventory-${order.id}`
});
const reservation = await reservationHandle.result();
const paymentHandle = await wf.startChild(paymentWorkflow, {
args: [{ amount: order.total, customerId: order.customerId }],
workflowId: `payment-${order.id}`
});
const payment = await paymentHandle.result();
return { orderId: order.id, paymentId: payment.id };
}
Property decorator to inject a child workflow proxy into a parent workflow. Child workflows are independent workflow executions that are started and managed by a parent workflow. This decorator creates a proxy that allows easy invocation of child workflows with proper typing.
This decorator works in v8 isolated environments by using Temporal's startChild API without relying on dependency injection or external services. Configuration is handled dynamically at runtime through the workflow execution context.