Skip to main content
Background agents run autonomously on schedules without user interaction, enabling automated workflows like daily digests, data sync, and system monitoring.

Overview

Background agents are defined as Markdown files in the agents/ directory and scheduled via ~/.rowboat/config/agent-schedule.json. The background runner polls every minute to check for agents that need to run.
Runner Implementation: apps/x/packages/core/src/agent-schedule/runner.ts:1The runner executes as a background service, managing schedules, timeouts, and state persistence.

Schedule Configuration

Configuration File

Schedules are defined in ~/.rowboat/config/agent-schedule.json:

Schedule Types

Runs at exact times defined by cron expression
Common expressions:
  • */5 * * * * - Every 5 minutes
  • 0 8 * * * - Every day at 8am
  • 0 9 * * 1 - Every Monday at 9am
  • 0 0 1 * * - First day of every month at midnight
  • 0 */2 * * * - Every 2 hours
  • 30 14 * * 1-5 - Weekdays at 2:30pm
Next run calculation:
Location: apps/x/packages/core/src/agent-schedule/runner.ts:62
Runs once during a time window (randomized)
The agent runs once at a random time within the window. Use this for flexible timing (“sometime in the morning” rather than “exactly at 8am”).Next run calculation:
Location: apps/x/packages/core/src/agent-schedule/runner.ts:72
Runs exactly once at a specific time
Use for one-time tasks like migrations or setup scripts. The runAt time is in local time (no Z suffix).Execution check:
Location: apps/x/packages/core/src/agent-schedule/runner.ts:128

Starting Message

Optional message sent to the agent on startup:
Defaults to "go" if not specified. Location: apps/x/packages/core/src/agent-schedule/runner.ts:13

Description

Optional description displayed in the UI:

Schedule State

IMPORTANT: Do NOT manually edit agent-schedule-state.json - it is managed automatically by the runner.
The runner tracks execution state in ~/.rowboat/config/agent-schedule-state.json:

State Fields

Runner Implementation

Main Loop

The runner executes every minute:
Location: apps/x/packages/core/src/agent-schedule/runner.ts:323

Interruptible Sleep

Allows immediate wake on trigger:
Location: apps/x/packages/core/src/agent-schedule/runner.ts:28

Poll and Run

Location: apps/x/packages/core/src/agent-schedule/runner.ts:258

Run Agent

Location: apps/x/packages/core/src/agent-schedule/runner.ts:146

Complete Example

Multi-Agent Workflow

Email reader agent (agents/email_reader.md):
Daily summary agent (agents/daily_summary.md):
Schedule configuration (~/.rowboat/config/agent-schedule.json):

Best Practices

Single responsibility - Each agent should do one thing wellAutonomous operation - Add “Don’t ask for human input” to instructionsClear delegation - Explicitly state when to call other agentsData passing - Make it clear what data to extract and pass between agentsError handling - Background agents should handle errors gracefully
Avoid executeCommand - Don’t attach executeCommand to background agents running unattendedUse specific tools - Use workspace-readFile, workspace-writeFile, etc. insteadValidate inputs - Check data before processingFile paths - Ask users for output paths, then hardcode in instructions
Choose appropriate schedule type:
  • Cron - Predictable, exact timing
  • Window - Flexible timing (“sometime in the morning”)
  • Once - One-time tasks, migrations
Consider frequency:
  • Too frequent = wasted resources
  • Too infrequent = stale data
Timezone awareness:
  • All times are in local machine timezone
  • Document expected timezone in descriptions

Troubleshooting

Next Steps

Runtime Architecture

Understand how agents execute

Skills

Explore available skills