Job Types & Examples
QuedUp supports two main types of jobs: one-time jobs for immediate or future execution, and recurring jobs for regular tasks. This guide covers both types with practical examples and use cases.One-time Jobs
One-time jobs execute once at a specified time in the future. Perfect for delayed processing, reminders, or scheduled events.Basic One-time Job
Send a welcome email 5 minutes after user registration:Future Event Scheduling
Schedule a follow-up task for 24 hours later:Delayed Processing
Process uploaded files after a delay:Recurring Jobs
Recurring jobs execute on a schedule defined by cron expressions. Ideal for maintenance tasks, data synchronization, and regular processing.Daily Jobs
Run a daily database backup at 2 AM:Hourly Jobs
Check system health every hour:Weekly Jobs
Generate weekly reports every Monday at 9 AM:Monthly Jobs
Clean up old files on the first day of each month:Advanced Examples
Data Synchronization
Sync data between services every 15 minutes:API Rate Limit Management
Process queued requests every 5 minutes to respect rate limits:Multi-step Workflow
Trigger a complex workflow with multiple steps:Common Use Cases
E-commerce
E-commerce
- Inventory Sync: Sync inventory with suppliers every hour
- Order Processing: Process pending orders every 15 minutes
- Price Updates: Update product prices daily
- Abandoned Cart: Send reminder emails after 24 hours
SaaS Applications
SaaS Applications
- Usage Reports: Generate daily usage reports
- Billing: Process monthly subscriptions
- Data Backup: Backup user data nightly
- Cleanup: Remove expired sessions weekly
Content Management
Content Management
- Publishing: Publish scheduled content
- SEO: Generate sitemaps daily
- Analytics: Sync analytics data hourly
- Backup: Backup content weekly
DevOps & Monitoring
DevOps & Monitoring
- Health Checks: Monitor service health every 5 minutes
- Log Rotation: Rotate logs daily
- Metrics Collection: Collect system metrics every minute
- Security Scans: Run security scans weekly
Cron Expression Reference
Best Practices
Job Naming
Use descriptive names that clearly indicate the job’s purpose:Error Handling
Design your endpoints to handle failures gracefully:- Return appropriate HTTP status codes (200 for success, 4xx/5xx for errors)
- Log errors for debugging
- Make operations idempotent when possible
Scheduling Considerations
- Avoid Overlap: Don’t schedule jobs too frequently to prevent overlap
- Peak Hours: Consider your application’s peak usage times
- Dependencies: Account for dependencies between jobs
- Testing: Test schedules with one-time jobs first
Resource Management
- Timeout Handling: Ensure endpoints respond within 15 minutes. Jobs running longer than this will be terminated and retried according to the retry policy.
- Rate Limiting: Respect external API rate limits
- Batch Processing: Process data in batches to avoid overwhelming systems