Documentation

receives

A receives rule names events or a schedule that reach an entry's live instances.

Rule keys

KeyTypeDefaultDescription
eventstringnoneNames an event type or glob, such as issue/updated. See Events. Set exactly one of event and cron.
cronstringnoneSets a 5-field cron expression, m h dom mon dow.
timezonestringUTCSets the IANA timezone for cron. Valid only in a rule that sets cron.
namestringrequired with cronNames the cron schedule. The name must be unique within the entry. Valid only in a rule that sets cron.
messagestringnoneSets the text that a cron firing carries in data.message. Valid only in a rule that sets cron.
matchpatternnoneSets a graph pattern, such as (event.subject)-[child-of]->(self). Valid only in a rule that sets event.
whereexpressionnoneSets a condition on event, self and the pattern's variables.
broadcastboolfalseWhen true, Hydra delivers the event to every live instance. Valid only in a rule that sets event.
agents:
  lead:
    prompts: [/agents/lead/prompt.md]
    runs_when:
      track:
        lives_on: issue
        where: self.status == "in-progress"
        mode: interactive
        receives:
          - event: issue/updated
            match: (event.subject)-[child-of]->(self)
            where: event.old.exists(old => old.status != event.subject.status)
          - event: issue/created
            broadcast: true

cron

A firing reaches the entry's live instances, and starts each singleton that is not live and whose where holds. Day-of-week 0 and 7 are Sunday, and 6 is Saturday, so 1-5 is Monday to Friday. The expression also accepts day names such as MON-FRI.

where

Expressions use the expression language.

For the fields of event, see Event fields in expressions.

where may read match! with one hop of one relation from one of these starts:

  • self, on a lives_on entry and in a rule without broadcast
  • event.subject, when every matched event type has a subject
  • a node the match names

A cron rule's match! starts only from self. These reads count against the per-event read limit.

broadcast

  • An event rule whose match or where mentions self must not set broadcast.
  • An event rule that does not mention self must set broadcast: true.
  • A match! from self counts as mentioning self.