Skip to main content

Cron

Cron is Anyy's resident scheduler. It stores scheduled jobs in the active home state database and runs them through the gateway runtime.

Use cron for recurring or delayed work: daily summaries, reminders, scheduled skill runs, periodic checks, or scripted maintenance. Use tasks for passive to-do items.

What Cron Can Do

Anyy supports these cron job kinds:

KindMeaning
agentStarts an agent turn at the scheduled time.
skillRuns scheduled skill-oriented work.
notifySends notification-style scheduled work.
scriptCLI-created script job under the scripts directory.
reminderModel-facing kind that stores as notify with source reminder.

The model-visible automation tools expose agent, skill, notify, and reminder. Script jobs are created from the CLI path, not from model automation tools.

Create Scheduled Jobs

From chat

Ask Anyy naturally:

Remind me in 30 minutes to check the build.
Every day at 9, summarize today's priority tasks.

For model-created jobs, the automation tool uses a canonical schedule object. The assistant should not use legacy fields such as when, every, cron, or recurring at the top level.

Examples of the canonical shape:

{
"kind": "reminder",
"schedule": {"type": "once", "at": "30m"},
"message": "Check the build."
}
{
"kind": "agent",
"name": "Daily task summary",
"schedule": {"type": "every", "mode": "advanced_cron", "cron": "0 9 * * *"},
"prompt": "Summarize today's priority tasks and notify me."
}

From CLI

Use anyy cron when you want an explicit command:

anyy cron create --name "Daily summary" --schedule "0 9 * * *" --prompt "Summarize today's priorities"
anyy cron list
anyy cron update --id cron_123 --disable
anyy cron delete --id cron_123

The CLI also supports --kind, --script, --skills, --toolsets, --workdir, --role, --workspace, --delivery-target, and --delivery-channel.

For exact syntax, see CLI Commands.

From Dashboard

The dashboard's Cron page can list jobs, create jobs, inspect run history, edit schedule and prompt, pause or resume a job, and delete a job. The dashboard uses the same resident gateway RPCs as the CLI.

Schedule Formats

The scheduler accepts three schedule families.

One-time

One-shot jobs accept a positive duration or an RFC3339 timestamp:

30m
2h
1d
2026-06-16T09:00:00Z

For model automation tools, use:

{"type": "once", "at": "30m"}

Intervals

Recurring intervals use every <duration> in storage and CLI:

every 30m
every 2h
every 1d

For model automation tools, use:

{"type": "every", "mode": "interval", "interval": "30m"}

Advanced Cron

The current parser supports five-field expressions where day, month, and weekday are *, and minute/hour are either * or a number:

0 9 * * *
30 * * * *
* 14 * * *

For model automation tools, use:

{"type": "every", "mode": "advanced_cron", "cron": "0 9 * * *"}

Calendar-style recurrence is not supported yet. If schedule.mode is calendar, the automation tool rejects it.

Advanced cron schedules require a reliable IANA timezone. If Anyy cannot resolve a reliable timezone, it rejects advanced cron creation instead of silently guessing.

Delivery

Cron jobs can deliver through the gateway, the originating channel, or the current user's default channel binding. CLI-created jobs can also use none for jobs that should not send a user notification.

Model-created automation does not accept delivery target none; it is reserved for internal scheduler jobs.

Use:

anyy cron create \
--name "Weixin digest" \
--schedule "0 9 * * *" \
--prompt "Send my morning digest" \
--delivery-target current_user_default \
--delivery-channel weixin

Delivery errors are reported through cron run status, job metadata, and outbox records. If a cron job records a new failure signature, heartbeat can publish a failure notification.

Role And Workspace Scope

Cron jobs are scoped by role and workspace. CLI commands default to profile-wide listing unless you pass --role, --workspace, or --all-scopes.

New CLI-created jobs use the selected default role when no --role is provided. Jobs created from a session inherit the session's runtime scope.

Lifecycle Operations

Use:

anyy cron list --include-disabled
anyy cron update --id cron_123 --enable
anyy cron update --id cron_123 --schedule "every 1h"
anyy cron delete --id cron_123

From model tools, the lifecycle tools are:

ToolPurpose
automation_listList visible scheduled automations and reminders.
automation_createCreate a scheduled automation or reminder.
automation_updateEnable, disable, reschedule, or change prompt.
automation_deleteDelete a scheduled automation.
automation_runQueue a job to run as soon as the scheduler can claim it.
automation_historyList recent run history and outputs.

Automation tools show only model-visible job kinds. Script jobs are intentionally not exposed through those tools.

History

Cron run records track status: running, succeeded, failed, cancelled, skipped, and waiting_approval. Outputs are stored as stdout, stderr, or tool output records.

Use automation_history from a conversation, or inspect state through the local runtime surfaces that call cron history RPCs.

Runtime Loop

The resident gateway starts the scheduler loop. Its default tick interval is one minute. Config can override it:

cron:
tick_interval: 30s

The compatibility field tick_interval_seconds is also accepted.

The gateway must be running for scheduled work to run. Use anyy status, anyy doctor, and anyy heartbeat status when scheduled work is not firing as expected.