Schedule Agent
Automate agent runs with VM0's built-in scheduling
Use vm0 schedule to run your agents automatically on a schedule. VM0 handles all scheduling infrastructure - no external cron servers or GitHub Actions needed.
Quick Start
# Set up a daily schedule
vm0 schedule setup my-agent
# Enable the schedule
vm0 schedule enable my-agentCommands
| Command | Description |
|---|---|
vm0 schedule setup <agent> | Create or edit a schedule |
vm0 schedule list | List all schedules |
vm0 schedule status <agent> | Show schedule details and recent runs |
vm0 schedule enable <agent> | Activate a schedule |
vm0 schedule disable <agent> | Pause a schedule |
vm0 schedule delete <agent> | Remove a schedule |
Setting Up a Schedule
Interactive Mode
Run vm0 schedule setup without options for guided setup:
vm0 schedule setup my-agentThe CLI will prompt for:
- Frequency: daily, weekly, monthly, or one-time
- Time: When to run (HH:MM format)
- Day: Day of week or month (for weekly/monthly)
- Timezone: Your local timezone (auto-detected)
- Prompt: The prompt to send to the agent
Non-Interactive Mode
Use flags for CI/CD or scripting:
vm0 schedule setup my-agent \
--frequency daily \
--time 09:00 \
--timezone America/Los_Angeles \
--prompt "run daily report"Setup Options
| Option | Description |
|---|---|
-f, --frequency <type> | Schedule frequency: daily, weekly, monthly, once |
-t, --time <HH:MM> | Time to run (24-hour format) |
-d, --day <day> | Day of week (mon-sun) or month (1-31) |
-z, --timezone <tz> | IANA timezone (e.g., America/New_York) |
-p, --prompt <text> | Prompt to run |
--var <KEY=value> | Pass variable (repeatable) |
--secret <KEY=value> | Pass secret (repeatable) |
--artifact-name <name> | Artifact name (default: artifact) |
Schedule Frequencies
Daily
vm0 schedule setup my-agent --frequency daily --time 09:00Weekly
vm0 schedule setup my-agent --frequency weekly --day mon --time 09:00Monthly
vm0 schedule setup my-agent --frequency monthly --day 1 --time 09:00One-Time
vm0 schedule setup my-agent --frequency once --day 2024-12-25 --time 09:00Managing Schedules
List All Schedules
vm0 schedule listOutput:
AGENT TRIGGER STATUS NEXT RUN
my-agent 0 9 * * * (PST) enabled in 2 hours
reporter 0 18 * * 1 (PST) disabled -Check Schedule Status
vm0 schedule status my-agentShows detailed information including recent runs and next scheduled time.
Enable/Disable
# Pause a schedule
vm0 schedule disable my-agent
# Resume a schedule
vm0 schedule enable my-agentDelete a Schedule
vm0 schedule delete my-agentPassing Variables and Secrets
Recommended: Use Platform Storage
Store secrets on the platform once, and they're automatically available for all scheduled runs:
vm0 variable set ENV production
vm0 secret set API_KEY sk-xxxThen set up your schedule without passing secrets:
vm0 schedule setup my-agent \
--frequency daily \
--time 09:00 \
--prompt "deploy to production"Alternative: Schedule-Specific Values
For schedule-specific overrides, pass values in the setup command:
vm0 schedule setup my-agent \
--frequency daily \
--time 09:00 \
--prompt "deploy to production" \
--var ENV=production \
--secret API_KEY=sk-xxxSchedule-specific values (--var, --secret) override Platform-stored values for that schedule only. Other schedules and manual runs still use Platform-stored values.
The agent can access these via ${{ vars.ENV }} and ${{ secrets.API_KEY }}.
See Environment Variables for more details.