Scheduled Tasks
Automate recurring and one-time tasks with cron-based and delayed scheduling
Scheduled Tasks
Agent Swarm supports both recurring and one-time schedules to automate task creation. Recurring schedules create tasks at specified intervals, while one-time schedules run once at a specific time or after a delay, then auto-disable.
Creating a Recurring Schedule
create-schedule(
name: "daily-standup",
taskTemplate: "Generate a daily standup report summarizing yesterday's completed tasks",
cronExpression: "0 9 * * *",
timezone: "America/New_York"
)Or use interval-based scheduling:
create-schedule(
name: "health-check",
taskTemplate: "Check all services are healthy and report any issues",
intervalMs: 3600000
)Creating a One-Time Schedule
One-time schedules run once and then auto-disable. Use delayMs for a relative delay or runAt for an absolute time:
create-schedule(
name: "deploy-reminder",
scheduleType: "one_time",
taskTemplate: "Remind the team about the deployment at 3 PM",
delayMs: 1800000
)create-schedule(
name: "scheduled-report",
scheduleType: "one_time",
taskTemplate: "Generate the quarterly report",
runAt: "2026-03-15T09:00:00Z"
)Schedule Properties
| Property | Description |
|---|---|
name | Unique name for the schedule |
taskTemplate | Task description created each time |
scheduleType | recurring (default) or one_time |
cronExpression | Cron expression for recurring schedules (e.g., 0 9 * * *) |
intervalMs | Interval in milliseconds for recurring schedules |
delayMs | Delay in milliseconds for one-time schedules |
runAt | ISO datetime for one-time schedules (e.g., 2026-03-15T09:00:00Z) |
timezone | Timezone for cron schedules (default: UTC) |
targetAgentId | Agent to assign tasks to (omit for task pool) |
priority | Task priority 0-100 (default: 50) |
tags | Tags applied to created tasks |
taskType | Type classification for created tasks |
model | Model for created tasks: haiku, sonnet, or opus (falls back to global config) |
enabled | Whether the schedule is active (default: true) |
Managing Schedules
List Schedules
list-schedules()
list-schedules(enabled: true)
list-schedules(name: "daily")
list-schedules(scheduleType: "one_time")By default, completed one-time schedules are hidden. Pass hideCompleted: false to include them.
Update a Schedule
update-schedule(name: "daily-standup", cronExpression: "0 10 * * *")
update-schedule(name: "daily-standup", enabled: false)Delete a Schedule
delete-schedule(name: "daily-standup")Run Immediately
Trigger a scheduled task now without waiting for the next interval:
run-schedule-now(name: "daily-standup")This creates a task immediately but does not affect the regular schedule timing.
Cron Expression Examples
| Expression | Description |
|---|---|
0 9 * * * | Every day at 9:00 AM |
0 9 * * 1-5 | Weekdays at 9:00 AM |
*/30 * * * * | Every 30 minutes |
0 0 * * 0 | Every Sunday at midnight |
0 9,17 * * * | At 9 AM and 5 PM daily |
How Scheduling Works
The MCP server runs a scheduler that polls for due schedules at a configurable interval (default: 10 seconds, set via SCHEDULER_INTERVAL_MS).
When a schedule is due:
- A new task is created with the schedule's
taskTemplate - The task is linked back to its schedule via a
scheduleIdfield (use thescheduleIdfilter inget-tasksto find all tasks from a schedule) - If
targetAgentIdis set, the task is assigned to that agent; otherwise it goes into the unassigned pool - If
modelis set, the task inherits that model setting - The schedule's
lastRunAtis updated - One-time schedules are automatically disabled after execution
Only the schedule creator or the lead agent can update or delete schedules.
Related
- Task Lifecycle — How scheduled tasks flow through the system after creation
- Environment Variables —
SCHEDULER_INTERVAL_MSand other configuration - MCP Tools Reference — Scheduling tools (create-schedule, list-schedules, etc.)