---
title: "What Is Trigger.dev?"
description: "Understand Trigger.dev, the open-source platform for building background tasks, AI workflows, and durable execution in TypeScript"
image: "https://tractiongrowth.com/og/open-source/trigger-dev-background-jobs/image.png"
---

# What Is Trigger.dev?

# What Is Trigger.dev?

<Callout title="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.
</Callout>

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

| Dimension              | Details                                                                          |
| ---------------------- | -------------------------------------------------------------------------------- |
| **What it does**       | Background tasks, AI workflows, scheduled jobs, durable execution                |
| **Who uses it**        | TypeScript/JavaScript developers building backends, AI apps, data pipelines      |
| **How it's different** | No timeouts, automatic retries, checkpoint/restore, human-in-the-loop waitpoints |
| **Core tech**          | TypeScript SDK + Remix dashboard + PostgreSQL + Redis + ClickHouse               |
| **Repo structure**     | pnpm monorepo with Turborepo (5 apps + 8 published + 14 internal packages)       |
| **License**            | Apache-2.0                                                                       |
| **Deployment**         | Cloud (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)
```

<Callout type="info" title="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.
</Callout>

## The Tech Stack — Why Each Piece Exists

| Layer                    | Technology                      | Why It's Used                                                        |
| ------------------------ | ------------------------------- | -------------------------------------------------------------------- |
| **SDK**                  | TypeScript (tshy dual ESM/CJS)  | First-class DX for the TypeScript ecosystem                          |
| **CLI**                  | Commander + clack/prompts       | Developer workflow: `trigger dev`, `trigger deploy`                  |
| **Dashboard**            | Remix 2 + React 18 + Express    | Server-rendered monitoring UI with real-time updates                 |
| **Database**             | PostgreSQL (with pg\_partman)   | Relational integrity for runs, tasks, orgs; partitioned event tables |
| **Queue**                | Redis (via custom redis-worker) | High-throughput fair multi-tenant task queue (MarQS)                 |
| **Analytics**            | ClickHouse                      | Columnar storage for high-volume task events and logs                |
| **Real-time**            | Socket.io + ElectricSQL         | Live dashboard updates and worker coordination                       |
| **Observability**        | OpenTelemetry                   | Distributed tracing across SDK, workers, and platform                |
| **Worker Orchestration** | Docker / Kubernetes             | Isolated container execution per task run                            |
| **Build**                | Turborepo + tshy/tsup/esbuild   | Monorepo orchestration with package-specific build tools             |

<Callout type="info" title="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.
</Callout>

## Key Statistics

| Metric                 | Value                                                                              |
| ---------------------- | ---------------------------------------------------------------------------------- |
| Published npm packages | 8 (@trigger.dev/sdk, core, build, react-hooks, python, rsc, schema-to-json, CLI)   |
| Internal packages      | 14 (run-engine, schedule-engine, redis, cache, clickhouse, tracing, etc.)          |
| Applications           | 5 (webapp, supervisor, coordinator, docker-provider, kubernetes-provider)          |
| Prisma models          | 50+ (TaskRun, BackgroundWorker, Waitpoint, Checkpoint, etc.)                       |
| CI workflows           | 12+ (release, publish, unit tests, E2E, typecheck, SDK compat)                     |
| Auth methods           | 5 (GitHub OAuth, Google OAuth, Magic link, API keys, Personal Access Tokens)       |
| Run statuses           | 15+ (PENDING, EXECUTING, COMPLETED\_SUCCESSFULLY, CANCELED, SYSTEM\_FAILURE, etc.) |
| Worker runtimes        | 3 (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 Development** — `trigger dev` runs tasks locally with hot reload via WebSocket
* **CLI Deploy** — `trigger deploy` builds and ships task code to the platform
* **React Hooks** — `@trigger.dev/react-hooks` for real-time run status in your UI
* **AI Integration** — `toolFromTask` 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

<Cards>
  <Card title="Trigger.dev Architecture Overview" description="System design, database schema, queue system, and worker orchestration." href="/open-source/trigger-dev-background-jobs/architecture" />

  <Card title="Trigger.dev Workflows and Data Flows" description="Key user journeys traced through SDK, API, run engine, and workers." href="/open-source/trigger-dev-background-jobs/workflows" />

  <Card title="Trigger.dev User Stories and Growth Insights" description="Personas, adoption loops, funnel thinking, and growth levers for PMs." href="/open-source/trigger-dev-background-jobs/user-stories-and-growth" />

  <Card title="How Trigger.dev Is Built" description="Repository structure, build pipeline, dependencies, and deployment." href="/open-source/trigger-dev-background-jobs/how-it-is-built" />
</Cards>

## Resources

* [Official Documentation](https://trigger.dev/docs)
* [GitHub Repository](https://github.com/triggerdotdev/trigger.dev)
* [Cloud Platform](https://cloud.trigger.dev)
* [Community Discord](https://trigger.dev/discord)
* [Self-hosting Guide](https://trigger.dev/docs/open-source-self-hosting)

