Daemon mode
The scheduler daemon is a long-running process that reads <workspace>/.insightworker/schedules.yaml and runs each schedule on its interval or cron expression. Use it for unattended work: morning digests, periodic checks, monitoring.
Not to be confused with
--workermode. The scheduler daemon runs your schedules.yaml.insightworker --workeris a different daemon that joins an InsightStudio coordinator and runs the jobs Studio queues. They are independent processes and can run side by side.
Start the daemon
cd /path/to/workspace
insightworker --daemon
It runs in the foreground and reads the schedule file from the directory you start it in (or from WORKSPACE_DIR). If the file has no valid schedules the daemon exits with an error. To keep it running after you log out, use a system service (below) or:
nohup insightworker --daemon > daemon.out 2>&1 &
List what is loaded
insightworker schedule list
Prints one line per schedule in the file, with its cadence and payload. Entries that fail validation (missing name, both every: and cron:, bad cron expression, interval under 30 seconds) are reported and skipped.
Stop
There is no stop subcommand. Send SIGINT or SIGTERM; the daemon clears its timers and waits for in-flight runs to finish before exiting.
# Foreground: Ctrl-C
# Backgrounded:
kill $(pgrep -f 'insightworker --daemon')
# launchd: launchctl unload ~/Library/LaunchAgents/com.verticalserve.insightworker.plist
# systemd: systemctl --user stop insightworker
Schedule file
<workspace>/.insightworker/schedules.yaml:
schedules:
- name: morning-digest
cron: "0 9 * * 1-5"
prompt: "Pull the active sprint from JIRA, group by status, and write reports/digest.md."
enabled: true
- name: hourly-check
every: 1h
workflow: pipeline-check # an app under apps/pipeline-check/
Each entry needs a unique name, a cadence (every: or cron:, not both) and a payload (prompt: or workflow:). enabled is optional and defaults to true. Other keys are ignored. See the scheduling overview for the full format.
The file is read once at startup. Restart the daemon to pick up edits.
Run as a system service
macOS (launchd)
~/Library/LaunchAgents/com.verticalserve.insightworker.plist:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>com.verticalserve.insightworker</string>
<key>ProgramArguments</key>
<array>
<string>/usr/local/bin/insightworker</string>
<string>--daemon</string>
</array>
<key>WorkingDirectory</key>
<string>/Users/you/projects/myworkspace</string>
<key>RunAtLoad</key>
<true/>
<key>KeepAlive</key>
<true/>
<key>StandardOutPath</key>
<string>/tmp/insightworker.out</string>
<key>StandardErrorPath</key>
<string>/tmp/insightworker.err</string>
</dict>
</plist>
Load:
launchctl load ~/Library/LaunchAgents/com.verticalserve.insightworker.plist
Linux (systemd, user mode)
~/.config/systemd/user/insightworker.service:
[Unit]
Description=InsightWorker daemon
After=network.target
[Service]
Type=simple
ExecStart=/usr/local/bin/insightworker --daemon
WorkingDirectory=/home/you/projects/myworkspace
Restart=on-failure
RestartSec=5
[Install]
WantedBy=default.target
Enable:
systemctl --user daemon-reload
systemctl --user enable --now insightworker
Set WorkingDirectory to the workspace that holds .insightworker/schedules.yaml; the daemon looks for the file relative to where it starts. Adjust the path to the insightworker binary to match which insightworker on your machine.
Logs
| What | Where |
|---|---|
| Daemon status lines (startup summary, one status line per minute) | stderr — /tmp/insightworker.err (launchd example above) or journalctl --user -u insightworker (systemd) |
Per-schedule log (START, tool_call <name>, OK / ERROR, SKIP) | <workspace>/.insightworker/logs/<schedule-name>.log |
The per-schedule log records the name of each tool called and the first 200 characters of the final answer. It does not store full transcripts.
Concurrency
Different schedules run independently and may overlap. A single schedule never overlaps itself: if its previous run is still going when the next tick is due, that tick is skipped and logged as SKIP (previous run still in flight). Runs are not queued, and runs missed while the daemon was down are not caught up.
Failure handling
If a run throws an error, the daemon writes an ERROR line to that schedule's log and carries on; the next tick fires as normal. To get an alert on failure, have the prompt itself send one (for example with send_email), or watch the log files with your existing monitoring.
Tool approval in daemon mode
Nobody is present to answer a prompt, so the daemon approves every tool call the agent makes, including bash, send_email and database queries. Treat a schedule's prompt as code you are running unattended:
- Run the daemon as a user with only the access the schedules need.
- Leave credentials for systems the schedules don't use out of that user's
.env. - Test each schedule once with
insightworker schedule run --dry-run <name>before enabling it — see Dry-run.
In enterprise mode, a tool blocked by organisation policy stays blocked in the daemon too.
Limits
# .env
MAX_AGENT_ITERATIONS=25 # default; raise for long multi-step runs
MAX_TOOL_OUTPUT_LENGTH=20000 # optional hard cap on a single tool result (chars)
Cap memory or CPU with your service manager (for example MemoryMax= in the systemd unit).
See also
- Scheduling overview — file format and cadence syntax
- Cron syntax — expression reference
- Dry-run — preview emails before enabling a schedule
- Tool approval — how prompts work on each surface