Scheduled tasks
- English name: scheduled_tasks (implementation package suggested schedule)
Source docs/en/site/mech-cron.md
- English name:
scheduled_tasks(implementation package suggestedschedule) - Chinese name: 定时任务
- Aligned with: OpenClaw Scheduled tasks (Gateway built-in Cron; Cadau is in-house, does not call OpenClaw)
Users set “remind me at this time” or “run one round at this time” for their own agent: reminders only reach them via service notices; auto-run writes into that scheduled conversation (unread for the agent) and does not send a separate service notice. Different from tasks (TASKS.md, static injection); unrelated to Memory Forge (admin knowledge feed).
Phased delivery: see ../记忆锻造与定时任务实施计划.md (ST track).
Goals
- Remind the user at the time (may not call the model).
- Auto-run one agent round at the time (preset instruction; result written into a conversation).
- Support once, fixed interval, and cron expressions (with timezone).
- Each run is auditable and reviewable (run history).
Neighboring capabilities
| Capability | Difference |
|---|---|
| Tasks | No schedule; conversation excerpts TASKS.md |
| Service notices | Only reminder types produce a notice at the time; auto-run types rely on unread scheduled conversations; what the user creates is still a Cron job |
| Memory forge | Admins analyze conversations offline; do not write user Cron |
| OpenClaw Heartbeat | Roughly periodic patrol of the main conversation; Cadau does not do this in phase 1; split from user Cron matches the OpenClaw docs |
User-visible capabilities (spec intent)
- On agent detail → Schedule, create/edit/pause/delete tasks.
- Type: reminder only / auto-run (at the time the agent replies by the instruction).
- Time: once at a given moment; or every day / every week / custom repeat.
- When due: reminder only receives a service notice; auto-run appears in Messages as a new scheduled conversation (open it for the full reply).
- View recent run records and failure reasons.
OpenClaw mapping (implementation reference)
| OpenClaw | Cadau |
|---|---|
at | schedule_kind=at |
every | schedule_kind=every |
cron + --tz | schedule_kind=cron + timezone |
session isolated | Each task has a fixed conversation; each run is an independent transcript or cron:{task_id} |
--announce | Reminder → service notice; auto-run → conversation unread (optional mobile push later) |
cron runs | agent_scheduled_task_runs |
cron run <id> | POST .../scheduled-tasks/{id}/run-now |
Governance (enterprise SaaS)
- Bound to user + workspace + agent; no cross-account reads.
- The built-in help assistant does not offer user Cron (avoid mixing with product onboarding).
- Auto-run does not open high-risk tools such as network/files by default; workspace policy may override.
- Quotas: active tasks per user, per-run
timeout_seconds, minimum repeat interval. - Audit:
user_agent.schedule.create|update|delete|run.
Shipped now
- Data model:
agent_scheduled_tasks,agent_scheduled_task_runs(SQLite migration indb.Open). - Scheduler: in-process ticker (
SCHEDULE_ENABLED, on by default;SCHEDULE_TICK_INTERVALdefault 30s). - API:
GET/POST/PATCH/DELETE /api/v1/user-agents/{id}/scheduled-tasks,POST .../run-now,GET .../runs. - Execution:
reminder→ service notice;agent_run→ internal chat orchestration and a new scheduled conversation (no service notice; API defaultallow_tools=false; Web “auto-run” create defaults to allowing tools, so data lookup / file write work). - Repeat:
at(once / relative such as5m),every(≥300s),cron+ IANA timezone. - Front end: agent detail → Schedule tab (
AgentScheduledPanel); feature menu Scheduled tasks. - Conversation tools (ST-5): work assistants may use
schedule_list/schedule_create/schedule_delete; create and delete needconfirm=true(preview then confirm). Due-time execution rounds do not inject these tools. - Memory Forge auto scan (admin side):
MEMORYFORGE_AUTO_SCAN_ENABLED+MEMORYFORGE_AUTO_SCAN_INTERVAL.
Related mechanisms
- 服务通知.md — delivery channel
- 智能体记忆.md — memory side effects after auto-run (optional gate)
- 记忆锻造/记忆锻造.md — do not confuse with Cron