Serverless Has a 30-Second Problem
Vercel functions timeout at 30 seconds. Edge functions at 30ms CPU. Your PDF generation takes 2 minutes. Your data import takes 10 minutes. Your AI pipeline takes 5 minutes.
Trigger.dev: Long-Running Tasks for Serverless
Trigger.dev runs background jobs that can take minutes or hours — with retries, scheduling, and observability.
Free Tier
- 50,000 runs/month
- 5 concurrent runs
- 30 min max duration
- Built-in logging and monitoring
Define a Task
import { task } from "@trigger.dev/sdk/v3"
export const generateReport = task({
id: "generate-report",
run: async (payload: { userId: string }) => {
const data = await fetchUserData(payload.userId)
const pdf = await generatePDF(data)
await sendEmail(payload.userId, pdf)
return { status: "sent" }
}
})
Trigger From Your API
app.post("/reports", async (req, res) => {
await generateReport.trigger({ userId: req.user.id })
res.json({ message: "Report generation started" })
})
The API responds instantly. The report generates in the background.
Built-in Features
- Retries with exponential backoff
- Cron scheduling (run daily/weekly)
- Webhooks (trigger on external events)
- Real-time logs in dashboard
- TypeScript-native (full type safety)
Trigger.dev vs BullMQ vs AWS SQS
| Feature | Trigger.dev | BullMQ | AWS SQS |
|---|---|---|---|
| Setup | npm install | Redis needed | AWS account |
| Hosting | Managed | Self-host | AWS |
| Dashboard | Built-in | Bull Board | CloudWatch |
| TypeScript | Native | Good | SDK |
| Free tier | 50K runs | Free (self) | 1M requests |
Run scrapers as background jobs. 88+ scrapers on Apify. Custom: spinov001@gmail.com
Top comments (0)