Optionalcontext: JobStateFlatten activity-level context paths into store-ready key/values
Write the dimensional address into the state payload
Flatten job-level context paths into store-ready key/values
Build the list of child activities to transition to
Resolve expire and persistent policies from config
Bootstrap $self, $job refs and output.metadata.au timestamp
Optionaltransaction: ProviderTransactionRegister the time hook (sleep) inside the Leg1 transaction. Time hooks don't participate in the signal race — they're purely internal timeout registrations.
Register the web hook signal AFTER the Leg1 transaction commits. This ensures the hook signal is never visible before Leg1 completion, eliminating the FORBIDDEN window where Leg2 could find the hook but fail on the collation check.
If a pending signal was stored by an early-arriving Leg2, setHookSignal atomically detects and returns it.
Extract the job status from the last transaction result
Did the semaphore reach its threshold? (from transaction results)
Persist the full activity + job state in a single store call
Optionaltxn: ProviderTransactionIncrement/decrement the job semaphore
Optionaltxn: ProviderTransaction
The most flexible activity type in the HotMesh YAML DAG. Depending on its configuration it operates as one of four distinct flavors:
sleephook.topiccycle: truecycleactivityFlavor 1 — Time Hook (sleep)
Pauses the flow for
sleepseconds. The value can be a literal number or a@pipeexpression (e.g., for exponential backoff).Dynamic delay with
@pipe(exponential backoff on retry):Flavor 2 — Signal Hook (webhook)
Registers a listener on a named topic. The flow pauses until an external caller delivers a signal. Signal data is available as
$self.hook.data. The graph-levelhookssection routes incoming signals to the waiting activity via aconditions.matchrule.Send the signal from any process:
Claim and delete a pending signal via the collator key:
YAML configuration:
Signal Hook with Escalation
Adding an
escalation:block causes the hook activity to write one row topublic.hmsh_escalationsatomically inside its Leg 1 transaction — the same database commit that checkpoints job state. The row is immediately queryable and claimable by any external system.All field values support
@pipeexpressions so they can reference job data computed by earlier activities (e.g.,'{t1.output.data.region}').Claim and resolve the escalation (resumes the waiting workflow):
Flavor 3 — Cycle Pivot
A passthrough hook with
cycle: trueacts as the named re-entry point for acycleactivity. On first entry it behaves identically to a passthrough (maps data, transitions forward). When acycleactivity downstream names it as itsancestor, the engine routes execution back to it, allowing a controlled loop without spawning a new job.Flavor 4 — Passthrough
When none of
sleep,hook, orcycleis set, the hook activity immediately maps data and transitions to its children. Useful as a data transformation node or fan-in convergence point.Execution Model
executeLeg1StepProtocol(GUID ledger backed) to map data and immediately transition to adjacent activities.See
HookActivity for the TypeScript interface