# Schedules

Launch agents or mail an orchestrator on a timer, and what happens when a run is late or busy.

Komrad can spawn or message agents on a schedule, which suits periodic work such as summaries.

Schedules fire on a cron expression and hand their prompts to an agent. They keep firing after you close the panel, as long as the engine is running.

> This guide uses the `neovim` workflow from the [workflows](https://komrad.dev/latest/guides/workflows.md) guide.

There are two kinds of schedules: _task schedules_ start a new task each time, and _orchestrator schedules_ mail a running orchestrator.

## Task schedules

A task schedule starts a new [task](https://komrad.dev/latest/guides/tasks.md) in a workflow each time it fires, with a writer that gets the schedule’s prompt as its brief. The workflow supplies everything else about the launch when the schedule fires, such as the directory, the flags and the shared context.

Open the schedules from the switcher at the top of the panel, open the menu with [`space`](https://komrad.dev/latest/config.md#keybindings.menu.open) and press [`c`](https://komrad.dev/latest/config.md#keybindings.schedule_menu.new) to write one. Leave the kind on task, then give it a name, a cron expression, a prompt, and the `neovim` workflow. The name also names every agent it launches.

The video uses `* * * * *` so the schedule fires within a minute.

[Video: Creating a task schedule called news-digest that fires every minute in the neovim workflow, then opening the agent it launched as it summarizes Neovim's news file.](https://komrad.dev/media/schedules-implementer.mp4)

A task schedule never piles up work. If the writer from its last run is still working or waiting on you, the next run is skipped and recorded as skipped.

## Orchestrator schedules

An orchestrator schedule mails its prompt to an orchestrator that is already running. Use it when the work belongs to an agent that already knows the workflow, such as asking the orchestrator each morning to hand out the day’s work.

[Video: Creating an orchestrator schedule called standup that mails the neovim workflow's orchestrator every minute, then watching the orchestrator read the mail and answer it.](https://komrad.dev/media/schedules-orchestrator.mp4)

If the orchestrator is archived or deleted, the schedule’s runs are cancelled. Edit it to point at another orchestrator, or archive it.

## Missed and paused runs

Komrad never catches up on missed runs. If the server is down when a run was due, that run is skipped. This is deliberate, so agents do not start at odd hours.

Komrad cancels runs that cannot succeed and records the reason as the schedule’s last run. For instance, it cancels a task schedule whose workflow no longer exists.

You can pause a schedule and arm it again later. A paused schedule keeps its settings.
