Skip to main content
Scheduling enables agents to run automatically on time-based schedules, from simple recurring tasks to complex time-orchestrated workflows, ensuring critical operations happen exactly when needed.

Overview

The Scheduling primitive allows you to execute agents at specified times using cron expressions, intervals, or custom schedules. Whether you need daily reports, hourly data syncs, or one-time future executions, scheduling makes it effortless to automate time-based operations. Scheduling is essential for:
  • Recurring Tasks: Run agents daily, weekly, monthly, or custom intervals
  • Batch Processing: Process data during off-peak hours
  • Regular Reports: Generate and distribute reports on schedule
  • Maintenance Operations: Perform cleanup and optimization tasks
  • Time-Based Triggers: Execute agents at specific times or dates
  • Multi-Region Coordination: Schedule across different time zones

Cron Expressions

Use familiar cron syntax for flexible scheduling

Time Zones

Schedule in any time zone with automatic DST handling

One-Time Schedules

Execute agents at a specific future time

Smart Retries

Automatic retry for missed or failed executions

How Scheduling Works

When you schedule an agent:
  1. Definition: Schedule created with cron expression or specific time
  2. Registration: Schedule registered with execution engine
  3. Monitoring: System continuously monitors scheduled times
  4. Execution: Agent executes automatically at scheduled time
  5. Completion: Results logged and next execution calculated
  6. Repeat: Process repeats for recurring schedules
Guaranteed Execution: Schedules use at-least-once execution semantics. Missed executions are caught up automatically.

Schedule Types

Cron Schedules

Interval Schedules

One-Time Schedules

Complex Schedules

Code Examples

Basic Cron Schedule

Interval Schedule

One-Time Execution

Business Hours Schedule

Monthly Schedule

Complex Multi-Schedule

Schedule with Conditions

Manage Schedules

Use Cases

1. Daily Reporting

Automate daily business reports:

2. Data Synchronization

Sync data between systems:

3. System Maintenance

Schedule maintenance tasks:

4. Content Publishing

Schedule content distribution:

5. Compliance and Auditing

Regular compliance checks:

6. Customer Engagement

Automated customer touchpoints:

Best Practices

Cron Expression Tips

Schedule Management

Monitor Schedule Health: Regularly review schedule execution history to catch failures early.

Performance

Integration with Other Primitives

With Workflow

Schedule workflow executions:
Learn more: Workflow Primitive

With Tasks

Create scheduled task generation:
Learn more: Tasks Primitive

With Memory

Remember schedule execution context:
Learn more: Memory Primitive

Performance Considerations

Execution Precision

  • Cron Schedules: ±1 second precision
  • Interval Schedules: ±100ms precision
  • One-Time Schedules: ±1 second precision

Scalability

  • Concurrent Schedules: Thousands of active schedules
  • Execution Rate: Thousands of executions per minute
  • Time Zone Support: All IANA time zones

Cost Optimization

Troubleshooting

Problem: Schedule created but not executingSolutions:
  • Verify schedule is active/enabled
  • Check cron expression is valid
  • Verify time zone is correct
  • Review execution history for errors
  • Check for conflicting schedules
Problem: Schedules being skippedSolutions:
  • Enable catch-up for missed executions
  • Increase execution window
  • Check system load during scheduled time
  • Review concurrency settings
  • Verify timeout isn’t too short
Problem: Schedule running at wrong timeSolutions:
  • Verify time zone string is correct
  • Check for DST transitions
  • Use UTC for consistency
  • Test schedule with multiple dates
Problem: New execution starting while previous still runningSolutions:
  • Increase timeout
  • Set concurrency policy to skip
  • Optimize agent execution time
  • Reduce schedule frequency

Advanced Patterns

Dynamic Scheduling

Adjust schedule based on conditions:

Schedule Dependencies

Chain schedules:

Holiday Handling

Skip holidays automatically:

Trigger

Event-driven agent execution

Workflow

Schedule complex workflows

Background

Run scheduled agents asynchronously

Tasks

Create scheduled task generation

Additional Resources

API Reference

Complete scheduling API documentation

Cron Guide

Cron expression syntax and examples

Time Zones

Supported time zones and DST handling
Pro Tip: Use crontab.guru to test and validate cron expressions before deploying schedules. This helps avoid scheduling errors.