Optionalcontext: JobStateif the job is created/deleted/created with the same key, the 'gid' ensures no stale messages (such as sleep delays) enter the workstream. Any message with a mismatched gid belongs to a prior job and can safely be ignored/dropped.
OptionalmsgGID: stringExecutes the 3-step Leg1 protocol for Category B activities (Leg1-only with children, e.g., Hook passthrough, Signal, Interrupt-another). Uses the incoming Leg1 message GUID as the GUID ledger key.
Step A: setState + notarizeLeg1Completion + step1 markers (transaction 1) Step B: publish children + step2 markers + setStatusAndCollateGuid (transaction 2) Step C: if edge → runJobCompletionTasks + step3 markers + finalize (transaction 3)
true if this transition caused the job to complete
Executes the 3-step Leg2 protocol using GUID ledger for crash-safe resume. Each step bundles durable writes with its concluding digit update in a single transaction.
true if this transition caused the job to complete
Optionaltransaction: ProviderTransactionExtracts the job status from the last result of a transaction. Used by subclass Leg1 process methods for telemetry.
Extracts the thresholdHit value from transaction results. The setStatusAndCollateGuid result is the last item.
Optionaltransaction: ProviderTransactionOptionaltransaction: 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