Terminates a running workflow job by its ID. The target job's status
is set to an error code indicating abnormal termination, and any
pending activities or timers are cancelled.
This is the workflow-internal interrupt — it can only be called from
within a workflow function. For external interruption, use
hotMesh.interrupt() directly.
The interrupt fires exactly once per workflow execution — the
isSideEffectAllowed guard prevents re-interrupting on replay.
Examples
import { Durable } from'@hotmeshio/hotmesh';
// Cancel a child workflow from the parent exportasyncfunctionsupervisorWorkflow(): Promise<void> { constchildId = awaitDurable.workflow.startChild({ taskQueue:'workers', workflowName:'longTask', args: [], });
// Wait for a timeout, then cancel the child awaitDurable.workflow.sleepFor('5 minutes'); awaitDurable.workflow.interrupt(childId, { reason:'Timed out waiting for child', descend:true, // also interrupt any grandchild workflows }); }
Terminates a running workflow job by its ID. The target job's status is set to an error code indicating abnormal termination, and any pending activities or timers are cancelled.
This is the workflow-internal interrupt — it can only be called from within a workflow function. For external interruption, use
hotMesh.interrupt()directly.The interrupt fires exactly once per workflow execution — the
isSideEffectAllowedguard prevents re-interrupting on replay.Examples