Trigger.dev: API Design — Tasks & Triggers
Docs-backedTasks are defined using the task() function from the SDK with a run handler. Triggers include: scheduled (cron), webhook, custom event, and manual. Tasks can call subtasks for workflow composition. The SDK provides trigger.tasks.trigger() to start tasks programmatically from application code. Batch triggering sends multiple task invocations in one call. The REST API at api.trigger.dev provides task triggering, run status, and management operations. Run results are retrievable by run ID. Environment variables are managed per-environment (dev, staging, production). The v3 architecture uses a deploy command to push task code to Trigger.dev's infrastructure — similar to deploying to a serverless platform. Task configuration includes retry policies, timeouts, and concurrency limits.