All docs

Scheduled tasks

- English name: scheduled_tasks (implementation package suggested schedule)

Source docs/en/site/mech-cron.md

  • English name: scheduled_tasks (implementation package suggested schedule)
  • 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

CapabilityDifference
TasksNo schedule; conversation excerpts TASKS.md
Service noticesOnly 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 forgeAdmins analyze conversations offline; do not write user Cron
OpenClaw HeartbeatRoughly 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)

  1. On agent detail → Schedule, create/edit/pause/delete tasks.
  2. Type: reminder only / auto-run (at the time the agent replies by the instruction).
  3. Time: once at a given moment; or every day / every week / custom repeat.
  4. When due: reminder only receives a service notice; auto-run appears in Messages as a new scheduled conversation (open it for the full reply).
  5. View recent run records and failure reasons.

OpenClaw mapping (implementation reference)

OpenClawCadau
atschedule_kind=at
everyschedule_kind=every
cron + --tzschedule_kind=cron + timezone
session isolatedEach task has a fixed conversation; each run is an independent transcript or cron:{task_id}
--announceReminder → service notice; auto-run → conversation unread (optional mobile push later)
cron runsagent_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 in db.Open).
  • Scheduler: in-process ticker (SCHEDULE_ENABLED, on by default; SCHEDULE_TICK_INTERVAL default 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 default allow_tools=false; Web “auto-run” create defaults to allowing tools, so data lookup / file write work).
  • Repeat: at (once / relative such as 5m), 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 need confirm=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