Skip to main content

kontiki-scheduler

Declarative cron scheduler for Kontiki deployments.

kontiki-scheduler replaces external crontab or systemd timers with a Kontiki-native service: schedules live in YAML, triggers go through the message bus, and operations stay aligned with the rest of the stack (configuration, logging, registry, supervision).

Role

At each cron tick, the scheduler publishes one event on the bus. Business services react with @on_event handlers. The scheduler does not run domain logic and does not track success or failure — that remains the responsibility of each consumer.

Use kontiki-scheduler for cross-service calendar triggers defined centrally in configuration.

Use @task inside a service for internal periodic work (housekeeping, polling, sub-minute intervals).

Configuration

Schedules are static and loaded at startup. Changing a schedule requires restarting the service.

kontiki:
  amqp:
    url: "amqp://guest:guest@localhost"

scheduler:
  schedules:
    - name: billing.daily_export
      cron: "0 2 * * *"
    - name: reports.weekly_cleanup
      cron: "0 3 * * 0"

Each entry has:

  • name — stable schedule identifier, shared with consuming services
  • cron — standard 5-field expression (minute hour day-of-month month day-of-week)

Timing

  • Granularity: minute
  • Timezone: UTC
  • Poll interval: 60 seconds (fixed)
  • Missed runs: skipped (next tick is computed from the current time, cron-style)
  • Deployment: one scheduler instance per environment (no multi-instance coordination)

Invalid cron expressions or duplicate schedule names cause startup to fail immediately.

Event contract

When a schedule fires, the scheduler publishes:

Field Value
Event type {name}.schedule_task.requested
Payload {}

Example: schedule billing.daily_export publishes billing.daily_export.schedule_task.requested with an empty object.

The name in configuration is the shared contract between scheduler and consumers. The event type is derived from it; consumers subscribe to the full event name in their handler.

Consumer example

from kontiki.messaging import on_event


class BillingService:
    @on_event("billing.daily_export.schedule_task.requested")
    async def run_daily_export(self, payload):
        ...

Quick start

make install          # install dependencies with poetry
make run-amqp         # start RabbitMQ from docker-compose.dev.yaml

make test             # run unit tests
make integration-test # start RabbitMQ (if needed) and run integration tests (behave)

Run the service:

kontiki-scheduler --config /path/to/config.yaml

Out of scope

  • Dynamic scheduling (schedule() / cancel() RPC)
  • One-shot or per-request delayed jobs
  • Execution tracking (succeeded / failed)
  • Sub-minute precision
  • Hot reload of schedules

License

Apache License 2.0 — see LICENSE.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

kontiki_scheduler-1.0.0.tar.gz (6.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

kontiki_scheduler-1.0.0-py3-none-any.whl (8.4 kB view details)

Uploaded Python 3

File details

Details for the file kontiki_scheduler-1.0.0.tar.gz.

File metadata

  • Download URL: kontiki_scheduler-1.0.0.tar.gz
  • Upload date:
  • Size: 6.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.3.2 CPython/3.13.7 Linux/6.8.0-137-generic

File hashes

Hashes for kontiki_scheduler-1.0.0.tar.gz
Algorithm Hash digest
SHA256 47bbf4bba6ad991d458e8dd93acbfe7c458873c24b202050a28b3c0d0921eb35
MD5 7fc1d7830285c8195962634092197344
BLAKE2b-256 9045a5c9d2cb2048518953d5215c792bc2e80109e6b607e8bc22bafb35eb6eee

See more details on using hashes here.

File details

Details for the file kontiki_scheduler-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: kontiki_scheduler-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 8.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.3.2 CPython/3.13.7 Linux/6.8.0-137-generic

File hashes

Hashes for kontiki_scheduler-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 54064a9d113331e88c7db727bea1a11ae7aebea7f1e43c677c73e50786e51685
MD5 44670ab91092d68c8033ef024afe7384
BLAKE2b-256 908fc17acf6f6a9ddc56298d364fa34beefe182a08ec44d90cd2dfa46471e96d

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

1.0.0 This release

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page