Skip to content

Wait for event

Wait until a matching event arrives on the project bus.

The run holds no agent while it waits. An event that arrives and fails when is declined, and the wait goes on.

  • Kind: event
  • Palette: Flow
  • Run it on its own: no, only as part of a graph
  • Pausing until something else in the project happens: an order placed, a deploy finished, a pull request merged.
  • Joining up two runs: one emits, the other waits here for it.

To start a new run on an event instead of waiting inside one, use a trigger. To wait for a signal sent to this particular run, use wait.

Field Type Required Description
event string yes Event-type pattern to wait for.
accept_untrusted boolean no Let an untrusted event (a fork pull request, an outside comment) end the wait too. The output then says untrusted.
outputs object no Rename what comes out: {output_name: key_in_the_raw_output}. Absent passes the raw output through.
timeout string no How long to wait before giving up, e.g. “1h”; the output then says timed_out.
when string no A CEL predicate over the arriving event; only a match ends the wait.

The event envelope that arrived, plus:

Field Type Description
timed_out boolean True when the deadline won rather than the thing being waited for.
version: hyperspool-graph/v1
nodes:
- id: hold
type: event
config:
event: order.placed
when: "event.payload.qty > 10"
timeout: 1h
- id: ship
type: code
if: "!nodes.hold.output.timed_out"
config:
script: echo "ship ${SKU}"
env:
SKU: { $expr: "nodes.hold.output.payload.sku" }
edges:
- { from: hold, to: ship }

spool event emit order.placed --payload '{"sku":"TENT-2P","qty":12}' ends the wait; the same event with qty: 2 doesn’t. The output is the event that arrived, so its data is under payload. See Events and handlers.

See the node reference for every other node.