Create recurring tasks that run on a cron schedule inside a box. You can schedule shell commands or agent prompts. Available on both box.schedule and ephemeralBox.schedule.
API#
Schedule a shell command#
Run a shell command on a cron schedule.
| Parameter | Required | Description |
|---|---|---|
cron | Yes | 5-field cron expression (UTC) |
command | Yes | string[] — the command to run |
webhookUrl | No | URL to notify when the scheduled run completes |
webhookHeaders | No | Headers to include in the webhook request |
folder | No | Working directory. Defaults to box.cwd; relative paths resolved against it |
Schedule an agent prompt#
Run an agent prompt on a cron schedule. Requires an agent to be configured on the box.
| Parameter | Required | Description |
|---|---|---|
cron | Yes | 5-field cron expression (UTC) |
prompt | Yes | The prompt to send to the agent |
folder | No | Working directory. Defaults to box.cwd; relative paths resolved against it |
model | No | Override the box's default model for this schedule |
options | No | Provider-specific agent options (e.g. maxBudgetUsd, effort, systemPrompt, maxTurns) |
timeout | No | Timeout in milliseconds — kills the run if exceeded |
webhookUrl | No | URL to notify when the scheduled run completes |
webhookHeaders | No | Headers to include in the webhook request |
List schedules#
Retrieve all non-deleted schedules for the current box.
Get a schedule#
Retrieve a single schedule by ID.
Pause a schedule#
Pause an active schedule so it stops running.
Resume a schedule#
Resume a paused schedule.
Delete a schedule#
Remove a schedule so it no longer runs.
Schedule response#
Most schedule methods return a Schedule object:
Cron syntax#
Schedules use standard 5-field cron expressions (UTC):
| Expression | Description |
|---|---|
* * * * * | Every minute |
0 * * * * | Every hour |
0 9 * * * | Daily at 9:00 AM |
0 9 * * 1-5 | Weekdays at 9:00 AM |
*/5 * * * * | Every 5 minutes |
Examples#
Periodic health check#
Schedule a command that checks whether your service is healthy.
Daily code review agent#
Schedule an agent to review recent changes every morning.
Manage schedules#
List active schedules, pause, resume, and clean up ones you no longer need.