Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion box/overall/schedules.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,9 @@ Run an agent prompt on a cron schedule. Requires an agent to be configured on th
const schedule = await box.schedule.agent({
cron: "0 9 * * *",
prompt: "Run the test suite and fix any failures",
model: "claude-sonnet-4-6", // optional, overrides box's model
model: "claude-sonnet-4-6", // optional, overrides box's model
timeout: 300_000, // optional, kill the run after 5 minutes
options: { maxBudgetUsd: 1.0 }, // optional, provider-specific agent options
})

console.log(schedule.id)
Expand All @@ -54,6 +56,8 @@ console.log(schedule.id)
| `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 |

Expand Down Expand Up @@ -131,6 +135,8 @@ interface Schedule {
prompt?: string // present when type is "prompt"
folder?: string
model?: string
agent_options?: Record<string, unknown>
timeout?: number
status: "active" | "paused" | "deleted"
webhook_url?: string
webhook_headers?: Record<string, string>
Expand Down Expand Up @@ -209,6 +215,8 @@ await box.git.clone({ repo: "github.com/your-org/your-repo" })
await box.schedule.agent({
cron: "0 9 * * 1-5",
prompt: "Pull latest changes, review the last 24h of commits, and open issues for any bugs or style violations",
timeout: 600_000,
options: { maxBudgetUsd: 2.0, effort: "high" },
})
```

Expand Down