Routines

Routines are what a Seed does on its own, on a schedule. There are two kinds.

Agent routines ("ask me to…")

A task the Seed runs with its chat tools, unattended, for example "every morning at 8, tell me how many recipes were added yesterday". The Seed reads data, calls its app, and writes a short report that is posted in the chat. When there is nothing worth saying it replies NOTHING_TO_REPORT, and the run is recorded as quiet with no message.

Jobs ("call my app")

A request to the organism's own endpoint on a schedule. No model is involved: the app's code does the work (sending reminders, cleaning up, syncing).

The organism declares its jobs in organism/routines.yaml:

jobs:
  - name: send-reminders           # kebab-case, unique
    schedule: every 1h             # or cron: "0 8 * * *"
    timezone: Europe/Lisbon        # optional, default UTC
    method: POST                   # optional, default POST
    path: /internal/jobs/send-reminders
    description: Email owners whose recipes have no photo.

Schedules

every 15m, every 2h, every 1d (at midnight) or 5-field cron (minute hour day month weekday, with *, lists, ranges and steps), in an IANA timezone. Intervals are aligned (every 1h runs on the hour). A routine missed while the Seed was stopped runs once when it starts again, not once per missed time.

Runs

Every run is recorded with its trigger (schedule or manual), status (ok, quiet, failed, running) and output; the last 100 runs of each routine are kept. A run interrupted by a restart is marked failed.

Edit this page on GitHub