Esta página se muestra en inglés. Una traducción al español está en curso.
WorkflowsMay 7, 2026·3 min de lectura

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.

Listo para agents

Este activo puede ser leído e instalado directamente por agents

TokRepo expone un comando CLI universal, contrato de instalación, metadata JSON, plan según adaptador y contenido raw para que los agents evalúen compatibilidad, riesgo y próximos pasos.

Native · 98/100Política: permitir
Superficie agent
Cualquier agent MCP/CLI
Tipo
Skill
Instalación
Single
Confianza
Confianza: New
Entrada
Asset
Comando CLI universal
npx tokrepo install 5b1f380e-5a4d-4504-ae92-de4d40d615b6
Introducción

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+

🙏

Fuente y agradecimientos

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

triggerdotdev/trigger.dev — ⭐ 12,000+

Discusión

Inicia sesión para unirte a la discusión.
Aún no hay comentarios. Sé el primero en compartir tus ideas.

Activos relacionados