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
| Field | Type | Description |
|---|---|---|
id | string | Stable unique identifier |
name | string | Display name shown in the UI and Inbox |
description | string | Optional description |
enabled | bool | false pauses the Routine without deleting it |
trigger.mode | enum | schedule or manual |
trigger.cron | string | 5-field cron expression (required when mode: schedule) |
agent | string | Agent name — Chris, Steve, Mark, or a custom agent |
prompt | string | Prompt sent to the agent each time the Routine fires |
timeout_secs | int | Max 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)
* * * * *
| Expression | Meaning |
|---|---|
0 9 * * 1-5 | Every weekday at 9:00am |
0 8 * * 1 | Every 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 tray → http://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
- Configuration —
scheduler_enabledand global config