Skip to content

APScheduler

Requires APScheduler 3.10.2+ on its 3.x scheduler interface, Python 3.11+. The package declares no upper bound; APScheduler 4 is a different API, so install apscheduler<4 alongside it. See the compatibility matrix for the full pin string.

Terminal window
pip install z4j-apscheduler
Jobstore Inventory and advertised controls
SQLAlchemyJobStore ✓
RedisJobStore ✓
MongoDBJobStore ✓
MemoryJobStore ✓ (jobs are lost on restart)

The adapter advertises list, enable, disable, trigger-now, and delete. It uses resume_job, pause_job, modify_job(next_run_time=...), and remove_job for those controls. Create and update are not advertised and raise NotImplementedError if called directly.

APScheduler trigger z4j projection
CronTrigger cron, with the trigger string as the expression
IntervalTrigger interval, with interval_length as the expression
DateTrigger clocked, with run_date as the expression
Compound or custom trigger fallback cron projection with the trigger string, or unknown

The advertised controls address the native job by ID and are not limited by the projected trigger kind. The projection does not make compound or custom triggers editable through create/update.

  • Dramatiq + APScheduler - APScheduler fires, Dramatiq executes.
  • Standalone - APScheduler as a general-purpose "do X every Monday at 03:00".

One agent runtime can register one apscheduler adapter entry. Every APScheduler adapter has the same name, and the runtime stores scheduler adapters by name, so a later instance would replace the earlier one. Use separate agent processes when multiple scheduler instances must appear independently.

  • Misfire grace time, coalescing, max instances - not projected. The adapter reads the trigger, args, kwargs, and next_run_time; misfire_grace_time, coalesce, and max_instances stay in the jobstore and do not appear in the schedule detail.