Orchestrate
Schedules
Wake agents on a schedule to run work while nobody is watching.
Actor schedules wake an agent to run a prompt on a timer.
import { pi } from "@rivet-dev/pi";
import { agentOSProvider } from "@rivet-dev/sandbox-adapter/agentos";
import { setup } from "rivetkit";
const agent = pi({
model: "anthropic/claude-opus-5-5",
sandbox: agentOSProvider(),
onCreate: async (c) => {
await c.cron.set({
name: "morning-triage",
expression: "0 9 * * *",
action: "prompt",
args: ["Run the test suite and summarize any failures."],
});
},
});
export const registry = setup({ use: { agent } });
- The cron calls the agent’s
promptaction every day at 9:00 UTC.onCreatesets it once, when the agent is first created. - For a single run later, use
c.schedule.after(ms, "prompt", text)orc.schedule.at(time, "prompt", text). - The agent sleeps between runs. An agentOS VM sleeps on its own when idle, while E2B and Daytona sandboxes are suspended while the agent sleeps.
- For work that runs entirely inside the sandbox, the agentOS VM has its own cron.
See Schedules for cron expressions, time zones, and history.