See also: Gateway Inbound Hooks — the inbound HTTP trigger counterpart to this outbound scheduled delivery surface.
Quick Start
1
YAML — simplest form
Create Start the gateway — the schedule loads at boot and fires through the shared tick + delivery loop:
gateway.yaml with a single schedules: entry:2
CLI — manage schedules from the terminal
3
Agent-centric — wire the agent in Python
The schedule references an agent by id; define that agent so the gateway can run it on each fire:
How It Works
The scheduler fires on the trigger, runs the agent, and routes the reply through the same channel-bot send path as inbound hooks.Choosing a Trigger — cron vs every vs at
Exactly one of cron / every / at must be set on each schedule.
Schedule Reference
Every field on aschedules: entry.
Zero triggers raises
schedule requires exactly one of 'cron', 'every' or 'at'; more than one raises schedule accepts only one of 'cron', 'every' or 'at'.
Delivery
deliver: reuses the same channel-bot send path as inbound hooks — omit it for a run-only job with no channel post.
Pre-run Gate
Setpre_run to a cheap shell/python command that runs before the model turn — if it outputs nothing to do, the run is skipped with no LLM call and no delivery.
Idempotency & Hot-Reload
Each schedule gets a stable idcfg-<sha1(gateway-schedule:{name})[:12]> derived from its YAML key, so re-loading the same config upserts instead of duplicating.
- Idempotent on stable id — the SHA1-prefixed id is deterministic from the YAML key; boots and hot-reloads never accumulate duplicates.
last_run_atis carried forward on upsert, so an interval or one-shot job is not re-fired after a restart or edit.- Removed schedules stop firing — a schedule deleted from the YAML is pruned on the next reload (only
cfg-prefixed jobs are ever pruned). - Chat-created jobs are untouched — jobs created in-chat via the agent-callable
scheduletool carry random ids and are never reconciled.
GatewayServer._load_declarative_schedules(config) runs right before the scheduler tick starts and again on every hot-reload, so additions, edits and removals all take effect without a process restart.
Failure Semantics
The gateway loads schedules best-effort so a single bad entry never blocks startup.- Malformed entries are skipped, not fatal — a single bad entry logs
Skipping invalid schedule 'x': ...and startup continues. A warning also surfaces at load time. - Refuses to clobber a broken config — CLI
add/removewill not overwrite agateway.yamlit could not read as a YAML mapping; the original file is preserved and the command exits1. - Exit codes — passing zero or more than one trigger flag, or a missing
--agent/--prompt, exits1.
CLI Reference
add
list
remove
Real User-Interaction Flow
At 8am Telegram chat${OWNER_CHAT_ID}gets a summary of the user’s calendar and unread priorities. The user can reply in the same chat — becausecontinuable: true— and thepersonalagent resumes the conversation.
Common Patterns
Daily brief to Telegram (cron)
Hourly health-check poll to Slack (every)
One-shot launch reminder (at)
Best Practices
Use a pre_run gate for expensive automations
Use a pre_run gate for expensive automations
A cheap
pre_run command that prints nothing to do skips the model turn entirely — no tokens spent and no delivery when there’s nothing new.Prefer every for jitter-tolerant polling, cron for wall-clock deliveries
Prefer every for jitter-tolerant polling, cron for wall-clock deliveries
Use
every when the exact minute doesn’t matter (health polls); use cron when the delivery must land at a specific wall-clock time (an 8am brief).Keep schedule names stable
Keep schedule names stable
The stable id derives from the YAML key — renaming a schedule creates a new job and drops the old one’s run-state.
Set continuable: false for one-way notifications
Set continuable: false for one-way notifications
A bare alert that shouldn’t open a conversation thread should set
continuable: false so a reply doesn’t resume an agent turn.Related
Gateway Inbound Hooks
The inbound HTTP trigger counterpart to this outbound scheduled surface.
Schedule CLI
The standalone
praisonai schedule CLI — store poller, tick, and job management.Proactive Delivery
Friendly aliases for scheduled delivery.
Gateway Overview
Gateway architecture and how channels, agents, and routing connect.
Scheduled Run Policy
RunPolicy for scheduled jobs.
Scheduler Multi-Tenant
Per-user isolation for scheduled jobs.

