ShtukbaseStandard
package page→ /automations.md

pages/automations.md

57 lines, 2.2 KB. As a page.

  1. ---
  2. type: Collection
  3. title: "Automations"
  4. icon: "⏰"
  5. description: "What happens by itself: an event, an action in response and a limit on how many times per hour and per day."
  6. itemType: Automation
  7. items: {mode: path, path: /automations, recursive: false}
  8. writeTo: /automations
  9. properties:
  10. trigger: {kind: text, label: "When (event)"}
  11. reaction: {kind: text, label: "What it does"}
  12. limits: {kind: text, label: "Limits"}
  13. mode:
  14. kind: select
  15. label: "Mode"
  16. options:
  17. - {name: manual, label: "By hand", color: gray}
  18. - {name: auto, label: "By itself", color: green}
  19. node: {kind: text, label: "Where it runs (machine)"}
  20. views:
  21. - id: automations--table
  22. name: All automations
  23. layout: table
  24. fields: {}
  25. sorting:
  26. - {propertyId: title, direction: ascending}
  27. properties:
  28. - {name: title, visible: true, width: 320}
  29. - {name: trigger, visible: true}
  30. - {name: mode, visible: true}
  31. - {name: node, visible: true}
  32. ---
  33. 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.
  34. ```yaml
  35. trigger: {kind: clock, at: "03:00"} # or every: 15m, cron: "0 3 * * *"
  36. reaction: {action: /actions/nightly-check} # or {agent: /agents/worker}
  37. limits: {perHour: 1, perDay: 1}
  38. mode: manual # auto: the executor runs it
  39. ```
  40. Kinds of event (`trigger.kind`):
  41. | Kind | What else to give |
  42. |---|---|
  43. | `clock` (or `schedule`) | `at`, `every` or `cron` |
  44. | `change` | `within`: the folder to watch for changes |
  45. | `phase` | `contour` and `phase`: a record entered the phase |
  46. | `sensor` | `sensor`: the sensor page |
  47. | `run-finished` | `automation`: whose run ended |
  48. | `manual` (or `hand`) | nothing: a person runs it |
  49. | `answer` | nothing: a person's answer to a run question |
  50. `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.
  51. Norm [ACT-R02](/norms/rules/automations/ACT-R02.md) makes sure an automation says when, what and how many times.