Agent SwarmAgent Swarm
Concepts

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

PropertyDescription
nameUnique name for the schedule
taskTemplateTask description created each time
scheduleTyperecurring (default) or one_time
cronExpressionCron expression for recurring schedules (e.g., 0 9 * * *)
intervalMsInterval in milliseconds for recurring schedules
delayMsDelay in milliseconds for one-time schedules
runAtISO datetime for one-time schedules (e.g., 2026-03-15T09:00:00Z)
timezoneTimezone for cron schedules (default: UTC)
targetAgentIdAgent to assign tasks to (omit for task pool)
priorityTask priority 0-100 (default: 50)
tagsTags applied to created tasks
taskTypeType classification for created tasks
modelModel for created tasks: haiku, sonnet, or opus (falls back to global config)
enabledWhether 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

ExpressionDescription
0 9 * * *Every day at 9:00 AM
0 9 * * 1-5Weekdays at 9:00 AM
*/30 * * * *Every 30 minutes
0 0 * * 0Every 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:

  1. A new task is created with the schedule's taskTemplate
  2. The task is linked back to its schedule via a scheduleId field (use the scheduleId filter in get-tasks to find all tasks from a schedule)
  3. If targetAgentId is set, the task is assigned to that agent; otherwise it goes into the unassigned pool
  4. If model is set, the task inherits that model setting
  5. The schedule's lastRunAt is updated
  6. One-time schedules are automatically disabled after execution

Only the schedule creator or the lead agent can update or delete schedules.

On this page