Scheduling & Automation
OrcBot provides three scheduling mechanisms: one-time task scheduling, recurring heartbeat tasks, and event-driven polling. Together, these enable fully autonomous operation.schedule_task
Schedule a one-time task for future execution.Parameters
string
required
When to run the task. Supports:
- Relative time:
"in 2 hours","in 30 minutes","in 1 day" - Absolute time:
"2025-01-15T14:30:00Z"(ISO 8601) - Cron expression:
"0 9 * * 1-5"(weekdays at 9 AM)
string
required
Natural language task description
Return Value
string
Confirmation with scheduled time and task ID
Relative Time Parsing
Supported formats:"in N minutes"- N minutes from now"in N hours"- N hours from now"in N days"- N days from now"in N weeks"- N weeks from now
Cron Expressions
Standard cron format:Example Usage
Relative time:Response Example
Task Metadata
Scheduled tasks are stored inscheduled-tasks.json with:
- id: Unique task identifier
- cronExpression: Cron pattern
- description: Task description
- nextRun: Next execution timestamp
- createdAt: Creation timestamp
Canceling Tasks
Scheduled tasks can be canceled by modifyingscheduled-tasks.json manually (future skill planned).
Metadata
- isDeep:
false - isDangerous:
false
heartbeat_schedule
Schedule a recurring autonomous task.Parameters
string
required
Cron expression for recurrence (see format above)
string
required
What the agent should do on each execution
Return Value
string
Confirmation with next run time and schedule ID
Heartbeat vs Autonomy
Heartbeat tasks:- Triggered by cron schedule
- Task-specific and focused
- Runs even when queue is empty
- Survives restarts (persisted to
heartbeat-schedules.json)
- Triggered by interval timer
- Context-aware and exploratory
- Only runs when idle
- Governed by
autonomyEnabledconfig
Example Usage
Daily report:Response Example
Persistence
Heartbeat schedules are saved toheartbeat-schedules.json and survive agent restarts.
Smart Heartbeat Features
Exponential Backoff: When heartbeat tasks are unproductive (no meaningful work done), the interval automatically increases:- First idle: 2x interval
- Second idle: 4x interval
- Third idle: 8x interval
- Max: 16x original interval
- User-visible messages sent
- Files created
- Commands executed
- Research completed
- Recent conversation context
- User preferences from USER.md
- Past actions from memory
- Current time and date
Metadata
- isDeep:
false - isDangerous:
false
Polling System
Event-driven condition monitoring without busy-waiting loops.Architecture
The polling system provides:- Condition checking: Evaluate a condition function repeatedly
- Success/failure callbacks: Trigger actions when condition met
- Timeout handling: Maximum wait time before giving up
- Interval control: How often to check the condition
- Event bus integration: Emits events for monitoring
Creating a Poll
Polls are created programmatically (not via a skill). Example:Use Cases
Wait for file creation:Event Bus Events
Best Practices
Common Workflows
Deployment Automation
Daily Reports
Monitoring Integration
Reminder System
Configuration
Autonomy Settings
Heartbeat Backoff
Polling Defaults
Best Practices
Heartbeat tasks have full skill access. They can search the web, read files, send messages, and execute commands just like user-initiated tasks.
Troubleshooting
”Heartbeat not triggering”
- Cause: Cron expression invalid or agent not running
- Fix: Validate cron with https://crontab.guru/, check daemon status
”Polling timed out”
- Cause: Condition never became true within timeout
- Fix: Increase timeout or check condition logic
”Autonomy paused”
- Cause: Backlog limit reached
- Fix: Process pending tasks or increase
autonomyBacklogLimit
”Scheduled task not executing”
- Cause: Task ID collision or scheduler not started
- Fix: Check
scheduled-tasks.jsonfor duplicates, restart agent
Related Skills
Memory
Store context for autonomous tasks
Orchestration
Spawn agents for parallel scheduled work