package page→ /automations.md
pages/automations.md
57 lines, 2.2 KB. As a page.
- ---
- type: Collection
- title: "Automations"
- icon: "⏰"
- description: "What happens by itself: an event, an action in response and a limit on how many times per hour and per day."
- itemType: Automation
- items: {mode: path, path: /automations, recursive: false}
- writeTo: /automations
- properties:
- trigger: {kind: text, label: "When (event)"}
- reaction: {kind: text, label: "What it does"}
- limits: {kind: text, label: "Limits"}
- mode:
- kind: select
- label: "Mode"
- options:
- - {name: manual, label: "By hand", color: gray}
- - {name: auto, label: "By itself", color: green}
- node: {kind: text, label: "Where it runs (machine)"}
- views:
- - id: automations--table
- name: All automations
- layout: table
- fields: {}
- sorting:
- - {propertyId: title, direction: ascending}
- properties:
- - {name: title, visible: true, width: 320}
- - {name: trigger, visible: true}
- - {name: mode, visible: true}
- - {name: node, visible: true}
- ---
- An automation is an event and a reaction to it: when `trigger` fires, `reaction` runs. It is not a norm: a norm says what must be there, and an automation is one way to get there after an event.
- ```yaml
- trigger: {kind: clock, at: "03:00"} # or every: 15m, cron: "0 3 * * *"
- reaction: {action: /actions/nightly-check} # or {agent: /agents/worker}
- limits: {perHour: 1, perDay: 1}
- mode: manual # auto: the executor runs it
- ```
- Kinds of event (`trigger.kind`):
- | Kind | What else to give |
- |---|---|
- | `clock` (or `schedule`) | `at`, `every` or `cron` |
- | `change` | `within`: the folder to watch for changes |
- | `phase` | `contour` and `phase`: a record entered the phase |
- | `sensor` | `sensor`: the sensor page |
- | `run-finished` | `automation`: whose run ended |
- | `manual` (or `hand`) | nothing: a person runs it |
- | `answer` | nothing: a person's answer to a run question |
- `mode: manual` is an instruction for a person or an agent: the executor does not run it by itself. `mode: auto` is run by the executor (for example the Shtukbase node) by itself, but no more often than the limits `limits` allow.
- Norm [ACT-R02](/norms/rules/automations/ACT-R02.md) makes sure an automation says when, what and how many times.