Skip to content

Tasks

Tasks in Raindrop provide scheduled operations that run on predictable timetables using cron expressions. Instead of external cron jobs or background services, tasks bring scheduled work into your application code with full access to resources and environment.

What Tasks Provide

Cron-Based Scheduling Precise timing control using familiar cron expressions for complex schedules like “2:15 AM on the first day of each month” or “every 10 minutes during business hours.”

Resource Access Full access to databases, storage, and external services using the same configuration and patterns as other application components.

Independent Execution Tasks run separately from user-facing operations without interfering with HTTP requests or blocking interactive features.

Reliable Scheduling Automatic execution at specified times with built-in retry logic and failure handling for consistent operation.

When to Use Tasks

Good Fit

  • Maintenance Operations: Database cleanup, log rotation, cache invalidation that must happen on schedule
  • Report Generation: Periodic reports, data exports, and analytics processing that run at specific intervals
  • Data Synchronization: Pulling updates from external APIs or reconciling data between systems
  • Health Monitoring: System status checks and automated alerting that runs continuously

Consider Alternatives

  • Event-Driven Processing: Work triggered by user actions or external events works better with Services and Queues
  • Immediate Processing: Operations requiring instant responses should use Services instead of scheduled execution
  • Variable Timing: Work that depends on data availability rather than time should use Queues or Observers

Integration Patterns

Maintenance Automation Automate database cleanup, temporary file removal, and system maintenance without external infrastructure or coordination.

Periodic Data Processing Process accumulated data, generate summaries, and update derived information on regular schedules.

External Integration Pull data from external APIs, synchronize with third-party services, and maintain data consistency across systems.

System Monitoring Continuously monitor system health, verify external dependencies, and alert when problems arise.

Tasks excel at operations that must happen consistently on schedule regardless of user activity or system load.