Routines

A Routine is a YAML-defined agent task that runs on a cron schedule. Define a Routine once, and Huginn fires it at the configured time — no crontab, no launchd, no external scheduler. Results from each run land in the Inbox in the web UI.

Want to chain multiple Routines into an ordered pipeline? See Workflows.


Creating a Routine

Create a YAML file in ~/.huginn/routines/. The filename stem becomes the Routine’s slug — used to reference it from Workflows.

# ~/.huginn/routines/morning-review.yaml
id: "a3f8bc12"
name: "Morning PR Review"
description: "Scan open PRs and summarize findings in Inbox"
enabled: true
trigger:
  mode: schedule
  cron: "0 9 * * 1-5"   # weekdays at 9am
agent: Mark
prompt: |
  Review all open PRs in this repository. For each one, summarize:
  - What it changes
  - Whether tests cover the change
  - Any obvious issues
  Report findings as a structured list.
timeout_secs: 300

YAML field reference

FieldTypeDescription
idstringStable unique identifier
namestringDisplay name shown in the UI and Inbox
descriptionstringOptional description
enabledboolfalse pauses the Routine without deleting it
trigger.modeenumschedule or manual
trigger.cronstring5-field cron expression (required when mode: schedule)
agentstringAgent name — Chris, Steve, Mark, or a custom agent
promptstringPrompt sent to the agent each time the Routine fires
timeout_secsintMax seconds before the session is cancelled (default: 300)

Cron syntax

Huginn uses standard 5-field cron. Sub-minute scheduling is not supported.

┌───── minute (0–59)
│ ┌───── hour (0–23)
│ │ ┌───── day of month (1–31)
│ │ │ ┌───── month (1–12)
│ │ │ │ ┌───── day of week (0–6, Sunday = 0)
* * * * *
ExpressionMeaning
0 9 * * 1-5Every weekday at 9:00am
0 8 * * 1Every Monday at 8:00am
0 23 * * *Every night at 11:00pm
*/30 * * * *Every 30 minutes

Use crontab.guru to validate expressions before deploying.


Viewing results

Open the web UI (huginn trayhttp://localhost:8421) and click Inbox in the sidebar. Each Routine run appears as a notification with the Routine name, timestamp, and full agent output. Unread notifications are highlighted and a live badge counter updates in real time.


Managing Routines

Changes made via the web UI or by editing YAML take effect immediately — no restart required. The scheduler re-registers the Routine’s cron entry as soon as the file is saved.

To pause a Routine without deleting it, set enabled: false.

To disable all automations globally:

// ~/.huginn/config.json
{
  "scheduler_enabled": false
}

Permissions and safety

Routines run in headless mode. Write and exec tools still require approval by default — a Routine that calls write_file or bash will stall waiting for approval that never arrives.

Best practice: Design Routines to use only read-oriented tools — file reads, git log, code search. Reserve write-capable Routines for environments where --dangerously-skip-permissions is acceptable.


Workflow-only Routines

Set trigger.mode: manual (or omit trigger.cron) to create a Routine that never fires on its own. It can still be referenced and executed as a step inside a Workflow.

trigger:
  mode: manual   # only runs when a Workflow invokes it

See also

  • Workflows — chain Routines into ordered pipelines
  • Permissions — why write tools stall in unattended Routines
  • Configurationscheduler_enabled and global config