Learn from OSS
Trigger.dev

What Is Trigger.dev?

Understand Trigger.dev, the open-source platform for building background tasks, AI workflows, and durable execution in TypeScript

What Is Trigger.dev?

TL;DR for Product Managers

Trigger.dev is an open-source platform that lets developers run long-running background tasks in TypeScript without timeouts, crashes, or lost progress. Think of it as a managed infrastructure layer for any work that can't happen inside a normal web request — AI pipelines, data processing, scheduled jobs, and multi-step workflows that may take minutes or hours. It can be self-hosted or used as a cloud service.

Trigger.dev is an open-source background job and durable execution platform for TypeScript applications that lets developers run long-lived tasks, AI pipelines, and scheduled work without losing progress. This explainer shows what Trigger.dev does, how the run engine works, and how the repository is organized around execution reliability.

Trigger.dev at a Glance

Trigger.dev is an open-source background task and workflow platform for TypeScript. It's a large monorepo containing 5 applications, 8 published packages, and 14 internal packages that together deliver durable execution — tasks that survive server restarts, network failures, and long processing times.

The Product at a Glance

DimensionDetails
What it doesBackground tasks, AI workflows, scheduled jobs, durable execution
Who uses itTypeScript/JavaScript developers building backends, AI apps, data pipelines
How it's differentNo timeouts, automatic retries, checkpoint/restore, human-in-the-loop waitpoints
Core techTypeScript SDK + Remix dashboard + PostgreSQL + Redis + ClickHouse
Repo structurepnpm monorepo with Turborepo (5 apps + 8 published + 14 internal packages)
LicenseApache-2.0
DeploymentCloud (cloud.trigger.dev) or self-hosted via Docker Compose / Helm

Core Concepts

Understanding Trigger.dev starts with its execution model. Everything revolves around tasks that run inside managed workers:

Organization
  ├── Projects
  │     ├── Environments (Development, Staging, Production, Preview)
  │     │     ├── Background Workers (versioned deployments)
  │     │     │     └── Tasks (the units of work you define)
  │     │     ├── Task Queues (concurrency + rate limits)
  │     │     ├── Task Schedules (cron-based triggers)
  │     │     └── Environment Variables
  │     └── Worker Groups (execution targets)
  ├── Members (team access)
  └── Access Tokens (API keys, PATs, org tokens)

Key Insight

Tasks are the central entity in Trigger.dev. A task is a TypeScript function wrapped with task() that can run for minutes or hours, retry on failure, checkpoint its progress, and wait for external events. Everything else — queues, schedules, runs, waitpoints — connects back to tasks.

The Tech Stack — Why Each Piece Exists

LayerTechnologyWhy It's Used
SDKTypeScript (tshy dual ESM/CJS)First-class DX for the TypeScript ecosystem
CLICommander + clack/promptsDeveloper workflow: trigger dev, trigger deploy
DashboardRemix 2 + React 18 + ExpressServer-rendered monitoring UI with real-time updates
DatabasePostgreSQL (with pg_partman)Relational integrity for runs, tasks, orgs; partitioned event tables
QueueRedis (via custom redis-worker)High-throughput fair multi-tenant task queue (MarQS)
AnalyticsClickHouseColumnar storage for high-volume task events and logs
Real-timeSocket.io + ElectricSQLLive dashboard updates and worker coordination
ObservabilityOpenTelemetryDistributed tracing across SDK, workers, and platform
Worker OrchestrationDocker / KubernetesIsolated container execution per task run
BuildTurborepo + tshy/tsup/esbuildMonorepo orchestration with package-specific build tools

For PMs: What's Durable Execution?

Normal serverless functions timeout after 30–300 seconds. Durable execution means a task can run for hours, and if the server crashes mid-way, the task picks up exactly where it left off — no lost work. Trigger.dev achieves this through checkpointing: periodically saving the task's state so it can be restored. This is critical for AI workflows, large data imports, and multi-step processes.

Key Statistics

MetricValue
Published npm packages8 (@trigger.dev/sdk, core, build, react-hooks, python, rsc, schema-to-json, CLI)
Internal packages14 (run-engine, schedule-engine, redis, cache, clickhouse, tracing, etc.)
Applications5 (webapp, supervisor, coordinator, docker-provider, kubernetes-provider)
Prisma models50+ (TaskRun, BackgroundWorker, Waitpoint, Checkpoint, etc.)
CI workflows12+ (release, publish, unit tests, E2E, typecheck, SDK compat)
Auth methods5 (GitHub OAuth, Google OAuth, Magic link, API keys, Personal Access Tokens)
Run statuses15+ (PENDING, EXECUTING, COMPLETED_SUCCESSFULLY, CANCELED, SYSTEM_FAILURE, etc.)
Worker runtimes3 (Node.js, Docker containers, Kubernetes pods)

Core Features

Task Execution

  • No Timeouts — Tasks can run for minutes, hours, or days without hitting platform limits
  • Automatic Retries — Configurable retry policies with exponential backoff
  • Concurrency Control — Per-queue concurrency limits and rate limiting
  • Idempotency — Built-in idempotency keys prevent duplicate execution
  • Batch Triggering — Trigger thousands of tasks in a single API call

Durable Workflows

  • Checkpointing — Save task state and restore after crashes or restarts
  • Waitpoints — Pause execution waiting for external events, human approval, or time delays
  • Sub-tasks — Tasks can trigger and wait for other tasks (nested execution)
  • Debouncing — Collapse rapid triggers into a single execution

Scheduling & Triggers

  • Cron Schedules — Define recurring tasks with cron expressions and timezone support
  • Event Triggers — Trigger tasks from API calls, webhooks, or other tasks
  • Delayed Runs — Schedule tasks to run at a specific future time

Developer Experience

  • TypeScript-first SDK — Define tasks with full type safety and autocompletion
  • Local Developmenttrigger dev runs tasks locally with hot reload via WebSocket
  • CLI Deploytrigger deploy builds and ships task code to the platform
  • React Hooks@trigger.dev/react-hooks for real-time run status in your UI
  • AI IntegrationtoolFromTask bridges Trigger.dev tasks with the Vercel AI SDK

Observability

  • Run Dashboard — Real-time monitoring of all task runs with status, logs, and traces
  • OpenTelemetry — Full distributed tracing across SDK, workers, and platform
  • ClickHouse Analytics — High-performance log and event querying
  • TSQL — Custom query language for searching task logs
  • Realtime Streaming — Live log output and run progress via Socket.io / SSE

Infrastructure

  • Multi-tenant Isolation — Organization → Project → Environment hierarchy
  • Environment Management — Dev, Staging, Production, and Preview environments with separate API keys
  • Self-hosting — Docker Compose and Helm chart for full on-premise deployment
  • Worker Groups — Route tasks to specific machine types or custom runtimes

What Makes Trigger.dev Different

  1. Durable execution with checkpointing — Tasks survive crashes and restarts; no other open-source TypeScript platform offers this
  2. TypeScript-native — Not a YAML-configured workflow engine; tasks are plain TypeScript functions
  3. Human-in-the-loop — Waitpoints let tasks pause for external input (approvals, webhooks, manual data)
  4. Custom runtimes — Run browsers (Playwright/Puppeteer), Python, FFmpeg, or any Docker image
  5. Cloud + self-hosted — Same codebase powers the managed cloud and on-premise deployments
  6. Fair multi-tenant queuing — MarQS (the internal queue system) ensures no single tenant starves others

What's Next

Resources