Zeno proactive-trigger scheduler: one-shot, heartbeat, and cron triggers.
Project description
zeno-scheduler
Proactive-trigger scheduler for Zeno.
Fires agent turns autonomously — the assistant doesn't have to wait for
the user to send a message. Supports one-shot reminders, periodic
heartbeats, and cron-style recurring schedules. Triggers are persisted
to SQLite so they survive process restarts. Built-in @tools let the
agent itself schedule and cancel its own reminders.
Install
uv add 'zeno-framework[scheduler]'
# or, without the AI package:
uv add zeno-scheduler
Features
- One-shot triggers (
schedule_once) — fire at a specific datetime or after atimedelta - Heartbeat triggers (
schedule_heartbeat) — fire every N seconds - Cron triggers (
schedule_cron) — standard 5-field cron expression with timezone support - Built-in tools so the agent can self-schedule from natural-language
reminders:
schedule_once,schedule_heartbeat,schedule_cron,list_triggers,cancel_trigger,cancel_trigger_by_name (user_id, name)upsert semantics — re-running a seed call with the same name updates the existing row instead of duplicating it- Missed-fire policies (
OnMissed.SKIP/RUN_ONCE/RUN_ALL) for triggers that lapse while the process was down
Minimal usage
import asyncio
from datetime import timedelta
from pathlib import Path
from zeno.agent import Agent
from zeno.app import ZenoApp
from zeno.channels.cli import CliChannel
from zeno.scheduler import Scheduler, SqliteScheduleStore
from zeno.scheduler.tools import schedule_once, list_triggers, cancel_trigger
from zeno.testing import FakeProvider
async def main() -> None:
store = SqliteScheduleStore(Path("./scheduler.db"))
scheduler = Scheduler(store)
# Pre-seed a one-shot reminder. The agent could also call this via
# the `schedule_once` tool at runtime (which accepts string deltas
# like "30m" — handy when the model produces them).
await scheduler.schedule_once(
user_id="local",
thread_key=None,
channel="cli",
prompt="Reminder: stand up and stretch.",
delta=timedelta(minutes=30),
name="stretch-reminder",
)
app = ZenoApp(
agent=Agent(
name="root",
instructions="You are a proactive assistant. Schedule reminders when asked.",
tools=[schedule_once, list_triggers, cancel_trigger],
),
channels=[CliChannel()],
provider=FakeProvider(),
scheduler=scheduler, # ← wires the scheduler into ZenoApp's lifecycle
)
await app.run()
asyncio.run(main())
ZenoApp starts and stops the scheduler alongside its other tasks.
When a trigger fires, the scheduler calls channel.inbound_put(...)
on the matching channel, which delivers the prompt as a synthetic
inbound message — the agent processes it through the same turn path
as a real user message.
Testing
uv run pytest packages/zeno-scheduler
Tests use an in-memory ScheduleStore and a virtual clock — no real
sleep or filesystem I/O.
Part of the Zeno framework. See
apps/zeno-example-scheduler
for a runnable end-to-end reference wiring.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file zeno_scheduler-1.0.0rc1.tar.gz.
File metadata
- Download URL: zeno_scheduler-1.0.0rc1.tar.gz
- Upload date:
- Size: 39.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
63c1cc39597ac8dc44a5b44cdc7af7e423eccdcbff13865e2775d12ce81cc875
|
|
| MD5 |
9c360a22ef24eb769ea250dcaed1834f
|
|
| BLAKE2b-256 |
e3a67d72dd98b8d967ece7d8692913516bcc139e75bebbb7415007a889a69487
|
Provenance
The following attestation bundles were made for zeno_scheduler-1.0.0rc1.tar.gz:
Publisher:
publish.yml on nkootstra/zeno
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
zeno_scheduler-1.0.0rc1.tar.gz -
Subject digest:
63c1cc39597ac8dc44a5b44cdc7af7e423eccdcbff13865e2775d12ce81cc875 - Sigstore transparency entry: 1383561025
- Sigstore integration time:
-
Permalink:
nkootstra/zeno@7369fbec32dfe63880e968970c2e8070e6091b4f -
Branch / Tag:
refs/heads/main - Owner: https://github.com/nkootstra
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@7369fbec32dfe63880e968970c2e8070e6091b4f -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file zeno_scheduler-1.0.0rc1-py3-none-any.whl.
File metadata
- Download URL: zeno_scheduler-1.0.0rc1-py3-none-any.whl
- Upload date:
- Size: 28.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
157874b158d53a9c1aafdafdedda8ee3dc943f05c7aee945593568f5c62258ad
|
|
| MD5 |
868f71c755098a37b2444e5d2b71ed7c
|
|
| BLAKE2b-256 |
8e727ac07ea793ea119ff62e1c1722a009e487a68f2d405c7bf32c87f10c94d0
|
Provenance
The following attestation bundles were made for zeno_scheduler-1.0.0rc1-py3-none-any.whl:
Publisher:
publish.yml on nkootstra/zeno
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
zeno_scheduler-1.0.0rc1-py3-none-any.whl -
Subject digest:
157874b158d53a9c1aafdafdedda8ee3dc943f05c7aee945593568f5c62258ad - Sigstore transparency entry: 1383561068
- Sigstore integration time:
-
Permalink:
nkootstra/zeno@7369fbec32dfe63880e968970c2e8070e6091b4f -
Branch / Tag:
refs/heads/main - Owner: https://github.com/nkootstra
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@7369fbec32dfe63880e968970c2e8070e6091b4f -
Trigger Event:
workflow_dispatch
-
Statement type: