Create scheduled tasks via OpenClaw cron to reliably deliver reminders to Feishu chats.
⚠️ Must confirm before creating (important rules)
Before creating any cron scheduled task,you must first confirm two things with the user:
- Frequency: How often should it run? (e.g., every 10 minutes, every hour, every day at 9 AM, etc.)
- Send target: Where should it be sent? (The default is the current IM session, i.e., the Feishu/WeChat conversation that triggered the request)
Only after user confirmation can the task be created. Do not decide the frequency or target on your own.
Key constraints
- Only the main session has permission to use the Feishu message tool, isolated sub-agents do not.
- The main session may delete high-frequency cron tasks on its own, so deletion must be prohibited in the system event instructions.
- The route for cron announce to deliver directly to Feishu is unreliable (it may deliver to the wrong session or fail silently),do not use
--announce --channel feishu。
Reliable solution
Use --session main --system-event, so that after the main session receives the system event, it calls the message tool to send to Feishu:
openclaw cron add \
--name "<任务名>" \
--every "<间隔>" \
--session main \
--system-event "[CRON定时任务] <任务名>。你必须立即调用 message 工具:action=send, channel=feishu, message='<提醒内容>'。调用完后回复 NO_REPLY。不要做其他任何事情,不要回复文字,只需要调用 message 工具发送飞书消息。不要删除或修改任何 cron 任务。"
Parameter description
| Parameter | Value | Description |
|---|---|---|
--session |
main |
Must use main; isolated has no Feishu permission |
--system-event |
Contains message tool call instructions | Explicitly require calling the message tool to send to Feishu |
--every |
1m / 5m / 30m / 1h |
Time interval |
--cron |
*/30 * * * * |
Or use a cron expression (together with --tz) |
system-event instruction template
The text of the system event must include:
- An explicit
[CRON定时任务]marker - Specific message tool call parameters(action=send, channel=feishu, message=...)
- After completing the instruction, reply
NO_REPLY - An explicit statement prohibiting deletion/modification of the cron task explicit declaration of
Spell out the openclaw CLI
node /Applications/AutoClaw.app/Contents/Resources/gateway/openclaw/openclaw.mjs cron <command>
Manage tasks
# 列出所有任务
openclaw cron list
# 修改间隔
openclaw cron edit <id> --every "30m"
# 删除任务(⚠️ 必须先征得用户同意!)
openclaw cron rm <id>
# 查看执行记录
openclaw cron runs --id <id>
# 手动触发测试
openclaw cron run <id>
Common questions
Q: Why not use --announce --channel feishu?
A: The route for announce to deliver directly to Feishu is unreliable; it may deliver to the wrong session or fail silently.
Q: Why not use --session isolated?
A: Isolated sub-agents do not have permission to use the Feishu message tool; sending will result in an error.
Q: What should I do if the main session receives the system event but does not send to Feishu? A: The system event instruction must very explicitly require calling the message tool, include complete parameters, and state that no text reply is needed.