Scheduler Module
The Scheduler module provides deployment scheduling capabilities with a provider-agnostic design.Import
Quick Example
Classes
DeploymentScheduler
Minimal deployment scheduler with provider-agnostic design.
Features:
- Simple interval-based scheduling
- Thread-safe operation
- Extensible deployer factory pattern
ScheduleParser
Parses schedule expressions into scheduling parameters. ScheduleParser is also re-exported from praisonai.scheduler.shared and used internally by AgentScheduler / AsyncAgentScheduler.
DeployerInterface
Abstract interface for deployers to ensure provider compatibility.
Methods
DeploymentScheduler.schedule(interval_minutes)
Schedule deployments at a fixed interval.
Parameters:
interval_minutes(int): Minutes between deployments
DeploymentScheduler.start()
Start the scheduler in a background thread.
DeploymentScheduler.stop()
Stop the scheduler.
DeploymentScheduler.is_running()
Check if the scheduler is currently running.
Returns: bool
Example: Custom Deployer
ScheduleJob — Pre-Run Gate Fields
Since PR #2238,ScheduleJob (in praisonaiagents.scheduler.models) has two optional fields for the pre-run condition gate:
ScheduledAgentExecutor
ScheduledAgentExecutor lives in the bot tier (praisonai-bot). The canonical import is:
Constructor reference
Public methods
Atomic claims: When the backing store supports
claim_due, each due job is reserved under a cross-process lock so it fires at most once across all tickers/processes/hosts. Stores without that support fall back to the non-atomic get_due_jobs path.Example
condition_resolver values
JobConditionProtocol and GateResult
JobConditionProtocol and GateResult are exported from praisonaiagents.scheduler:
GateResult— dataclass withrun: bool,context: Optional[str],reason: Optional[str]JobConditionProtocol— protocol for custom gate implementationsSchedulerProviderProtocol— trigger backend protocol deciding when jobs fire;ScheduleLoop(aliasedInProcessScheduleProvider) is the default. See Scheduler Providers.
RunPolicy
Run-scoped guardrail for unattended scheduled agent runs. Scopes the toolset, scans the assembled prompt for injection patterns, persists a durable output audit, and supports fail-closed delivery on failure.
PromptScanResult
Return type from RunPolicy.scan_prompt() and custom scanner callables.
Related
- Scheduler Pre-Run Gate - Full user-facing documentation
- Scheduled Run Policy - Safety gate for unattended runs
- praisonai-bot SDK - Bot-tier package reference
- Deploy Module - Deployment functionality
- CLI Scheduler - CLI scheduling commands

