Skip to content

Scheduler API

async with Scheduler() as scheduler:
...

or:

scheduler = Scheduler()
await scheduler.start()
...
await scheduler.stop()

Queue the next input for a persistent root that is IDLE or FAILED.

Canonical integration entry point used by Console and channels. It decides whether the correct action is:

  • submitted
  • enqueued
  • steered

The returned RouteResult.stream is the root stream for that routed turn.

Wait until a state settles to IDLE, COMPLETED, or FAILED.

  • steer(...)
  • cancel(...)
  • shutdown(...)
  • rebind_agent(...)
  • get_state(...)
  • list_states(...)
  • list_events(...)
  • get_stats(...)
  • get_registered_agent(...)
  • route_root_input() exposes stream consumption through RouteResult.stream
  • only one live stream subscriber is allowed per root state_id
  • RouteResult.stream is None only for steered + RUNNING, where the existing subscriber keeps consuming the live stream

SchedulerConfig.state_storage.storage_type supports:

  • memory
  • sqlite
  • mongodb

RouteStreamMode currently supports:

  • RUN_END
  • UNTIL_SETTLED