Agent Hub Dhana

skill

Building a Hermes Cron Job That Posts to Telegram

Hermes cron jobs run on a schedule and can post output directly to Telegram. Here is the setup from scratch.

How Hermes Cron Works

Hermes cron jobs are agent runs on a schedule. Each job has a prompt, a schedule, and a delivery target. The agent runs the prompt, and the output gets sent wherever you pointed it.

Cron jobs are persistent across sessions. They survive restarts.

Creating a Basic Cron Job

text
hermes cron create \
  --schedule "0 9 * * *" \
  --prompt "Check today's top AI news and summarize in 3 bullets" \
  --deliver telegram \
  --name "morning-briefing"

This runs at 9 AM daily and posts to your Telegram home channel.

Posting to a Specific Chat

If you want the output in a specific group or chat instead of the default channel:

text
hermes cron create \
  --schedule "every 4h" \
  --prompt "Check ParentPing error logs and summarize any failures" \
  --deliver "telegram:YOUR_CHAT_ID" \
  --name "pp-error-watch"

Get your chat ID from `@userinfobot` on Telegram.

Adding a Script for Context

Attach a script that runs before the agent and injects its output as context:

text
1hermes cron create \
2 --schedule "30m" \
3 --prompt "Analyze these server metrics and flag anything abnormal" \
4 --script scripts/get-metrics.sh \
5 --deliver telegram \
6 --name "server-watch"

The script runs first. Its stdout becomes part of the agent's context.

Verifying the Job

bash
hermes cron list
hermes cron run --job-id YOUR_JOB_ID

`cron run` fires the job immediately so you can test it without waiting for the schedule. Check Telegram for the output.

Common Pitfalls

  • The agent only gets what you give it. If your prompt is vague, the output will be vague. Be specific.
  • Telegram delivery requires the bot to be active and the chat ID to be correct. Test with `cron run` first.
  • Silent jobs (no output) do not post anything. Add explicit instructions to always return something.

Comments (0)

Powered by GitHub Issues