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
A versatile pause/resume activity that supports three distinct patterns: time hook (sleep), web hook (external signal), and passthrough (immediate transition with optional data mapping).
The hook activity is the most flexible activity type. Depending on its YAML configuration, it operates in one of the following modes:
Time Hook (Sleep)
Pauses the flow for a specified duration in seconds. The
sleepvalue can be a literal number or a@pipeexpression for dynamic delays (e.g., exponential backoff).Web Hook (External Signal)
Registers a webhook listener on a named topic. The flow pauses until an external signal is sent to the hook's topic. The signal data becomes available as
$self.hook.data. Thehookssection at the graph level routes incoming signals to the waiting activity.Passthrough (No Hook)
When neither
sleepnorhookis configured, the hook activity acts as a passthrough: it maps data and immediately transitions to children. This is useful for data transformation, convergence points, or as a cycle pivot (withcycle: true).Execution Model
sleeporhook: Category A (duplex). Leg 1 registers the hook and saves state. Leg 2 fires when the timer expires or the external signal arrives (viaprocessTimeHookEventorprocessWebHookEvent).sleeporhook: Category B (passthrough). Uses the crash-safeexecuteLeg1StepProtocolto map data and transition to adjacent activities.See
HookActivity for the TypeScript interface