Skip to main content

Agent Scheduling

Station supports cron-based scheduling for automated agent execution. Run health checks, cost analysis, compliance audits, or any other task on a regular schedule.

Quick Start

Via MCP Tools

Station will use the set_schedule MCP tool to configure the schedule.

Via CLI

Via .prompt File

Cron Expression Format

Station uses 6-field cron expressions with second precision:

Common Patterns

Configuration Methods

Use natural language in your AI assistant:
Available tools:
  • set_schedule - Create or update a schedule
  • get_schedule - View current schedule
  • remove_schedule - Delete a schedule

2. Declarative (.prompt file)

Add a schedule block to your agent’s .prompt file:
Schedule fields:

3. CLI

Schedule Variables

Pass variables to scheduled runs:

In .prompt file

Via MCP tool

Variables are available in the agent’s prompt as {{variable_name}}.

Viewing Scheduled Runs

List Scheduled Agents

View Run History

Via MCP

Examples

Daily Cost Analysis

Continuous Health Monitoring

Weekly Compliance Audit

Business Hours Monitoring

Timezone

Schedules run in the server’s local timezone by default. To verify:
For UTC-based scheduling, ensure your server is set to UTC:

Error Handling

Failed Scheduled Runs

  • Failed runs are logged with error details
  • Subsequent scheduled runs continue normally
  • Use stn runs list --status error to find failures

Retry Behavior

Scheduled runs do not automatically retry on failure. Each scheduled execution is independent. For critical tasks, consider:
  1. Building retry logic into the agent
  2. Using a shorter interval with idempotent tasks
  3. Setting up alerting via webhooks

Monitoring Schedules

Web UI

View scheduled agents at http://localhost:8585/agents - scheduled agents show a clock icon.

Logs

Metrics

With observability enabled, scheduled runs appear as traces in Jaeger:
  1. Open Jaeger UI (http://localhost:16686)
  2. Filter by scheduled=true tag
  3. View execution timeline

Best Practices

  1. Use descriptive task prompts - The scheduled task should be self-contained
  2. Set appropriate intervals - Don’t schedule more frequently than needed
  3. Include error handling - Agents should handle failures gracefully
  4. Monitor run history - Check for failed runs regularly
  5. Use variables for flexibility - Make schedules configurable

Next Steps