The daemon's own workflows
The daemon looks after itself with the same parts as everything else:
messages about what it notices, and workflows that handle them. They show
in itero check, itero runs --all and the log like any other, and a
workspace changes or turns them off the same way.
Messages from the daemon
Section titled “Messages from the daemon”Their types start with itero., which only itero may send (a click on a
notification comes through Itero.app):
| Type | When | Data |
|---|---|---|
itero.daemon.started |
the daemon starts | daemon, name, itero |
itero.run.error |
a run ended in error | workflow, run, failed_step, why |
itero.run.failed |
a run ended as failed | workflow, run, why |
itero.connector.gave-up |
a connector kept ending and was given up on | connector, why |
itero.space.full |
.itero/ is past its space limit |
used, limit |
itero.log.full |
the log is past its log limit |
path, size, limit |
itero.notification.clicked |
a notification from #notify was clicked, on macOS (#notify) |
notification, answer, workflow, data |
A workflow on one is written like any other:
{ "on": [{ "event": "itero.run.error" }], "steps": [{ "#notify": { "title": "itero", "text": "$workflow: $why" } }] }A message about a run never starts its own workflow, so a broken workflow cannot set itself off again and again. No run waits for these messages: they only start workflows.
Internal workflows
Section titled “Internal workflows”A workflow whose entry in itero.config.json says "internal": true looks after the workspace
rather than doing its work. Nothing in its name says so. Being internal:
itero checklists it apart, last;itero runsandGET /runsleave its runs out unless asked (itero runs --all,?all=true);itero errorsshows its errors;- its runs do not count against
runs, nor it againstworkflows; - its lines in the log carry
"internal": true.
Built in: keep and logs
Section titled “Built in: keep and logs”itero carries two internal workflows and runs them as if they were in
workflows/:
| Workflow | On | Does |
|---|---|---|
keep |
every hour, and itero.space.full |
#forget: forgets ended runs and their messages past keep; all ended ones while space is short |
logs |
itero.log.full |
#roll-log: itero.log becomes itero.log.1, .1 becomes .2, keeping logs of them |
#forget and #roll-log are built-in actions, like #notify.
-
Changing one: a file of its name in
workflows/is used instead, such asworkflows/logs.jsonrolling the log and then sending the oldest away:{ "on": [{ "event": "itero.log.full" }],"steps": ["#roll-log", "#upload-old-logs"] }with
"workflow": {"logs": {"internal": true}}initero.config.json, so it stays internal. -
Turning one off: its entry,
"workflow": {"logs": {"off": true}}.
Limits
Section titled “Limits”limits in itero.config.json:
- past
runsunder way, a message that would start a run waits its turn; - past
workflows,itero checkand each of the daemon’s passes stop with an error naming the limit; - past
space, the daemon sendsitero.space.fulland logs anerror;keepforgets what it can, and until there is room no new run starts but internal ones; - past
log, the daemon sendsitero.log.fullonce, and again after the log is rolled and fills up; - a step quiet past
quiet, or running pastmost, is stopped and runs again, up to 3 times; then its run ends in error.