Hermes Agent: Scheduled Tasks
Last updated: 2026-08-31
Scheduled tasks turn Hermes Agent into your automatic on-duty assistant — every morning it summarizes news automatically, every Friday it generates a weekly report, no manual triggering needed.
💡 Tip: Hermes' Cron system is built-in — no external scheduler (like crontab) needed. Task definitions go directly in the config, deeply integrated with skills and memory.
📋 Prerequisites: Lesson 7 Skills System
1. What You Will Learn
| # | Content |
|---|---|
| ❶ | Cron scheduling syntax |
| ❷ | Task creation and configuration |
| ❸ | Timed skill triggers |
| ❹ | Task monitoring and logging |
| ❺ | Error handling and retry |
2. Story
(1) Pain Point: Repeating Daily Operations
Bob spends 15 minutes every morning: checking email, reviewing Git status, browsing tech news. And every Friday he manually writes a weekly report.
(2) Solution: Agent On Duty Automatically
Alice sets up scheduled tasks, and the Agent handles everything automatically:
BASH
# Every day at 9:00 AM automatically
⏰ 09:00 Agent: Good morning! Today's briefing:
- 3 unread emails (1 urgent)
- 2 PRs pending review
- Tech highlight: React 19 officially released
# Every Friday at 5:00 PM auto-generate weekly report
⏰ Fri 17:00 Agent: Weekly report generated:
- 12 commits completed
- 5 bugs fixed
- 2 PRs merged
[Report sent to your email]
3. Cron Scheduling Syntax
(1) Basic Syntax
┌───────────── minute (0-59)
│ ┌───────────── hour (0-23)
│ │ ┌───────────── day of month (1-31)
│ │ │ ┌───────────── month (1-12)
│ │ │ │ ┌───────────── day of week (0-6, 0=Sunday)
│ │ │ │ │
* * * * *
(2) Common Expressions
| Expression | Meaning |
|---|---|
0 9 * * * |
Every day at 9:00 AM |
0 9 * * 1-5 |
Weekdays at 9:00 AM |
0 17 * * 5 |
Every Friday at 5:00 PM |
*/30 * * * * |
Every 30 minutes |
0 9,12,18 * * * |
Every day at 9:00 AM, 12:00 PM, 6:00 PM |
0 0 1 * * |
1st of every month at midnight |
4. Task Creation and Configuration
(1) Configuration File Method
YAML
# ~/.hermes/config.yaml
cron:
enabled: true
timezone: "America/New_York"
tasks:
# Daily briefing
- name: "daily-briefing"
schedule: "0 9 * * 1-5"
description: "Weekday morning briefing"
skill: "daily-briefing"
notify:
platform: "telegram"
chat_id: 123456789
# Weekly report
- name: "weekly-report"
schedule: "0 17 * * 5"
description: "Friday weekly report generation"
actions:
- type: "tool"
name: "code_shell"
command: "git log --since='1 week ago' --oneline"
- type: "skill"
name: "report-generator"
- type: "tool"
name: "email_send"
to: "alice@company.com"
subject: "Weekly Work Report"
# Code quality check
- name: "code-quality-check"
schedule: "0 2 * * *" # Every day at 2:00 AM
actions:
- type: "tool"
name: "code_shell"
command: "cd ~/projects/myapp && npm run lint"
- type: "tool"
name: "code_shell"
command: "cd ~/projects/myapp && npm test"
on_failure:
notify: "telegram"
message: "⚠️ Code quality check failed"
(2) Command Line Method
BASH
# Create a scheduled task
hermes cron add \
--name "morning-briefing" \
--schedule "0 9 * * 1-5" \
--skill "daily-briefing" \
--notify telegram
# List all tasks
hermes cron list
# Manual trigger (without waiting for schedule)
hermes cron run morning-briefing
# Pause/Resume
hermes cron pause morning-briefing
hermes cron resume morning-briefing
# Delete task
hermes cron delete morning-briefing
(3) Create in Conversation
BASH
me: Send me a tech news digest every morning at 9
Agent: I'll create a scheduled task:
Task name: tech-news-digest
Schedule: 0 9 * * *
Actions: web_search → summarize → notify
Confirm creation? (y/n)
me: y
Agent: ✅ Scheduled task "tech-news-digest" created!
5. Timed Skill Triggers
(1) Skill + Cron Combination
YAML
# Skill file: daily-briefing.yaml
name: "daily-briefing"
description: "Daily work briefing"
type: "cron-triggered"
actions:
- type: "tool"
name: "email_check"
params:
folder: "inbox"
unread_only: true
- type: "tool"
name: "code_shell"
command: "git -C ~/projects log --since='1 day ago' --oneline"
- type: "tool"
name: "web_search"
query: "tech news AI development"
- type: "generate"
template: |
📋 Today's Briefing ({{ date }})
📧 Unread emails: {{ email_count }}
🔨 Git Commits: {{ commit_count }}
📰 Tech Highlights:
{{#each news}}
- {{this.title}}
{{/each}}
(2) Conditional Execution
YAML
cron:
tasks:
- name: "pr-review-reminder"
schedule: "0 10 * * 1-5"
condition: "pending_prs > 0" # Only execute when there are PRs to review
actions:
- type: "tool"
name: "github_api"
endpoint: "/repos/{owner}/{repo}/pulls"
params:
state: "open"
- type: "notify"
platform: "slack"
message: "There are {{count}} PRs pending review"
6. Task Monitoring and Logging
(1) View Execution History
BASH
# View all task execution records
hermes cron history
# Output example:
# ┌──────────────────┬──────────┬─────────┬────────┬──────────┐
# │ Task │ Schedule │ Status │ Duration│ Last Run │
# ├──────────────────┼──────────┼─────────┼────────┼──────────┤
# │ daily-briefing │ 0 9 * * │ ✅ OK │ 12s │ 09:00 │
# │ weekly-report │ 0 17 * 5 │ ✅ OK │ 45s │ Fri 17:00│
# │ code-quality │ 0 2 * * │ ❌ FAIL │ 3s │ 02:00 │
# └──────────────────┴──────────┴─────────┴────────┴──────────┘
(2) Execution Logs
BASH
# View detailed logs for a single task
hermes cron logs daily-briefing --last
# Output example:
# [09:00:01] Task "daily-briefing" started
# [09:00:02] → tool: email_check → 3 unread
# [09:00:05] → tool: code_shell → 5 commits
# [09:00:08] → tool: web_search → 4 results
# [09:00:10] → generate: summary
# [09:00:12] → notify: telegram → sent
# [09:00:12] Task "daily-briefing" completed (12s)
7. Error Handling and Retry
(1) Retry Strategy
YAML
cron:
tasks:
- name: "api-health-check"
schedule: "*/5 * * * *"
actions:
- type: "tool"
name: "web_api"
url: "https://api.example.com/health"
# Retry strategy
retry:
max_attempts: 3
backoff: "exponential" # exponential / linear / fixed
initial_delay: 5 # Wait 5s before first retry
max_delay: 60 # Max wait 60s
# Failure notification
on_failure:
notify: "telegram"
message: "⚠️ API health check failed after 3 retries"
escalate_after: 3 # Escalate notification after 3 consecutive failures
(2) Timeout and Fallback
YAML
cron:
tasks:
- name: "daily-briefing"
schedule: "0 9 * * 1-5"
timeout: 120 # Timeout after 120 seconds
on_timeout:
action: "notify"
message: "⚠️ Morning briefing generation timed out, falling back to simplified version"
fallback_skill: "daily-briefing-simple"
❓ FAQ
Q Are scheduled tasks precise?
A Precise to the minute. System load may cause a few seconds of deviation — not suitable for sub-second precision requirements.
Q What happens to tasks when the machine is off?
A Tasks during downtime are skipped. You can configure
run_on_startup: true to run missed tasks on startup.Q Can scheduled tasks trigger skills and tools?
A Yes. Cron can trigger any skill, tool chain, shell command, or API call.
Q How to set timezone?
A Use the
cron.timezone config option, defaults to system timezone. Supports all IANA timezone names.Q How much resources do scheduled tasks consume?
A Nearly zero when idle. During execution, depends on task content, typically <1% CPU.
Q How to debug scheduled tasks?
A
hermes cron run <name> manually triggers with full logs, no need to wait for the schedule.📖 Summary
- Built-in Cron system — no external scheduler needed
- Standard Cron expressions + timezone configuration
- Three creation methods: config file, command line, in-conversation
- Skill + Cron combination for automated workflows
- Complete monitoring, logging, retry, and fallback mechanisms
📝 Exercises
- Basic (⭐): Create a scheduled task that runs every day at 9:00 AM and sends "Good Morning" to Telegram.
- Intermediate (⭐⭐): Create a scheduled task combining skills and tools that automatically summarizes Git commit history and sends an email daily.
- Advanced (⭐⭐⭐): Design a complete automated daily schedule system (morning briefing + midday reminder + evening summary + weekly report) with error handling and fallback strategies.