Quick Use
npx trigger.dev@latest initin your existing TS project- Define tasks in
trigger/folder, each with anidandrunfunction npx trigger.dev@latest devto run locally;deployfor Cloud or self-host
Intro
Trigger.dev v3 is the durable execution engine for TypeScript. Tasks run as long as needed (no Lambda 15-min limit), survive restarts, support subtasks, retries, queues, dead-letter queues, and stream progress to the UI in realtime. Best for: long agent runs, video/file processing, AI generation pipelines that exceed serverless limits. Works with: Node 20+, Bun, Deno (preview). Setup time: 5 minutes.
Define a task
// trigger/process-video.ts
import { task, logger } from "@trigger.dev/sdk/v3";
export const processVideo = task({
id: "process-video",
maxDuration: 3600, // 1 hour OK
retry: { maxAttempts: 3 },
run: async ({ videoUrl }: { videoUrl: string }) => {
logger.info("Downloading", { url: videoUrl });
const local = await downloadVideo(videoUrl);
logger.info("Transcoding");
const transcoded = await transcode(local);
logger.info("Uploading");
const uploadedUrl = await uploadToS3(transcoded);
return { url: uploadedUrl };
},
});Trigger from your app
import { tasks } from "@trigger.dev/sdk/v3";
import type { processVideo } from "@/trigger/process-video";
const handle = await tasks.trigger<typeof processVideo>(
"process-video",
{ videoUrl: "https://example.com/clip.mp4" },
);
return Response.json({ runId: handle.id });Stream progress to the UI
// React component
import { useRealtimeRun } from "@trigger.dev/react-hooks";
const { run, error } = useRealtimeRun(runId, { accessToken: publicToken });
return <Progress percent={run?.metadata?.percent ?? 0} status={run?.status} />;Subtasks for parallelism
const transcribeVideo = task({
id: "transcribe-video",
run: async ({ videoUrl }) => {
const chunks = await splitVideo(videoUrl);
const transcripts = await Promise.all(
chunks.map((chunk) =>
transcribeChunk.triggerAndWait({ chunk }))
);
return mergeTranscripts(transcripts.map(r => r.output));
},
});Subtasks run in parallel on Trigger's infra; the parent waits and proceeds when all return.
FAQ
Q: Is Trigger.dev free? A: Yes — open-source under Apache 2.0. Self-host on your own Postgres + Docker for free. Trigger.dev Cloud has a free tier (5K runs/mo) and paid plans with more concurrency and longer retention.
Q: How is this different from Inngest? A: Both are durable execution platforms. Trigger.dev is TypeScript-first with deeper React/Next.js integration (realtime hooks). Inngest spans TS + Python and uses event-driven primitives. Pick by ecosystem fit.
Q: What happens if my server crashes mid-task? A: Trigger.dev checkpoints state. After restart, the task resumes from the last completed step. Long-running operations (download, AI generation) survive deployments and crashes.
Source & Thanks
Built by Trigger.dev. Licensed under Apache-2.0.
triggerdotdev/trigger.dev — ⭐ 12,000+