Skip to main content

AgentScheduler

Defined in the agent_scheduler module.
Scheduler for running PraisonAI agents periodically. Features:
  • Interval-based scheduling (hourly, daily, custom)
  • Thread-safe operation
  • Automatic retry on failure
  • Execution logging and monitoring
  • Graceful shutdown

Constructor

agent
Any
required
No description available.
task
str
required
No description available.
config
Optional
No description available.
on_success
Optional
No description available.
on_failure
Optional
No description available.

Methods

Usage

scheduler = AgentScheduler(agent, task="Check news")
    scheduler.start(schedule_expr="hourly", max_retries=3)
    # Agent runs every hour automatically
    scheduler.stop()  # Stop when needed