Skip to content

Chapter 7: Scheduled Tasks & Automation

Let the cuttlefish learn to work on a schedule — push a morning news briefing every day, compile a weekly report every Friday, check server status every hour. Even while you sleep, the cuttlefish stays busy.

What is Cron?

Hermes Agent has a built-in scheduled task system (Cron) that supports:

  • Natural language creation: Just say what you want in plain language
  • Multi-platform delivery: Send results to Feishu, Telegram, Discord, etc.
  • Skill binding: Scheduled tasks can auto-load Skills
  • Automatic retry: Automatically switches to backup provider on API rate limits

Core Mechanism

Cron is driven by the Gateway daemon process, which checks for due tasks every 60 seconds. Due tasks execute in an isolated Agent session.


Creating Scheduled Tasks

Method 1: Create in Conversation (Most Natural)

Just tell the Agent what you want:

You: Push today's weather and news summary to me every morning at 8am
Hermes: Done! Scheduled task created, runs daily at 08:00.
        Results will be sent to your Feishu Home Chat.

The Agent automatically calls the cronjob tool, setting the schedule, prompt, delivery target, etc.

Method 2: Use the /cron Command

/cron create

An interactive wizard guides you through filling in all fields.

Method 3: Standalone CLI

bash
hermes cron create \
  --schedule "0 8 * * *" \
  --prompt "Push today's weather and news summary" \
  --deliver telegram

Schedule Expressions

Multiple formats are supported:

FormatExampleDescription
Natural languageevery 2hEvery 2 hours
Natural language30mEvery 30 minutes
Cron expression0 9 * * *Every day at 9:00
ISO timestamp2026-04-15T09:00:00One-time task

Common Cron expression quick reference:

Every minute    * * * * *
Every hour      0 * * * *
Daily at 8:00   0 8 * * *
Weekdays at 9:00  0 9 * * 1-5
Monday at 10:00 0 10 * * 1
1st of month    0 8 1 * *

Skill Binding (Skill-backed Cron)

Scheduled tasks can bind Skills that are automatically loaded before execution:

You: Push a briefing every morning at 8am using the daily-briefing skill
Hermes: Created! Runs daily at 08:00 after loading the daily-briefing skill.

You can also bind multiple Skills (loaded in order):

bash
hermes cron create \
  --schedule "0 8 * * *" \
  --skills "web-content-fetch,arxiv" \
  --prompt "Push the latest AI research paper summaries"

TIP

Binding a Skill is more token-efficient and easier to maintain than stuffing full instructions into the prompt.


Delivery Targets

Execution results can be sent to any configured platform:

Delivery TargetDescription
originSend to the chat where the task was created
telegramTelegram
discordDiscord
feishuFeishu
emailEmail
localLocal storage only

You can also specify a specific chat ID:

deliver: telegram:-1001234567890
deliver: discord:#engineering
deliver: feishu:oc_xxxxxxxx

Silent Mode

If the Agent's final response starts with [SILENT], the message is not delivered, but still saved locally for auditing:

# In the cron prompt
"Check service status. If everything is fine, respond with [SILENT]. If there's an issue, report details."

Note

Failed tasks are always delivered, regardless of [SILENT]. Only successfully executed tasks can be silenced.


Managing Scheduled Tasks

View All Tasks

You: Show my scheduled tasks
# or
/cron list

Pause / Resume

/cron pause <job_id>
/cron resume <job_id>

Update

/cron update <job_id> --schedule "0 10 * * *"

No need to delete and recreate — you can update any field directly.

Delete

/cron remove <job_id>

Manual Trigger

/cron run <job_id>

For testing — executes immediately without waiting for the schedule.


Real-World Examples

Example 1: Daily Morning Briefing

You: Create a scheduled task for every day at 7:30am. Push today's weather forecast,
    important news summary, and my to-do list. Send to Feishu.

Agent automatically creates:

  • Schedule: 30 7 * * *
  • Prompt: includes weather, news, to-dos
  • Deliver: feishu
  • Home Chat marked

Example 2: Service Monitoring

You: Check every hour whether my website https://myapp.com is accessible.
    If it's fine, stay silent. If there's an issue, notify me on Telegram.

Example 3: Weekly Code Review

You: Every Friday at 5pm, automatically check this week's GitHub PRs,
    generate a code review report and post it to the Discord #engineering channel.
    Use the github-code-review skill.

Storage Locations

FileLocation
Task definitions~/.hermes/cron/jobs.json
Execution logs~/.hermes/cron/output/{job_id}/{timestamp}.md
Schedule lock~/.hermes/cron/.tick.lock

Security Restriction

Cron tasks cannot recursively create new Cron tasks. Hermes disables Cron management tools during Cron execution to prevent infinite scheduling loops.

Further Reading


Released under CC BY-NC-SA 4.0 | GitHub