Sends a signal to one or more paused flows, resuming their execution. The signal activity is the counterpart to a Hook activity configured with a webhook listener. It allows any flow to reach into another flow and deliver data to a waiting hook, regardless of the relationship between the flows.

Resumes a single paused flow by publishing to the hook's topic. Use subtype: one when you know the specific hook topic to signal.

app:
id: myapp
version: '1'
graphs:
- subscribes: signal.start
expire: 120

activities:
t1:
type: trigger

resume_hook:
type: signal
subtype: one
topic: my.hook.topic # the hook's registered topic
status: success # optional: success (default) or pending
code: 200 # optional: 200 (default) or 202 (keep-alive)
signal:
schema:
type: object
properties:
approved: { type: boolean }
maps:
approved: true # data delivered to the hook

done:
type: hook

transitions:
t1:
- to: resume_hook
resume_hook:
- to: done

A code: 202 signal delivers data but keeps the hook alive for additional signals. A code: 200 (default) closes the hook.

Resumes all paused flows that share a common job key facet. Use subtype: all for fan-out patterns where multiple waiting flows should be resumed simultaneously.

app:
id: myapp
version: '1'
graphs:
- subscribes: signal.fan.out
expire: 120

activities:
t1:
type: trigger

resume_all:
type: signal
subtype: all
topic: hook.resume
key_name: parent_job_id # index facet name
key_value: '{$job.metadata.jid}'
scrub: true # clean up indexes after use
resolver:
maps:
data:
parent_job_id: '{$job.metadata.jid}'
scrub: true
signal:
maps:
done: true # data delivered to all matching hooks

done:
type: hook

transitions:
t1:
- to: resume_all
resume_all:
- to: done

Signal is a Category B (Leg1-only with children) activity:

  • Bundles the hook signal with the Leg 1 completion marker in a single transaction (hookOne) or fires best-effort (hookAll).
  • Executes the crash-safe executeLeg1StepProtocol to transition to adjacent activities.

SignalActivity for the TypeScript interface

Hierarchy (view full)

Constructors

Properties

adjacencyList: StreamData[]
adjacentIndex: number = 0
code: number = 200
context: JobState
guidLedger: number = 0
logger: ILogger
status: StreamStatus = StreamStatus.SUCCESS

Methods

  • if 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.

    Parameters

    • jobGID: string
    • OptionalmsgGID: string

    Returns void

  • unhandled activity errors (activities that return an ERROR StreamMessage status and have no adjacent children to transition to) are bound to the job

    Parameters

    • data: Record<string, unknown>

    Returns void

  • Executes 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)

    Parameters

    • delta: number

    Returns Promise<boolean>

    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.

    Parameters

    • delta: number
    • shouldFinalize: boolean

    Returns Promise<boolean>

    true if this transition caused the job to complete

  • Signals all paused jobs that share the same job key, resuming their execution.

    Returns Promise<string[]>

  • The signal activity will hook one. Accepts an optional transaction so the hook publish can be bundled with the Leg1 completion marker.

    Parameters

    Returns Promise<string>

  • Leg1 entry verification for Category B activities (Leg1-only with children). Returns true if this is a resume (Leg1 already completed on a prior attempt). On resume, loads the GUID ledger for step-level resume decisions.

    Returns Promise<boolean>

  • Upon entering leg 2 of a duplexed activity. Increments both the activity ledger (+1) and GUID ledger (+1). Stores the GUID ledger value for step-level resume decisions.

    Returns Promise<number>