Learn how to deploy your tasks to Trigger.dev.
Copy the API key from the dashboard and set the TRIGGER_SECRET_KEY environment variable, and then any tasks you trigger will run against the deployed version:
version parameter. This is useful when you want to run a task against a specific version of the code:
TRIGGER_VERSION environment variable:
| Trigger function | Parent task version | Child task version | isLocked |
|---|---|---|---|
trigger() | 20240313.2 | Current | No |
batchTrigger() | 20240313.2 | Current | No |
triggerAndWait() | 20240313.2 | 20240313.2 | Yes |
batchTriggerAndWait() | 20240313.2 | 20240313.2 | Yes |
--skip-promotion flag:
This allows you to deploy and test a new version without affecting new task runs. When you want to promote the version, you can do so from the CLI:
To learn more about skipping promotion and how this enables atomic deployments, see our Atomic deployment guide.
deploy command will deploy to the prod environment. If you want to deploy to a different environment, you can use the --env flag:
staging environment, with a new version number and an independent current version:
Now you can trigger tasks against the staging environment by setting the TRIGGER_SECRET_KEY environment variable to the staging API key:
prod and staging. Multiple environments are on our roadmap which you can track here.
--log-level debug at the end. This will print out a lot of information about the deploy. If you can’t figure out the problem from the information below please join our Discord and create a help forum post. Do NOT share the extended debug logs publicly as they might reveal private information about your project.
Failed to build project image: Error building imageDeployment encountered an errorNo loader is configured for ".node" files.node files are native code and can’t be bundled like other packages. To fix this, add your package to build.external in the trigger.config.ts file like this:
Cannot find matching keyidnpm i -g corepack@latest