Deployment Overview
Complete guide to deploying Trigger.dev tasks.
Deploying 101
bash
npx trigger.dev login # Authenticate
npx trigger.dev deploy # DeployTriggering Deployed Tasks
Copy the PROD API key from the Trigger.dev dashboard and set:
TRIGGER_SECRET_KEY="tr_prod_abc123"Then trigger tasks normally:
ts
import { myTask } from "./trigger/tasks";
await myTask.trigger({ foo: "bar" });Versions
Each deploy creates a new version — a snapshot of all your tasks.
Current Version
- One "current" version per environment
- New task runs execute against the current version
- Once a run starts, it's locked to that version (retries use same version)
- "Replay" in dashboard creates a new run locked to the current version
Version Locking
Specify a version when triggering:
ts
await myTask.trigger({ foo: "bar" }, { version: "20250228.1" });Or set globally:
bash
TRIGGER_VERSION=20250228.1Child Tasks & Version Locking
| Function | Child version | Locked? |
|---|---|---|
trigger() | Current | No |
batchTrigger() | Current | No |
triggerAndWait() | Same as parent | Yes |
batchTriggerAndWait() | Same as parent | Yes |
Skip Promotion
Deploy without setting as current:
bash
npx trigger.dev deploy --skip-promotion
# Promote when ready:
npx trigger.dev promote 20250228.1See Atomic Deployment for staged rollout patterns.
Staging Deploys
bash
npx trigger.dev deploy --env stagingUse staging API key:
TRIGGER_SECRET_KEY="tr_stg_abcd123"INFO
Staging requires Hobby or Pro plan on Trigger.dev Cloud.
For additional environments, use preview branches.
Local Builds
By default, builds use a remote build provider. Force local:
bash
npx trigger.dev deploy --force-local-buildRequirements: Docker + Docker Buildx
Environment Variables
Add via:
- Trigger.dev dashboard → Environment Variables
syncEnvVarsbuild extensionsyncVercelEnvVars
Troubleshooting
Dry Run
bash
npx trigger.dev deploy --dry-run
# Outputs build dir path for inspectionCommon Errors
Failed to build project image
- Check full build logs linked in error output
- Try
--force-local-buildas fallback
No loader is configured for ".node" files
- Add the package to
build.externalintrigger.config.ts:
ts
build: { external: ["your-native-package"] }Cannot find matching keyid
- Node.js v22 + corepack issue
- Fix: downgrade to Node.js v20, or
npm i -g corepack@latest