schedule_dispatch
Dispatch a prompt repeatedly on a channel at fixed intervals, with automatic stop via sentinel or deadline. Persists across restarts and supports chaining.
Instructions
Recurring dispatch: fire prompt on channel every
interval_seconds, until a deadline or until the prompt emits
the literal stop sentinel [BRIDGE_STOP_SCHEDULE] in its result.
Each tick is an independent dispatch_async job — ticks are
short individually, but the schedule can run for hours. The bridge
owns the loop, persists schedules to disk, and resumes them after
a restart (without burst-firing missed ticks).
Args:
prompt: The text fired at each tick.
channel: Channel for every tick. Same-session continuity
across ticks (each tick --resumes the prior).
interval_seconds: Seconds between ticks. Minimum 10.
until: Absolute end time, ISO 8601. Prefer including a timezone
(e.g. "2026-04-27T20:00:00Z"); naive datetimes without
a timezone are interpreted as UTC, not local time, so
the same string yields the same instant regardless of which
container the bridge runs in. Mutually exclusive with
until_seconds.
until_seconds: Relative end time in seconds from now (e.g.
14400 = 4 hours).
timeout_seconds: Per-tick timeout. Default 300.
permission_mode: Same as dispatch.
cwd: Same as dispatch.
after_schedule_id: Chain this schedule to start only after the
named predecessor terminates (completed, cancelled, or
error). Useful for pipelines: "after wave A merges, run
hygiene check wave B." This schedule starts in waiting
status and transitions to active automatically. Cycles
are detected and rejected.
notify_url: HTTPS endpoint to POST event payloads to. Optional.
Bridge fires fire-and-log POSTs; the destination is the
user's relay (Slack/Pushover/email/etc.) — bridge does not
retry.
notify_on: List of event names to push. Values:
tick (every tick fired — chatty),
tick_with_sentinel (the tick that triggered self-cancel),
tick_error (a tick failed to spawn),
schedule_end (any terminal transition: completed,
cancelled, error). Default ["schedule_end"].
notify_headers: Extra request headers (e.g. auth). Sent on
every webhook POST.
Returns:
{ok: true, schedule_id, schedule} or {ok: false, error}.
Self-cancellation: if any tick's result text contains
[BRIDGE_STOP_SCHEDULE], the schedule cancels after that tick.
Use this in your prompt for "watch X until Y" patterns:
"Check open PRs. If all merged, end your reply with
[BRIDGE_STOP_SCHEDULE]. Otherwise summarize."Webhook payload shape (result_preview truncated to 4KB)::
{"event": "schedule_end", "schedule_id": "...",
"channel": "...", "tick_count": 17, "status": "cancelled",
"last_tick_at": ..., "last_tick_result": "...",
"last_job_id": "...", "error": null}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| prompt | Yes | ||
| channel | Yes | ||
| interval_seconds | Yes | ||
| until | No | ||
| until_seconds | No | ||
| timeout_seconds | No | ||
| permission_mode | No | ||
| cwd | No | ||
| after_schedule_id | No | ||
| notify_url | No | ||
| notify_on | No | ||
| notify_headers | No |