Scheduler
Execute tasks and commands on a schedule using natural language. Run shell commands, agent tasks, API health checks, file operations, and automations — one-shot or recurring.
Usage
/schedule run npm test in 5 minutes
/schedule git pull origin main tomorrow at 6am
/schedule generate weekly sales report every monday at 9am
/schedule check https://api.example.com/health every 30m
/schedule clean /tmp files every day at 3am silently
/schedule back up database every sunday at 2am
/schedule restart server in 10 minutes silently
/schedule list
/schedule cancel <jobId>
Agent Instructions
When the user triggers /schedule, determine the intent:
- list → call
cron.list and show active scheduled tasks.
- cancel / delete / remove
<jobId> → call cron.remove with that jobId.
- everything else → create a new scheduled task (steps below).
Step 1: Parse the Input
Extract four things: WHAT (the task to execute), WHEN (the time), RECURRENCE (one-shot or recurring), DELIVERY (announce results or run silently).
Identify the Task (WHAT)
Classify the user's request into a task type:
| Task Type |
Trigger Words |
Agent Action |
| Shell command |
run, execute, do, command-like syntax (npm, git, docker, curl, python) |
Execute the command using Bash tool |
| Agent task |
generate, summarize, analyze, write, create, compile, review |
Perform the task using available agent tools |
| API/health check |
check, ping, hit, call, URL patterns (https://...) |
Fetch the URL and report status |
| File operation |
clean, back up, copy, move, archive, compress |
Perform file operations using available tools |
| Custom prompt |
anything else |
Execute as a free-form agent prompt |
The WHAT becomes the payload.message — a clear instruction for the agent that wakes up to execute it.
Identify the Time (WHEN)
Use the same time-parsing pipeline as the remindme skill:
Layer 1: Pattern Matching
Scan for these patterns (first match wins):
Relative durations — in <number> <unit>:
| Pattern |
Duration |
in Ns, in N seconds |
N seconds |
in Nm, in N min, in N minutes |
N minutes |
in Nh, in N hours |
N hours |
in Nd, in N days |
N * 24 hours |
in Nw, in N weeks |
N * 7 days |
Absolute clock times — at <time>:
| Pattern |
Meaning |
at HH:MM, at H:MMam/pm |
Today at that time (or tomorrow if past) |
at Ham/pm, at HH |
Today at that hour |
Named days:
| Pattern |
Meaning |
tomorrow |
Next calendar day, default 9am |
tonight |
Today at 8pm |
next monday..sunday |
Coming occurrence, default 9am |
Recurring — every <pattern>:
| Pattern |
Schedule |
every Nm/Nh/Nd |
kind: "every", everyMs: N * unit_ms |
every day at <time> |
kind: "cron", expr: "M H * * *" |
every <weekday> at <time> |
kind: "cron", expr: "M H * * DOW" |
every weekday at <time> |
kind: "cron", expr: "M H * * 1-5" |
every weekend at <time> |
kind: "cron", expr: "M H * * 0,6" |
every hour |
kind: "every", everyMs: 3600000 |
Unit conversion table:
| Unit |
Milliseconds |
| 1 second |
1000 |
| 1 minute |
60000 |
| 1 hour |
3600000 |
| 1 day |
86400000 |
| 1 week |
604800000 |
Layer 2: Slang & Shorthand
| Phrase |
Resolves to |
in a bit, shortly |
30 minutes |
in a while |
1 hour |
later, later today |
3 hours |
end of day, eod |
Today 5pm |
end of week, eow |
Friday 5pm |
morning |
9am |
afternoon |
2pm |
evening |
6pm |
midnight |
12am next day |
noon |
12pm |
Layer 3: Ambiguity — Ask, Don't Guess
If you can't determine WHEN, ask the user. Never silently pick a default time.
Identify Delivery Mode (DELIVERY)
| User says |
Delivery mode |
silently, quietly, in background, no output |
"none" — runs without reporting back |
Nothing specified, or report, show results, announce |
"announce" — sends task output to channel |
Step 2: Compute the Schedule
Timezone rule: ALWAYS use the user's local timezone (system timezone). Never default to UTC.
One-shot → ISO 8601 timestamp with the user's local timezone offset.
- If the computed time is in the PAST, bump to the next occurrence.
Recurring (cron) → 5-field cron expression with tz set to the user's IANA timezone.
Recurring (interval) → kind: "every" with everyMs in milliseconds.
Step 3: Security Check
Before scheduling, check if the task involves destructive operations:
Destructive patterns (require explicit user confirmation):
- File deletion:
rm, del, remove, wipe, clean (unless cleaning temp/cache)
- Database:
drop, truncate, delete from, destroy
- Git:
reset --hard, push --force, branch -D
- System:
kill, shutdown, reboot, format
- Network:
iptables, firewall, ufw
If a destructive pattern is detected:
- Warn the user: "This task involves a destructive operation (
<command>). Are you sure you want to schedule this?"
- Only proceed after explicit confirmation.
- Include
[CONFIRMED DESTRUCTIVE] in the job name for audit trail.
Safe patterns (no confirmation needed):
- Read-only:
ls, cat, git status, git log, curl GET, ping
- Build/test:
npm test, npm build, make, cargo test
- Reports:
generate, summarize, analyze, compile report
Step 4: Detect the Delivery Channel
Same priority order as remindme:
- Explicit override — user says "on telegram" / "on discord" etc.
- Current channel — if messaging from an external channel, deliver there.
- Preferred channel — from MEMORY.md.
- Last external channel —
channel: "last".
- No channel + delivery mode "none" — OK, task runs silently.
- No channel + delivery mode "announce" — ask: "Where should I send the task results?"
Step 5: Call cron.add
One-shot task:
{
"name": "Task: <short description>",
"schedule": {
"kind": "at",
"at": "<ISO 8601 timestamp>"
},
"sessionTarget": "isolated",
"wakeMode": "now",
"payload": {
"kind": "agentTurn",
"message": "SCHEDULED TASK: <detailed task instruction>. Execute this task now and report the results."
},
"delivery": {
"mode": "announce",
"channel": "<detected channel>",
"to": "<detected target>",
"bestEffort": true
},
"deleteAfterRun": true
}
Recurring task (cron):
{
"name": "Recurring Task: <short description>",
"schedule": {
"kind": "cron",
"expr": "<cron expression>",
"tz": "<IANA timezone>"
},
"sessionTarget": "isolated",
"wakeMode": "now",
"payload": {
"kind": "agentTurn",
"message": "RECURRING TASK: <detailed task instruction>. Execute this task now and report the results."
},
"delivery": {
"mode": "announce",
"channel": "<detected channel>",
"to": "<detected target>",
"bestEffort": true
}
}
Recurring task (interval):
{
"name": "Recurring Task: <short description>",
"schedule": {
"kind": "every",
"everyMs": "<interval in milliseconds>"
},
"sessionTarget": "isolated",
"wakeMode": "now",
"payload": {
"kind": "agentTurn",
"message": "RECURRING TASK: <detailed task instruction>. Execute this task now and report the results."
},
"delivery": {
"mode": "<announce or none>",
"channel": "<detected channel>",
"to": "<detected target>",
"bestEffort": true
}
}
Silent task (no delivery):
{
"name": "Task: <short description>",
"schedule": {
"kind": "at",
"at": "<ISO 8601 timestamp>"
},
"sessionTarget": "isolated",
"wakeMode": "now",
"payload": {
"kind": "agentTurn",
"message": "SCHEDULED TASK (SILENT): <detailed task instruction>. Execute this task now. No delivery needed — log results only."
},
"deleteAfterRun": true
}
Step 6: Confirm to User
After cron.add succeeds, reply with:
Task scheduled!
Command: <task description>
Runs: <friendly time description> (<ISO timestamp or cron expression>)
Delivery: <channel or "silent">
Job ID: <jobId> (use "/schedule cancel <jobId>" to remove)
Rules
- ALWAYS use
deleteAfterRun: true for one-shot tasks. Omit for recurring.
- ALWAYS use
sessionTarget: "isolated" — tasks run in their own sandboxed session.
- ALWAYS use
wakeMode: "now" — ensures execution at the scheduled time.
- ALWAYS use
delivery.bestEffort: true when delivery mode is "announce".
- NEVER use
act:wait or loops for delays. Cron handles timing.
- Always use the user's local timezone. Never default to UTC.
- For recurring tasks, do NOT set
deleteAfterRun.
- Always return the jobId so the user can cancel or audit later.
- Confirm destructive operations before scheduling. Never silently schedule
rm, drop, kill, etc.
- Prefix job names with
Task: (one-shot) or Recurring Task: (recurring) for audit trail and scoped cleanup.
Platform Requirements
This skill has zero bundled dependencies because it relies on OpenClaw's built-in capabilities:
- Cron scheduling:
cron.add, cron.list, cron.remove are native agent tools.
- Task execution: Scheduled agent sessions have access to Bash, file tools, and other agent capabilities to execute commands.
- Channel delivery: OpenClaw holds channel credentials in
openclaw.json. No API keys needed in this skill.
- Timezone: Uses the system timezone from the host OS.
Security & Privilege
This skill creates cron jobs with payload.kind: "agentTurn" which wake an isolated agent session to execute tasks. The following controls are enforced:
sessionTarget: "isolated" — every scheduled task runs in a sandboxed session. It cannot access the main session's state, history, or tools beyond what's available to a fresh agent session.
deleteAfterRun: true — one-shot tasks self-delete after execution, preventing stale job accumulation.
- Destructive command gate — the skill requires explicit user confirmation before scheduling commands that modify or delete data (rm, drop, kill, etc.).
- Scoped naming — all jobs are prefixed with
Task: or Recurring Task:, making them auditable via cron.list and distinguishable from other skills' jobs.
- No
always: true — this skill is not always-on. It only activates when the user invokes /schedule.
- User-controlled — every job returns a
jobId that the user can inspect (/schedule list) or cancel (/schedule cancel <jobId>) at any time.
- No escalation — scheduled agent sessions inherit the same permissions and tool access as any normal agent session. They cannot grant themselves elevated privileges.
Troubleshooting
- Task didn't run? →
cron.list to check. Verify gateway was running at the scheduled time.
- Command failed? → Check delivery output for error details. The agent reports execution results.
- Silent task — how to check? → Use
cron.list to see lastStatus and lastError fields.
- Too many old jobs? → See
references/TEMPLATES.md for the cleanup job.
References
See references/TEMPLATES.md for copy-paste templates and cleanup setup.
1---2name: scheduler-23description: "Schedule tasks and commands to run at specific times. Execute shell commands, agent tasks, API calls, and automations on a cron schedule. Tested on Telegram & Discord."4tags: [cron, scheduler, automation, tasks, commands, telegram, discord]5metadata:6 source: https://skillmd.com/skills/modbender/scheduler-27 openclaw:8 summary: "**Scheduler:** Run commands and tasks on a schedule — shell scripts, agent tasks, API calls, file ops. Natural language, native cron, zero dependencies."9 emoji: "calendar"10user-invocable: true11command-dispatch: prompt12---1314# Scheduler1516Execute tasks and commands on a schedule using natural language. Run shell commands, agent tasks, API health checks, file operations, and automations — one-shot or recurring.1718## Usage1920```21/schedule run npm test in 5 minutes22/schedule git pull origin main tomorrow at 6am23/schedule generate weekly sales report every monday at 9am24/schedule check https://api.example.com/health every 30m25/schedule clean /tmp files every day at 3am silently26/schedule back up database every sunday at 2am27/schedule restart server in 10 minutes silently28/schedule list29/schedule cancel <jobId>30```3132## Agent Instructions3334When the user triggers `/schedule`, determine the intent:3536- **list** → call `cron.list` and show active scheduled tasks.37- **cancel / delete / remove `<jobId>`** → call `cron.remove` with that jobId.38- **everything else** → create a new scheduled task (steps below).3940---4142### Step 1: Parse the Input4344Extract four things: **WHAT** (the task to execute), **WHEN** (the time), **RECURRENCE** (one-shot or recurring), **DELIVERY** (announce results or run silently).4546#### Identify the Task (WHAT)4748Classify the user's request into a task type:4950| Task Type | Trigger Words | Agent Action |51|---|---|---|52| Shell command | `run`, `execute`, `do`, command-like syntax (`npm`, `git`, `docker`, `curl`, `python`) | Execute the command using Bash tool |53| Agent task | `generate`, `summarize`, `analyze`, `write`, `create`, `compile`, `review` | Perform the task using available agent tools |54| API/health check | `check`, `ping`, `hit`, `call`, URL patterns (`https://...`) | Fetch the URL and report status |55| File operation | `clean`, `back up`, `copy`, `move`, `archive`, `compress` | Perform file operations using available tools |56| Custom prompt | anything else | Execute as a free-form agent prompt |5758The WHAT becomes the `payload.message` — a clear instruction for the agent that wakes up to execute it.5960#### Identify the Time (WHEN)6162Use the same time-parsing pipeline as the remindme skill:6364**Layer 1: Pattern Matching**6566Scan for these patterns (first match wins):6768**Relative durations** — `in <number> <unit>`:69| Pattern | Duration |70|---|---|71| `in Ns`, `in N seconds` | N seconds |72| `in Nm`, `in N min`, `in N minutes` | N minutes |73| `in Nh`, `in N hours` | N hours |74| `in Nd`, `in N days` | N * 24 hours |75| `in Nw`, `in N weeks` | N * 7 days |7677**Absolute clock times** — `at <time>`:78| Pattern | Meaning |79|---|---|80| `at HH:MM`, `at H:MMam/pm` | Today at that time (or tomorrow if past) |81| `at Ham/pm`, `at HH` | Today at that hour |8283**Named days**:84| Pattern | Meaning |85|---|---|86| `tomorrow` | Next calendar day, default 9am |87| `tonight` | Today at 8pm |88| `next monday..sunday` | Coming occurrence, default 9am |8990**Recurring** — `every <pattern>`:91| Pattern | Schedule |92|---|---|93| `every Nm/Nh/Nd` | `kind: "every"`, `everyMs: N * unit_ms` |94| `every day at <time>` | `kind: "cron"`, `expr: "M H * * *"` |95| `every <weekday> at <time>` | `kind: "cron"`, `expr: "M H * * DOW"` |96| `every weekday at <time>` | `kind: "cron"`, `expr: "M H * * 1-5"` |97| `every weekend at <time>` | `kind: "cron"`, `expr: "M H * * 0,6"` |98| `every hour` | `kind: "every"`, `everyMs: 3600000` |99100**Unit conversion table**:101| Unit | Milliseconds |102|---|---|103| 1 second | 1000 |104| 1 minute | 60000 |105| 1 hour | 3600000 |106| 1 day | 86400000 |107| 1 week | 604800000 |108109**Layer 2: Slang & Shorthand**110111| Phrase | Resolves to |112|---|---|113| `in a bit`, `shortly` | 30 minutes |114| `in a while` | 1 hour |115| `later`, `later today` | 3 hours |116| `end of day`, `eod` | Today 5pm |117| `end of week`, `eow` | Friday 5pm |118| `morning` | 9am |119| `afternoon` | 2pm |120| `evening` | 6pm |121| `midnight` | 12am next day |122| `noon` | 12pm |123124**Layer 3: Ambiguity — Ask, Don't Guess**125126If you can't determine WHEN, ask the user. Never silently pick a default time.127128#### Identify Delivery Mode (DELIVERY)129130| User says | Delivery mode |131|---|---|132| `silently`, `quietly`, `in background`, `no output` | `"none"` — runs without reporting back |133| Nothing specified, or `report`, `show results`, `announce` | `"announce"` — sends task output to channel |134135### Step 2: Compute the Schedule136137**Timezone rule:** ALWAYS use the user's **local timezone** (system timezone). Never default to UTC.138139**One-shot** → ISO 8601 timestamp with the user's local timezone offset.140- If the computed time is in the PAST, bump to the next occurrence.141142**Recurring (cron)** → 5-field cron expression with `tz` set to the user's IANA timezone.143144**Recurring (interval)** → `kind: "every"` with `everyMs` in milliseconds.145146### Step 3: Security Check147148Before scheduling, check if the task involves destructive operations:149150**Destructive patterns** (require explicit user confirmation):151- File deletion: `rm`, `del`, `remove`, `wipe`, `clean` (unless cleaning temp/cache)152- Database: `drop`, `truncate`, `delete from`, `destroy`153- Git: `reset --hard`, `push --force`, `branch -D`154- System: `kill`, `shutdown`, `reboot`, `format`155- Network: `iptables`, `firewall`, `ufw`156157If a destructive pattern is detected:1581. Warn the user: "This task involves a destructive operation (`<command>`). Are you sure you want to schedule this?"1592. Only proceed after explicit confirmation.1603. Include `[CONFIRMED DESTRUCTIVE]` in the job name for audit trail.161162**Safe patterns** (no confirmation needed):163- Read-only: `ls`, `cat`, `git status`, `git log`, `curl GET`, `ping`164- Build/test: `npm test`, `npm build`, `make`, `cargo test`165- Reports: `generate`, `summarize`, `analyze`, `compile report`166167### Step 4: Detect the Delivery Channel168169Same priority order as remindme:1701711. **Explicit override** — user says "on telegram" / "on discord" etc.1722. **Current channel** — if messaging from an external channel, deliver there.1733. **Preferred channel** — from MEMORY.md.1744. **Last external channel** — `channel: "last"`.1755. **No channel + delivery mode "none"** — OK, task runs silently.1766. **No channel + delivery mode "announce"** — ask: "Where should I send the task results?"177178### Step 5: Call `cron.add`179180**One-shot task:**181182```json183{184 "name": "Task: <short description>",185 "schedule": {186 "kind": "at",187 "at": "<ISO 8601 timestamp>"188 },189 "sessionTarget": "isolated",190 "wakeMode": "now",191 "payload": {192 "kind": "agentTurn",193 "message": "SCHEDULED TASK: <detailed task instruction>. Execute this task now and report the results."194 },195 "delivery": {196 "mode": "announce",197 "channel": "<detected channel>",198 "to": "<detected target>",199 "bestEffort": true200 },201 "deleteAfterRun": true202}203```204205**Recurring task (cron):**206207```json208{209 "name": "Recurring Task: <short description>",210 "schedule": {211 "kind": "cron",212 "expr": "<cron expression>",213 "tz": "<IANA timezone>"214 },215 "sessionTarget": "isolated",216 "wakeMode": "now",217 "payload": {218 "kind": "agentTurn",219 "message": "RECURRING TASK: <detailed task instruction>. Execute this task now and report the results."220 },221 "delivery": {222 "mode": "announce",223 "channel": "<detected channel>",224 "to": "<detected target>",225 "bestEffort": true226 }227}228```229230**Recurring task (interval):**231232```json233{234 "name": "Recurring Task: <short description>",235 "schedule": {236 "kind": "every",237 "everyMs": "<interval in milliseconds>"238 },239 "sessionTarget": "isolated",240 "wakeMode": "now",241 "payload": {242 "kind": "agentTurn",243 "message": "RECURRING TASK: <detailed task instruction>. Execute this task now and report the results."244 },245 "delivery": {246 "mode": "<announce or none>",247 "channel": "<detected channel>",248 "to": "<detected target>",249 "bestEffort": true250 }251}252```253254**Silent task (no delivery):**255256```json257{258 "name": "Task: <short description>",259 "schedule": {260 "kind": "at",261 "at": "<ISO 8601 timestamp>"262 },263 "sessionTarget": "isolated",264 "wakeMode": "now",265 "payload": {266 "kind": "agentTurn",267 "message": "SCHEDULED TASK (SILENT): <detailed task instruction>. Execute this task now. No delivery needed — log results only."268 },269 "deleteAfterRun": true270}271```272273### Step 6: Confirm to User274275After `cron.add` succeeds, reply with:276277```278Task scheduled!279Command: <task description>280Runs: <friendly time description> (<ISO timestamp or cron expression>)281Delivery: <channel or "silent">282Job ID: <jobId> (use "/schedule cancel <jobId>" to remove)283```284285---286287## Rules2882891. **ALWAYS use `deleteAfterRun: true`** for one-shot tasks. Omit for recurring.2902. **ALWAYS use `sessionTarget: "isolated"`** — tasks run in their own sandboxed session.2913. **ALWAYS use `wakeMode: "now"`** — ensures execution at the scheduled time.2924. **ALWAYS use `delivery.bestEffort: true`** when delivery mode is "announce".2935. **NEVER use `act:wait` or loops** for delays. Cron handles timing.2946. **Always use the user's local timezone.** Never default to UTC.2957. **For recurring tasks**, do NOT set `deleteAfterRun`.2968. **Always return the jobId** so the user can cancel or audit later.2979. **Confirm destructive operations** before scheduling. Never silently schedule `rm`, `drop`, `kill`, etc.29810. **Prefix job names** with `Task:` (one-shot) or `Recurring Task:` (recurring) for audit trail and scoped cleanup.299300## Platform Requirements301302This skill has zero bundled dependencies because it relies on OpenClaw's built-in capabilities:303304- **Cron scheduling**: `cron.add`, `cron.list`, `cron.remove` are native agent tools.305- **Task execution**: Scheduled agent sessions have access to Bash, file tools, and other agent capabilities to execute commands.306- **Channel delivery**: OpenClaw holds channel credentials in `openclaw.json`. No API keys needed in this skill.307- **Timezone**: Uses the system timezone from the host OS.308309## Security & Privilege310311This skill creates cron jobs with `payload.kind: "agentTurn"` which wake an isolated agent session to execute tasks. The following controls are enforced:312313- **`sessionTarget: "isolated"`** — every scheduled task runs in a sandboxed session. It cannot access the main session's state, history, or tools beyond what's available to a fresh agent session.314- **`deleteAfterRun: true`** — one-shot tasks self-delete after execution, preventing stale job accumulation.315- **Destructive command gate** — the skill requires explicit user confirmation before scheduling commands that modify or delete data (rm, drop, kill, etc.).316- **Scoped naming** — all jobs are prefixed with `Task:` or `Recurring Task:`, making them auditable via `cron.list` and distinguishable from other skills' jobs.317- **No `always: true`** — this skill is not always-on. It only activates when the user invokes `/schedule`.318- **User-controlled** — every job returns a `jobId` that the user can inspect (`/schedule list`) or cancel (`/schedule cancel <jobId>`) at any time.319- **No escalation** — scheduled agent sessions inherit the same permissions and tool access as any normal agent session. They cannot grant themselves elevated privileges.320321## Troubleshooting322323- **Task didn't run?** → `cron.list` to check. Verify gateway was running at the scheduled time.324- **Command failed?** → Check delivery output for error details. The agent reports execution results.325- **Silent task — how to check?** → Use `cron.list` to see `lastStatus` and `lastError` fields.326- **Too many old jobs?** → See `references/TEMPLATES.md` for the cleanup job.327328## References329330See `references/TEMPLATES.md` for copy-paste templates and cleanup setup.