✦
Hermes Agent

How-To Guide

How to Schedule and Recover Hermes Agent Cron Jobs

Create, verify, diagnose, and recover Hermes cron jobs with exact schedules, lifecycle states, run history, delivery proof, timeouts, and safe reruns.

Quick answer

Create a supported recurring schedule, use a self-contained prompt and absolute workdir, pin the real delivery target, and trigger one test. If it fails, separate job lifecycle (scheduled, paused, completed, blocked_config) from execution history (completed, failed, unknown) and delivery state. Pause consequential jobs before repair, reconcile external side effects before rerunning, and remember cron expressions use the host's local timezone.

Hermes can schedule one-shot work, recurring agent sessions, hybrid script-plus-agent checks, and zero-token script-only watchdogs. Reliable setup is not only a cron expression: the future run needs a complete prompt, the right project and tools, controlled provider behavior, exact delivery, and a result you can verify.

Deploy Hermes faster with FlyHermes

Managed cloud · API costs included · Skill library · Cancel anytime

Before you start:

  • ☑Hermes Agent installed and able to complete the underlying task interactively
  • ☑A running gateway for automatic scheduler ticks and platform delivery
  • ☑A tested provider/model lane for LLM-driven jobs, or a tested script under ~/.hermes/scripts/ for no-agent mode
  • ☑An absolute project directory when the job needs repository instructions or file/terminal tools
  • ☑A tested local, Telegram, Discord, Slack, email, or other delivery destination

Steps

  1. 1

    Prove the task and gateway work

    Run the task once interactively, then check hermes doctor, hermes gateway status, and hermes cron status. Fix provider, tool, credential, or gateway failures before adding a schedule.

  2. 2

    Choose agent, hybrid, or script-only mode

    Use an agent job for research, judgment, writing, browser work, or publishing. Use --no-agent --script filename for a deterministic script under ~/.hermes/scripts/. Use a pre-check script without no-agent when the script should wake the LLM only after a change.

  3. 3

    Write a self-contained future prompt

    Cron agent runs start in fresh sessions. Include source paths, URLs, constraints, output format, failure behavior, and the proof of success. Do not rely on phrases such as 'the usual report.'

  4. 4

    Create a supported schedule

    Use hermes cron create "0 9 * * 1-5" "<prompt>" --name "Weekday brief" for a weekday 9am job. Hermes also supports relative delays (30m), intervals (every 2h), and ISO timestamps.

  5. 5

    Set an absolute project workdir

    Add --workdir /absolute/path/to/project for repository work. Hermes then loads supported project instruction files and points terminal, file, and code tools at that directory. Relative or missing directories are rejected.

  6. 6

    Attach only needed skills and toolsets

    Add repeatable --skill flags for reusable procedures. Configure the cron platform in hermes tools, or ask Hermes to set per-job enabled_toolsets, so routine jobs do not carry unnecessary browser, terminal, or delegation access.

  7. 7

    Confirm provider and model behavior

    Hermes snapshots the active provider/model when the job is created and fails closed after an unexpected global default change. The standalone create command does not expose provider/model flags, so ask Hermes in chat to pin those advanced job fields when needed.

  8. 8

    Pin exact delivery

    Use --deliver local, telegram, discord, or an exact target such as telegram:-1001234567890:17585. For Slack, use slack:C0123456789 for a channel ID, slack:#engineering for a discovered channel name, or slack:U0123456789 for a DM. Invite the bot and prefer raw IDs for unattended work.

  9. 9

    Trigger one run and inspect the outcome

    Run hermes cron run "Weekday brief", wait for the next scheduler tick, then inspect hermes cron list, hermes cron runs "Weekday brief" --limit 20, local output, and the exact destination. A completed ledger row is useful evidence, but the delivered message or artifact is the final proof.

  10. 10

    Add silence, continuation, or chaining deliberately

    Use [SILENT] for successful agent no-op runs, empty stdout for script-only silence, attach_to_session for a replyable brief, and context_from for explicit upstream-output handoffs. These are opt-in behaviors, not shared memory.

  11. 11

    Know the recovery commands

    If provider limits or bad delivery create repeated failures, use a normal shell: hermes cron pause <id-or-name>, fix the provider/gateway/target, trigger a test, then hermes cron resume <id-or-name>. Use remove only when the job should be deleted.

  12. 12

    Classify the failure layer

    Run hermes gateway status, hermes cron status, hermes cron list, and hermes cron runs <job> --limit 20. Separate schedule lifecycle, execution result, delivery error, and intentionally silent output before changing the job.

  13. 13

    Check timezone and repeat state

    Cron expressions use the scheduler host's local timezone. Relative delays and ISO timestamps are one-shot; intervals and five-field expressions recur. A completed job may simply have exhausted its finite repeat count.

  14. 14

    Recover with a controlled rerun

    Pause a noisy or consequential recurring job, fix one failing layer, trigger one test, and verify the external destination or artifact before resuming. Reconcile any unknown run first so a rerun cannot duplicate side effects.

  15. 15

    Pin reasoning effort when useful

    Use hermes cron edit <job> --reasoning-effort high|minimal to give complex and routine jobs different thinking budgets. The pin is user-owned and does not apply to no-agent jobs.

Pro Tips

  • 💡Use cron expressions for exact wall-clock schedules and intervals such as every 2h for cadence-based work.
  • 💡Agent jobs run in fresh sessions; keep procedures in skills and make every prompt self-contained.
  • 💡CLI-created jobs default to local delivery, while messaging-created jobs normally default to origin.
  • 💡Script-only jobs save model tokens: non-empty stdout delivers, empty stdout stays silent, and failures alert.
  • 💡Use a hybrid pre-check script with {"wakeAgent": false} when frequent polls rarely need reasoning.
  • 💡Set a workdir for repo jobs; otherwise project instructions and the intended cwd are not automatic.
  • 💡Pin important reports to an exact chat, topic, thread, or channel and verify the first delivery.
  • 💡Pause noisy jobs from a normal shell if the interactive provider is rate-limited.
  • 💡The dashboard is a checkpoint; the delivered message or artifact is the success proof.
  • 💡Use continuable delivery only for briefs that need follow-up, and context_from only for explicit job pipelines.

Troubleshooting

❌ The job did not run

✅ Check hermes cron status and gateway health, then confirm the schedule, next_run_at, host uptime, and repeat state. Trigger one manual run with hermes cron run <id-or-name>.

❌ The job stopped after a global model change

✅ Hermes fails closed to prevent an unattended provider/model switch. Ask Hermes to pin the intended provider/model on the job, then trigger a test run.

❌ The job runs in the wrong repository

✅ Set an absolute workdir. Cron jobs are detached from repositories by default and do not otherwise load project instruction files automatically.

❌ The job succeeds but the channel receives nothing

✅ Verify the exact delivery target, home-channel configuration, platform permissions, and gateway adapter. Inspect local cron output to separate execution from delivery.

❌ A rate-limited job keeps sending errors

✅ Use a normal shell to run hermes cron pause <id-or-name>. Fix or change the provider lane, reduce frequency/toolsets, or move deterministic checks to no-agent mode before resuming.

❌ Replying to a delivered brief loses context

✅ Continuable delivery is off by default. Enable attach_to_session for that job or cron.mirror_delivery globally, then test on a supported thread or DM surface.

❌ The job shows completed and will not fire again

✅ Check whether the schedule was a one-shot or its repeat count was exhausted. Edit/re-arm a repeatable job or create a new future one-shot deliberately.

❌ Run history says unknown after a restart

✅ Treat the attempt as uncertain. Reconcile the real target first; Hermes preserves unknown as an audit state and does not automatically rerun it.

❌ The job fires at the wrong hour

✅ Cron expressions use the scheduler host's local timezone. Compare the host clock with next_run_at and include the report's operating timezone in the prompt.

❌ The task completed but delivery timed out

✅ Inspect last_delivery_error and the real destination. Media and Bot Chat delivery have separate timeout budgets; the target turn may still finish, so do not immediately duplicate the run.

FAQ

How do I create a daily Hermes cron job?

Use hermes cron create "0 9 * * *" "<self-contained prompt>" --name "Daily job" --deliver <target>, then trigger one test with hermes cron run "Daily job".

Do Hermes cron jobs run while my laptop sleeps?

No. The gateway host must be awake and running. Use an always-on server or a managed service when the schedule is business-critical.

Can I schedule a job with no model cost?

Yes. Use --no-agent --script filename for a script under ~/.hermes/scripts/. Empty stdout is silent, non-empty stdout is delivered, and errors alert.

Why should I set workdir?

Without workdir, cron is detached from the repository. An absolute workdir loads supported project instructions and makes file, terminal, and code tools start in the intended project.

How do I send a Hermes cron job to a specific Slack channel?

Invite the bot to the channel and use --deliver slack:C0123456789 with the raw channel ID. Trigger one run, inspect hermes cron runs <job> --limit 20, and confirm the message landed in that channel.

What is the difference between failed and blocked_config?

Failed describes an execution attempt that did not complete. blocked_config is a preflight state: Hermes found a provider, skill, or delivery configuration problem before inference and avoided the model call.

Does Hermes automatically rerun an unknown cron attempt?

No. Unknown is retained for audit after restart recovery. Reconcile the external target and trigger a new attempt only when duplication is safe.

How long can a Hermes cron job run?

Agent runs use an inactivity timeout, while pre-run scripts, media sends, cleanup, and Bot Chat delivery have separate configurable budgets. Diagnose the stalled phase before increasing a timeout.

Related setup and cost guides

Related Guides