SKILL PROCEDURE

Trigger.dev

Use when building, deploying, or debugging background jobs, task queues, scheduled work, or durable multi-step workflows in TypeScript with Trigger.dev — including its AI Agents (chat.agent) SDK for durable AI chat, choosing self-hosted versus Trigger.dev Cloud, or reasoning about what task code may safely do under checkpoint-and-resume execution. Published by HardGraph, a curated graph of provenance-backed knowledge for AI agents.

trigger-devbackground-jobsdurable-executiontypescripttask-queue
BEGINNER GUIDE

Understand Trigger.dev before using it

CATEGORY

Trigger.dev is catalogued under Backend and data.

START HERE WHEN

Your work repeatedly involves the concepts tagged above. Open the full procedure below when the current task matches them.

Compare related skills

SKILLCATEGORYSHARED CONCEPTSEXPLANATION
Trigger.devBackend and dataCurrent skillUse when building, deploying, or debugging background jobs, task queues, scheduled work, or durable multi-step workflows in TypeScript with Trigger.dev — including its AI Agents (chat.agent) SDK for durable AI chat, choosing self-hosted versus Trigger.dev Cloud, or reasoning about what task code may safely do under checkpoint-and-resume execution. Published by HardGraph, a curated graph of provenance-backed knowledge for AI agents.
MedusaBackend and data
typescript
Use when building or customizing a Medusa headless commerce backend — deciding whether custom logic belongs in a commerce module, a workflow, or a plugin, choosing between the Admin and Store APIs, designing a multi-step business process that must survive a partial failure, or deciding between self-hosting and Medusa Cloud. Published by HardGraph, a curated graph of provenance-backed knowledge for AI agents.
AppwriteBackend and dataSame categoryAppwrite — an open-source backend-as-a-service (self-hosted or Cloud) providing Auth, Databases, Storage, Functions, Messaging, and Realtime. Use when adding user authentication and sessions, modelling data in the document database with attributes/permissions, uploading and serving files, running serverless Functions (Node, Python, Ruby, PHP, Dart) triggered by events or schedules, sending push/email/SMS, subscribing to realtime document changes, or integrating the Web/Flutter/Apple/Android/React Native SDKs and server SDKs. Published by HardGraph, a curated graph of provenance-backed knowledge for AI agents.
FernBackend and dataSame categoryUse when defining an API once and generating client SDKs, a CLI, and a documentation site from that single definition — choosing between an OpenAPI spec and Fern's own API Definition format, configuring generators.yml or docs.yml, deciding what requires regenerating versus hand-editing, or versioning generated SDKs across languages. Published by HardGraph, a curated graph of provenance-backed knowledge for AI agents.

Trigger.dev

What is HardGraph? HardGraph publishes curated, provenance-backed agent skills grounded in reproducible vendor documentation.

Trigger.dev is a background jobs platform for TypeScript: write a task as ordinary async code, trigger it from your app, and the platform runs it on managed infrastructure with retries, concurrency control, scheduling, and realtime status streamed back to the caller. The distinguishing property is durability — a run can pause and resume hours or days later (waiting on a timer, an external event, or a child run) without a process staying open the whole time.

The decision that shapes everything else

Self-hosted versus Cloud is not a deployment detail — it changes who owns queue infra, worker scaling, and version upgrades. Self-hosting buys data locality and infra control at the cost of operating the queue, workers, and Postgres yourself; Cloud buys elasticity and zero ops at the cost of someone else's infrastructure and pricing. Pick this before writing tasks: concurrency limits, machine presets, and networking assumptions differ between the two.

Tasks versus the AI Agents SDK (chat.agent) is the other easily-confused pair. chat.agent is not a separate product — it's a task with a managed lifecycle for multi-turn conversation state, built on the same run/checkpoint primitives as any other task. Reach for it when a conversation must survive a redeploy or an idle gap between turns; a plain task with its own persistence is simpler when it doesn't.

What durability constrains

A durable run is checkpointed and can be rehydrated on a different process than the one that started it. Work done outside a tracked step can silently re-execute after a resume, so side effects (API calls, writes, sends) not wrapped as idempotent steps can double-fire on retry or replay. In-memory state — open connections, timers, unflushed buffers — does not survive a suspension boundary and must be re-established, not assumed to persist. Non-deterministic values computed outside a step (random IDs, current time) are a similar trap when later logic depends on them staying stable.

What to verify rather than recall

Concurrency and queue semantics, machine/compute presets, self-hosting infrastructure requirements, and SDK APIs change across releases and between the AI Agents SDK and core tasks API. Check these against the mirrored corpus under references/vendor/ or the current docs rather than asserting a version or limit from memory.

References

Hardgraph / curated knowledge for agents.

STATIC EXPORT · CANONICAL SOURCE