scheduling

A scheduling system for running agent tasks later, at a chosen time, after a delay, or repeatedly on a timetable.

In plain words
What is it for?
It is for delayed jobs, one-time scheduled tasks, recurring cron schedules, and fixed-interval tasks.
Why use it?
It removes the need to keep an agent session open and remember recurring tasks, because scheduled work is stored and survives restarts.

Agent

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add agents/cloudflare/agents/scheduling
Clone the repo
git clone --depth 1 https://github.com/cloudflare/agents
Per session 0 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 7,858 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00000 $0.07858
Opus 5 $0.00000 $0.03929
Sonnet 5 $0.00000 $0.01572
Haiku 4.5 $0.00000 $0.00786

Measured yesterday against content hash 5157b83a0b3a, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

scheduling scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured yesterday.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

docs/agents/scheduling.md · 1,059 lines

How it starts

The opening of the file, as written. The whole thing — 1,059 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Scheduling

Schedule tasks to run in the future — whether that's seconds from now, at a specific date/time, or on a recurring cron schedule. Scheduled tasks survive agent restarts and are persisted to SQLite.

Overview

The scheduling system supports four modes:

Mode Syntax Use Case
Delayed this.schedule(60, ...) Run in 60 seconds
Scheduled this.schedule(new Date(...), ...) Run at specific time
Cron this.schedule("0 8 * * *", ...) Run on recurring schedule
Interval this.scheduleEvery(30, ...) Run every 30 seconds

Under the hood, scheduling uses Durable Object alarms to wake the agent at the right time. Tasks are stored in a SQLite table and executed in order.

Scheduler Lifecycle primitive

Experimental. The Scheduler primitive and the agents/lifecycle surface it builds on may change between releases. Agent's established scheduling methods (this.schedule() and friends) are stable.

Scheduler is a reusable Lifecycle capability. A plain Lifecycle Object can install it without extending Agent:

import { DurableObject } from "cloudflare:workers";
import { Lifecycle } from "agents/lifecycle";
import { Scheduler, type Schedule } from "agents/schedules";

export class ReminderObject extends DurableObject<Env> {
  readonly scheduler = new Scheduler({
    callbacks: {
      sendReminder: (
        payload: { message: string },
        schedule: Schedule<{ message: string }>
      ) => {
        console.log(schedule.id, payload.message);
      }
    }
  });

  readonly lifecycle = Lifecycle.install(this).use(this.scheduler);

  async createReminder(message: string): Promise<string> {
    const schedule = await this.scheduler.set(300, "sendReminder", {
      message
    });
    return schedule.id;
  }
}

Read the full file on GitHub · 1,059 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. yesterday First seen · 1,059 lines · 0 tokens per session scan A 5157b83a0b3a

Subscribe to this mod's changes

scheduling is an agent published in the GitHub repository cloudflare/agents (5,498 stars, last pushed 2d ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 7,858 tokens. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.