Skip to main content

Quick start

Get your first task running in under 5 minutes

How it works

Understand the architecture and core concepts

Writing tasks

Learn how to write and structure tasks in TypeScript

AI agents

Build durable, long-running AI agents with Trigger.dev

What is Trigger.dev?

Trigger.dev is an open-source platform for building and deploying fully-managed background workflows and AI agents in TypeScript. Unlike serverless functions with strict time limits, Trigger.dev runs your tasks for as long as they need — minutes, hours, or days — with built-in retries, queuing, and real-time observability.

No timeouts

Execute long-running tasks that can run for hours or days without being cut off by platform limits.

Automatic retries

Configure intelligent retry policies with exponential backoff so your tasks recover from transient failures.

Elastic scaling

Your tasks scale automatically based on load — no infrastructure to provision or manage.

Human-in-the-loop

Pause a workflow and wait for a human to approve, review, or provide input before continuing.

Realtime updates

Stream task status and AI output directly to your frontend with React hooks and the Realtime API.

Full observability

Every run has complete trace logs, timing data, and error details visible in the dashboard.

Write tasks in your codebase

Tasks live alongside your application code — no separate repo, no new infrastructure to learn. Export a task from any TypeScript file and Trigger.dev handles the rest.
import { task } from "@trigger.dev/sdk";

export const processDocument = task({
  id: "process-document",
  retry: {
    maxAttempts: 3,
    factor: 2,
    minTimeoutInMs: 1000,
  },
  run: async (payload: { documentUrl: string; userId: string }) => {
    // This can run for hours — no timeout restrictions
    const content = await fetchAndParseDocument(payload.documentUrl);
    const summary = await generateAISummary(content);
    await saveToDatabase(payload.userId, summary);
    return { summary };
  },
});

Explore by feature

Scheduled tasks

Run tasks on a cron schedule — daily reports, weekly cleanups, recurring workflows.

Concurrency & queues

Control how many tasks run simultaneously and queue work for later processing.

Wait & suspend

Pause execution waiting for events, durations, tokens, or external approvals.

Build extensions

Add Python, browsers, FFmpeg, and other system dependencies to your tasks.

Realtime API

Subscribe to run status and stream AI output live to your application.

MCP server

Use Trigger.dev’s MCP server with AI coding assistants like Claude and Cursor.

Get started

1

Create an account

Sign up at cloud.trigger.dev and create a new project. You’ll get API keys for development and production environments.
2

Install the SDK and CLI

npx trigger.dev@latest init
This installs @trigger.dev/sdk, the CLI, and creates a trigger.config.ts file in your project.
3

Write your first task

Create a file in the /trigger directory of your project and export a task. See the quickstart guide for a complete walkthrough.
4

Run in development

npx trigger.dev@latest dev
This starts a local dev server that connects to Trigger.dev cloud and lets you trigger and test tasks instantly.
5

Deploy to production

npx trigger.dev@latest deploy
Deploy your tasks to Trigger.dev’s managed infrastructure with a single command.

Guides & examples

Browse all guides

Framework guides for Next.js, Remix, Bun, and more

AI agent examples

End-to-end examples for common AI agent patterns

Example projects

Full projects you can clone and customize

API reference

Complete REST API reference for managing runs and tasks

Build docs developers (and LLMs) love