Tried for a long time before finding the correct way to create a cron job and send to a Telegram topic.
I saw a lot of people on GitHub had the same problem, so I’m sharing this in case it helps you.
TL;DR
sessionTarget -> isolated
to: telegram_group_id: telegram_topic_id
In .openclaw/cron/jobs.json,
....
"sessionTarget": "isolated",
....
"delivery": {
"mode": "announce",
"channel": "telegram",
"to": "-10038316xxxxx:xxxx" //workable Telegram Group ID: Telegram Topic ID
},
"to": "-10038316xxxxx:topic:xxxx" //won't work
"to": "channel:-10038316xxxxx:topic:2196" //won't work
A template using Openclaw CLI to add a cron job:
openclaw cron add \
--name "Check current weather" \
--cron "0 7 * * *" \
--tz "America/Los_Angeles" \
--session isolated \
--message "Check today's chance of precipitation." \
--announce \
--channel telegram \
--to "telegram_group_id:telegram_topic"
For example, my Telegram group ID is 38316xxxxx (convert to -10038316xxxxx, you may add @IDBot to your group and use the /getgroupid@myidbot command to retrieve your Telegram group ID) and topic ID.
openclaw cron add \
--name "Check current weather" \
--cron "0 7 * * *" \
--tz "America/Los_Angeles" \
--session isolated \
--message "Check today's chance of precipitation." \
--announce \
--channel telegram \
--to "-10038316xxxxx:2196"
Try to execute the cron job manually by
openclaw cron run your_job_id
openclaw cron run 226e39ac-2a6a-47b7-b1ad-ab050be926db
You should receive a message from the corresponding Topic on Telegram if everything works properly.
You may check the cron job status by
openclaw cron list
