Files
pipelines/docs/schedules.md
T
alan f061675fc1 Claude stages survive server restarts; non-repo folders don't falsely overlap; busy scheduled runs wait
- Claude stage CLIs now run in their own session (setsid) with the prompt from
  a file and stream-json written straight to cli-<n>.out in the evidence
  directory; owner.json records pid/pgid, session, invocation and output. A
  server shutdown leaves the CLI running and owned (ErrDetached). Start-up
  recovery re-adopts it (stage.ClaudeStageReattachable): the next process
  re-reads the output, follows the live CLI until it exits, or reads the
  result it left while the server was down; one that ended without a result
  marks the run interrupted with a clear reason. The outcome repair follow-up
  is re-adopted too (or asked again if its CLI died without a reply).
- Workspace overlap: two folders outside any repository overlap only when
  they are the same folder or the inner one lies within the outer run's
  declared write paths; nested-repository rules are unchanged.
- Scheduled admissions refused for a busy workspace are recorded as
  "delayed" and retried every 5 min for up to 2 h (env-configurable), then
  started or skipped with the reason; the operator gets a low-priority app
  notice (and ntfy when enabled) when a scheduled run is delayed or skipped.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-03 12:55:12 +00:00

5.4 KiB

Saved run schedules

A schedule pairs a pipeline and pinned version with its own run information and timer. It is not part of the workflow's Markdown.

For example, one Research pipeline can have a battery-news prompt every Monday, an AI-news prompt every morning, and a comparison report every Friday—without copying or editing the workflow. Each entry has an independent name, prompt, workspace, timing, enabled state and revision.

In the web app

  1. Open a pipeline and choose Schedules → Add schedule.
  2. Enter its name, prompt and existing server workspace. The browser's files are not uploaded; this path is on the execution server.
  3. Choose an interval (at least one minute) or 24-hour clock times, weekdays and timezone. The editor prefills your browser's timezone; review it before saving. Blank or Local uses the server's timezone.
  4. Review whether it is Enabled, then save. Enabled entries start future runs automatically, including provider usage and the workflow's permitted tools.

Schedule this run copies an existing run's original input and options—not its output—into an editable schedule. Run-level write_paths restrictions are kept; they never enable tools or widen workflow permissions. Advanced options include extra typed inputs, model/stage overrides, notifications, title and output format. Generated run titles are not silently locked in as explicit future titles.

Pause or delete affects future occurrences only. It does not cancel already admitted work, delete run history or rewrite the pipeline. Publishing a new workflow version also does not change an existing schedule's pinned version. Edit that schedule explicitly when you want it to use a newer version.

Filters and provenance

  • Pipelines → Filter → Scheduling → Has schedules selects pipelines with configured, nondeleted schedules, including paused ones. No schedules is the opposite. The row shows the configured schedule count.
  • Runs → Filter → Trigger → Scheduled runs selects executions actually started by a timer. Manually running that same pipeline is Not scheduled. The trigger/name remains recorded after a schedule is paused, edited or deleted.
  • Records from older peers that omit scheduling metadata remain unclassified; the browser never guesses from workflow Markdown or a current pipeline's schedule state.

Each dispatch is claimed once. Missed occurrences after downtime are skipped, not replayed. A scheduled run whose workspace another run holds is delayed, never run concurrently: it is recorded as delayed in the schedule's history and tried again every 5 minutes for up to 2 hours (set PIPELINES_SCHEDULE_BUSY_RETRY_EVERY / PIPELINES_SCHEDULE_BUSY_RETRY_FOR on the server, as Go durations; 0 for FOR skips at once), then recorded as started or skipped with the reason. The operator gets a low-priority notification when a scheduled run is delayed or skipped. Use separate workspaces for truly independent concurrent execution. Refresh in Schedules reloads its latest configuration and next due times.

JSON API / CLI automation

All commands are available through the existing pipelines rpc - interface. These are real mutations, not dry runs; replace IDs and server paths first.

pipelines rpc - <<'JSON'
{
  "type": "save_schedule",
  "request_key": "schedule-battery-topic-creation-1",
  "schedule": {
    "name": "Battery research",
    "pipeline_id": 7,
    "version": 3,
    "enabled": false,
    "input": {"prompt": "Research battery recycling developments"},
    "workspace": "/srv/research",
    "notify_mode": "auto",
    "rule": {"days": ["mon"], "times": ["09:00"], "timezone": "UTC"}
  }
}
JSON

The example is paused. Set enabled: true only when those future executions are intended. Use {"every":"24h"} instead of times for elapsed intervals; do not set both. Omit days for everyday (sun through sat are accepted values). Clock rules handle DST: nonexistent spring-forward times are skipped and repeated fall-back wall times fire once.

list_schedules accepts optional pipeline_id and returns schedules. Edits use save_schedule with the full returned record and its current positive id and revision; a stale revision is refused. delete_schedule takes schedule_id and expected_revision. Reload and reconcile conflicts rather than overwriting somebody else's changes.

Use a unique request_key for each intentional creation. Reuse it only when retrying that exact creation after a lost reply: the same payload returns the same record, a different payload conflicts, and deleted records are not resurrected. Run dispatch has separate occurrence IDs and atomic provenance.

Existing embedded schedules

New validate/submit requests reject # settings scheduling blocks with guidance to save a separate schedule. Published historical versions remain readable and unchanged. Upgrade imports the latest legacy slots into independent records, preserves cadence/next-due state and old events, and backfills run provenance only from actual recorded timer events. Legacy workspace defaults bind at execution server startup, not from an arbitrary offline database reader's directory.

Paused/deleted entries do not reappear on restart. Existing workflow source, versions and completed work are not rewritten or replayed. Keep a database backup when upgrading; older binaries do not implement this external scheduling model.