⏰ Scheduled Tasks
👤 Who it's for: Developers / DevOps
⏱️ Read time: ~6 minutes
💡 In one line: Tasks run on time, results arrive on time — no need to sit at the computer.
YingClaw has a built-in Cron scheduling system supporting Shell commands and AI Agent task execution on a schedule, with delivery to multiple messaging channels.
Task Types
| Type | Description | Use Case |
|---|---|---|
shell | Execute Shell commands | System checks, data backups, scheduled scripts |
agent | Execute AI prompts (Agent tasks) | Intelligent reports, data analysis, content creation |
Three Scheduling Methods
1. Cron Expression
The most flexible scheduling method, supporting standard cron syntax:
# Daily at 9 AM
schedule: { kind: "cron", expr: "0 9 * * *" }
# Every hour
schedule: { kind: "cron", expr: "0 * * * *" }
# Weekdays at 6 PM
schedule: { kind: "cron", expr: "0 18 * * 1-5" }
2. Fixed Time (at)
Execute once at a specific moment:
schedule: { kind: "at", at: "2026-06-15T08:00:00Z" }
3. Interval (every)
Repeat at fixed intervals:
# Every 30 minutes
schedule: { kind: "every", every_ms: 1800000 }
# Every hour
schedule: { kind: "every", every_ms: 3600000 }
Delivery Channels
Task execution results can be pushed to the following channels:
| Channel | Configuration |
|---|---|
| Telegram | Set delivery.channel: "telegram" and Chat ID |
| Discord | Set delivery.channel: "discord" and Channel ID |
| Slack | Set delivery.channel: "slack" and Channel ID |
Set delivery.channel: "weixin" | |
Set delivery.channel: "qq" |
Core Tools
| Tool | Function |
|---|---|
cron_add | Create a new scheduled task |
cron_list | List all scheduled tasks |
cron_update | Modify an existing task's configuration |
cron_remove | Delete a specified task |
cron_run | Manually trigger a task execution immediately |
Use Cases
| Scenario | Task Type | Example |
|---|---|---|
| Scheduled reports | agent | Daily 9 AM: generate yesterday's summary and send to Telegram |
| Data monitoring | shell | Hourly: check server CPU/memory/disk, alert on anomalies |
| Notifications | agent | Weekly Friday PM: push project progress summary |
| Automated ops | shell | Daily 3 AM: clean up expired log files |
Examples
Create a Scheduled Task
# Daily 9 AM report to Telegram
cron_add \
name="daily-report" \
job_type="agent" \
schedule='{"kind":"cron","expr":"0 9 * * *"}' \
prompt="Generate yesterday's work summary" \
delivery='{"mode":"announce","channel":"telegram","to":"YOUR_CHAT_ID"}'
Manage Scheduled Tasks
# List all tasks
cron_list
# Modify a task's schedule
cron_update job_id="xxx" patch='{"schedule":{"kind":"cron","expr":"0 10 * * *"}}'
# Trigger manually
cron_run job_id="xxx"
# Delete a task
cron_remove job_id="xxx"
Notes
- 📋 Task results are logged by default, not pushed. Configure
deliveryfor push notifications - ⏱️ Agent tasks have execution timeout limits — set
timeout_secsparameter - 🔁 Avoid overly frequent tasks (e.g. every second) as they may impact performance
- 🧹 Periodically clean up unused scheduled tasks to keep the list tidy
Next Steps
Scheduled tasks automate your operations. Next, explore 🌐 Browser Automation for web interaction capabilities.