Defining Jobs
Describe what should happen and when:Schedule Formats
Backdrift understands natural language schedules:| Description | Cron Expression |
|---|---|
| ”Every day at midnight” | 0 0 * * * |
| ”Every hour” | 0 * * * * |
| ”Every Monday at 9 AM” | 0 9 * * MON |
| ”First of every month” | 0 0 1 * * |
| ”Every 15 minutes” | */15 * * * * |
| ”Weekdays at 6 PM” | 0 18 * * MON-FRI |
How It Works
- Scheduler triggers on the defined schedule
- Job Queue ensures reliable delivery
- Job Handler executes your logic
- Retries if the job fails
Job Features
Reliable Execution
Jobs run exactly once, with automatic retries on failure.
Error Handling
Failed jobs go to a dead-letter queue for debugging.
Logging
Full execution logs available in the Admin Dashboard.
Manual Trigger
Run jobs on-demand from the Admin Dashboard.
Example Jobs
Data Cleanup
Report Generation
External Sync
Reminders
Monitoring Jobs
In the Admin Dashboard → Jobs tab:- View all scheduled jobs
- See last run status and timing
- Expand to see execution history
- Click Run Now to trigger manually
- View logs for each execution
Dead Letter Queue
Failed jobs (after retries) go to a Dead Letter Queue:- Jobs are retained for 14 days
- View failure reason and stack trace
- Retry or delete from the queue
- Alert on DLQ depth
Best Practices
Idempotency
Idempotency
Jobs might run twice (rare, but possible). Design for idempotency:❌ “Send email to users”
✅ “Send email to users who haven’t received it today”
Timeouts
Timeouts
Jobs have a 15-minute timeout by default. For longer tasks, use Durable Workflows.
Error Handling
Error Handling
Jobs retry 3 times with exponential backoff. After that, they go to the DLQ.
Concurrency
Concurrency
Jobs run in parallel by default. If you need serial execution, specify it:“Run sequentially to avoid race conditions.”
Event-Driven Jobs
Jobs can also trigger on events, not just schedules:Durable Workflows
For long-running processes that need to pause and resume.
