Academy → Developer guideOfficial documentation · clear explanation

Cron Internals

Cron Internals

Developer15 minutes3 questions2026-08-09
The idea in one minute

Start with meaning, then move to detail.

This lesson explains Cron Internals as part of Hermes internals and extension points. You will learn what it does, when it matters, and the smallest safe test that proves it works.

If you are new

If you are new, do not memorize names. Focus on three questions: what problem does this solve, what access does it need, and how can you verify the result?

For hands-on use

For practice, inspect the first example, identify its effects, run it on test data, and compare the result with the source claim.

For specialists

For advanced readers, inspect Key Files, Scheduling Model, Job Storage, then verify failure modes and version compatibility.

What do you need first?

Know Python, Git, and basic project structure before changing code.

What will you know?

A clear outcome before you read.

  • Understand Cron Internals without assumed prior knowledge.
  • Separate the source description from what still needs testing in your environment.
  • Read the first command and identify its inputs and outputs before copying it.
Lesson terms

Short definitions before the details.

Provider
The service that runs or provides access and authentication to a model.
Gateway
The process that connects Hermes to channels such as Telegram or Discord and routes messages.
Session & memory
A session holds conversation context, while memory keeps selected facts that should persist.
Automation
Running work later or repeatedly with explicit success and failure conditions.
Official page description

How Hermes stores, schedules, edits, pauses, skill-loads, and delivers cron jobs

Topic map

What does the source say, and in what order?

  1. 01
    Key Files

    Start here to understand the core idea or structure.

  2. 02
    Scheduling Model

    Read this after the foundation, then connect it to the previous step.

  3. 03
    Job Storage

    Read this after the foundation, then connect it to the previous step.

  4. 04
    Job Lifecycle States

    Read this after the foundation, then connect it to the previous step.

  5. 05
    Backward Compatibility

    Read this after the foundation, then connect it to the previous step.

  6. 06
    Scheduler Runtime

    Read this after the foundation, then connect it to the previous step.

  7. 07
    Tick Cycle

    Read this after the foundation, then connect it to the previous step.

  8. 08
    Gateway Integration

    Read this after the foundation, then connect it to the previous step.

  9. 09
    Managed cron (Chronos) for scale-to-zero

    Read this after the foundation, then connect it to the previous step.

  10. 10
    Fresh Session Isolation

    Finish here to verify the result and special cases.

Examples from the official page

Copy only after you understand the effect.

{ "id": "a1b2c3d4e5f6", "name": "Daily briefing", "prompt": "Summarize today's AI news and funding rounds", "schedule": { "kind": "cron", "expr": "0 9 * * *", "display": "0 9 * * *" }, "skills": ["ai-funding-daily-report"], "deliver": "telegram:-1001234567890", "repeat": { "times": null, "completed": 42 }, "state": "scheduled", "enabled": true, "next_run_at": "2025-01-16T09:00:00Z", "last_run_at": "2025-01-15T09:00:00Z", "last_status": "ok", "created_at": "2025-01-01T00:00:00Z", "model": null, "provider": null, "script": null }
tick() 1. Acquire scheduler lock (prevents overlapping ticks) 2. Load all jobs from jobs.json 3. Filter to due jobs (next_run <= now AND state == "scheduled") 4. For each due job: a. Set state to "running" b. Create fresh AIAgent session (no conversation history) c. Load attached skills in order (injected as user messages) d. Run the job prompt through the agent e. Deliver the response to the configured target f. Update run_count, compute next_run g. If repeat count exhausted → state = "completed" h. Otherwise → state = "scheduled" 5. Write upd
create/update a cron job → Chronos asks Nous to arm a one-shot at the job's next_run_at (authenticated with the agent's existing Nous token) → at fire time Nous calls the gateway: POST {callback_url}/api/cron/fire (authenticated with a short-lived, purpose-scoped Nous-minted JWT) → the gateway verifies the token, claims the job (store compare-and-set so multi-replica deployments fire at-most-once), runs it, and re-arms the next one-shot
Try it now

Read the first command and identify its inputs and outputs before copying it.

Match every command to your installed Hermes version, review the files and accounts it can reach, and use non-sensitive data for the first test. If this explanation differs from the source, the official source wins.

Knowledge check

Three decisions before completion.

1. What is the source of truth when “Cron Internals” changes?
2. What is the best way to apply this lesson?
3. What should happen before a step can modify files or an external account?