Spawns a child workflow and awaits its result. The child runs as an
independent job with its own lifecycle, retry policy, and dimensional
isolation. If the child fails, the error is propagated to the parent
as a typed error (DurableFatalError, DurableMaxedError,
DurableTimeoutError, or DurableRetryError).
On replay, the stored child result is returned immediately without
re-spawning the child workflow.
Child Job ID
If options.workflowId is provided, it is used directly. Otherwise,
the child ID is generated from the entity/workflow name, a GUID, the
parent's dimensional coordinates, and the execution index — ensuring
uniqueness across parallel and re-entrant executions.
Examples
import { Durable } from'@hotmeshio/hotmesh';
// Spawn a child workflow and await its result exportasyncfunctionparentWorkflow(orderId: string): Promise<string> { constresult = awaitDurable.workflow.execChild<{ status: string }>({ taskQueue:'payments', workflowName:'processPayment', args: [orderId, 99.99], config: { maximumAttempts:3, backoffCoefficient:2, }, }); returnresult.status; }
Spawns a child workflow and awaits its result. The child runs as an independent job with its own lifecycle, retry policy, and dimensional isolation. If the child fails, the error is propagated to the parent as a typed error (
DurableFatalError,DurableMaxedError,DurableTimeoutError, orDurableRetryError).On replay, the stored child result is returned immediately without re-spawning the child workflow.
Child Job ID
If
options.workflowIdis provided, it is used directly. Otherwise, the child ID is generated from the entity/workflow name, a GUID, the parent's dimensional coordinates, and the execution index — ensuring uniqueness across parallel and re-entrant executions.Examples