Why Trigger.dev
| Old Way | Trigger.dev |
|---|---|
| Redis + BullMQ + Worker | Just TypeScript functions |
| Manage queue infrastructure | Zero infrastructure |
| Custom retry logic | Built-in retries and backoff |
| Build your own dashboard | Full observability UI |
| Cron via OS or Lambda | Built-in scheduling |
Background Tasks
export const generateReport = task({
id: "generate-report",
run: async (payload: { month: string }) => {
const data = await queryDatabase(payload.month); // 30 seconds
const pdf = await generatePDF(data); // 2 minutes
const url = await uploadToS3(pdf); // 10 seconds
await sendEmail({ to: "team@company.com", attachment: url });
return { url };
},
});Scheduling (Cron)
export const dailyCleanup = schedules.task({
id: "daily-cleanup",
cron: "0 2 * * *", // 2 AM daily
run: async () => {
await deleteExpiredSessions();
await cleanupTempFiles();
},
});Retries and Error Handling
export const processPayment = task({
id: "process-payment",
retry: {
maxAttempts: 5,
factor: 2, // Exponential backoff
minTimeout: 1000, // Start at 1s
maxTimeout: 60000, // Max 60s between retries
},
run: async (payload) => {
// Automatically retries on failure
await stripeCharge(payload);
},
});Observability Dashboard
Real-time dashboard showing:
- Active, completed, failed runs
- Execution timeline
- Logs and errors per run
- Retry history
- Queue depth
Deploy Options
# Self-hosted (Docker)
docker compose up -d
# Trigger.dev Cloud (managed)
npx trigger.dev@latest deployKey Stats
- 10,000+ GitHub stars
- Zero infrastructure needed
- Built-in retries, cron, observability
- TypeScript-native
- Self-hosted or cloud
FAQ
Q: What is Trigger.dev? A: An open-source background job framework for TypeScript with retries, scheduling, and observability — no Redis or queue infrastructure needed.
Q: Is Trigger.dev free? A: Open-source and free to self-host. Cloud plan has a free tier.
Q: How is it different from BullMQ? A: BullMQ requires Redis and worker management. Trigger.dev needs zero infrastructure — just TypeScript functions with a built-in dashboard.