Cette page est affichée en anglais. Une traduction française est en cours.
WorkflowsMay 7, 2026·3 min de lecture

Trigger.dev v3 — Durable Background Jobs with No Timeouts

Trigger.dev v3 runs durable TypeScript background jobs with no Lambda 15-min limit. Subtasks, retries, queues, dead letter, realtime UI streaming.

Prêt pour agents

Cet actif peut être lu et installé directement par les agents

TokRepo expose une commande CLI universelle, un contrat d'installation, le metadata JSON, un plan selon l'adaptateur et le contenu raw pour aider les agents à juger l'adaptation, le risque et les prochaines actions.

Native · 98/100Policy : autoriser
Surface agent
Tout agent MCP/CLI
Type
Skill
Installation
Single
Confiance
Confiance : New
Point d'entrée
Asset
Commande CLI universelle
npx tokrepo install 5b1f380e-5a4d-4504-ae92-de4d40d615b6
Introduction

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.


Quick Use

  1. npx trigger.dev@latest init in your existing TS project
  2. Define tasks in trigger/ folder, each with an id and run function
  3. npx trigger.dev@latest dev to run locally; deploy for 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+

🙏

Source et remerciements

Built by Trigger.dev. Licensed under Apache-2.0.

triggerdotdev/trigger.dev — ⭐ 12,000+

Fil de discussion

Connectez-vous pour rejoindre la discussion.
Aucun commentaire pour l'instant. Soyez le premier à partager votre avis.

Actifs similaires