Prompt
What should I use for scheduled jobs in a Python app?
Latest observation
Oct 25, 2026
OpenAI APIWeb search: off
It depends on how complex your scheduling needs are. For a Python app, the most common choices are:
1. Simple recurring jobs inside the app
Use APScheduler if you want:
- cron-like schedules
- interval/one-off jobs
- something lightweight
- jobs that can run in the same Python process
Good for:
- small apps
- internal tools
- simple periodic tasks
Watch out for:
- if your app restarts, jobs can be lost unless you configure persistent job storage
- in multi-worker setups, the same job may run multiple times unless coordinated
2. Background task queue with retries and distributed workers
Use Celery if you need:
- reliable background execution
- retries
- multiple workers
- distributed task processing
- scheduled tasks via Celery Beat
Good for:
- production apps with heavier background work
- sending emails, processing files, data syncs
- scaling beyond one process
Tradeoff:
- more setup and operational complexity
- usually requires Redis or RabbitMQ
3. FastAPI/async apps needing lightweight background scheduling
Consider:
- APScheduler
- or an external scheduler/service if you want to avoid running jobs in the web process
If your app is async, APScheduler can still work, but make sure it fits your concurrency model.
4. Very simple periodic shell-style tasks
If you just need to run scripts on a timer, use:
- cron on Linux/macOS
- systemd timers if you want something more modern
This is often the most reliable option for standalone scripts.
Quick recommendation
- Small/simple Python app → APScheduler
- Production app with distributed background jobs → Celery + Celery Beat
- One-off scripts / server maintenance jobs → cron/systemd timers
If you tell me:
- your framework (Django, Flask, FastAPI, etc.)
- whether jobs must survive restarts
- whether you need retries/distributed workers
…I can recommend a specific setup.