Trigger.dev is an open-source platform for running background jobs in TypeScript. No infrastructure to manage — just write code and deploy.
What Is Trigger.dev?
Trigger.dev runs long-running tasks outside your main application. It handles retries, scheduling, queuing, and observability.
Free tier:
- 50,000 task runs/month
- Unlimited tasks
- Dashboard and logs
Quick Start
npx trigger.dev@latest init
npx trigger.dev@latest dev
Define a Task
import { task } from "@trigger.dev/sdk/v3";
export const processOrder = task({
id: "process-order",
retry: { maxAttempts: 3 },
run: async (payload: { orderId: string; email: string }) => {
// Step 1: Validate order
const order = await db.orders.findUnique({ where: { id: payload.orderId } });
// Step 2: Charge payment
await stripe.charges.create({ amount: order.total });
// Step 3: Send confirmation
await sendEmail(payload.email, "Order confirmed!");
return { success: true, orderId: payload.orderId };
}
});
Trigger from Your App
import { processOrder } from "./trigger/process-order";
// From API route
app.post("/api/orders", async (req, res) => {
const order = await createOrder(req.body);
// Trigger background job
await processOrder.trigger({ orderId: order.id, email: req.body.email });
res.json({ status: "processing" });
});
Use Cases
- Email processing — send bulk emails
- Payment handling — async payment flows
- Data sync — sync between services
- Report generation — PDF/CSV exports
- AI tasks — long-running LLM calls
Trigger.dev vs Alternatives
| Feature | Trigger.dev | BullMQ | Inngest |
|---|---|---|---|
| Language | TypeScript | Node.js | TypeScript |
| Infrastructure | Managed | Self (Redis) | Managed |
| Free tier | 50K runs | Unlimited | 25K events |
| Dashboard | Yes | Basic | Yes |
| Retries | Built-in | Config | Built-in |
Need web data at scale? Check out my scraping tools on Apify or email spinov001@gmail.com for custom solutions.
Top comments (0)