Trigger.dev v4.7.5

New CLI `tasks trigger` command, programmatic dashboard management with `query.dashboards`, and span redaction before telemetry export.

5 improvements, 1 bug fix, 9 server changes, and 1 other change.

Highlights

Trigger a task from the terminal

trigger.dev tasks trigger is a new CLI command that triggers a task from your terminal and prints the run ID and dashboard URL. It targets the dev environment by default; pass --env to use another. --wait holds until the run completes and prints its output, exiting with code 1 if it failed. The runs commands now also use the same dev branch as trigger dev when you pass --env dev.


npx trigger.dev@latest tasks trigger hello-world --payload '{"name":"Ada"}' --wait

CLI tasks commands docs

Manage custom metric dashboards from code

query.dashboards lets you list, create, update, and delete custom dashboards and their widgets programmatically. Widget queries are validated when saved. The MCP server also gains create_dashboard and set_dashboard_widgets tools, so your AI assistant can build dashboards for you.


import { query } from "@trigger.dev/sdk";
await query.dashboards.create({
title: "Email tasks",
widgets: [
{
title: "Total runs",
query: "SELECT count() AS total FROM runs",
display: { type: "bignumber", column: "total", aggregation: "sum" },
},
],
});

Dashboards docs

Redact span content before telemetry export

telemetry.spanProcessors in trigger.config.ts runs your own span processors before every export, both to Trigger.dev and to your own exporters. Use this to redact or drop span content before it reaches the run trace. chat.agent also accepts a telemetry option to stop recording the user's message and clientData on its spans.


export default defineConfig({
telemetry: { spanProcessors: [new MyRedactingSpanProcessor()] },
});
chat.agent({
id: "my-chat",
telemetry: { recordUserMessage: false, recordClientData: false },
run: async ({ messages, signal, streamText }) =>
streamText({ model, messages, abortSignal: signal }),
});

Improvements

  • trigger deploy and trigger promote now say which environment they're targeting and accept --prod as a shorthand for --env prod. When TRIGGER_ACCESS_TOKEN holds an environment API key and you don't pass --env, they use that key's environment instead of assuming prod. Passing an --env that doesn't match the key is now an error. Preview deploys now detect the branch on CI providers that check out a detached HEAD (GitLab, Bitbucket, CircleCI, Buildkite, Travis CI, Jenkins, Azure Pipelines) instead of creating a branch called HEAD. Test links printed after a preview deploy open the correct preview branch. The MCP deploy tool no longer defaults to prod.
  • trigger dev works better when run by a coding agent (Claude Code, Cursor, Codex): it skips install prompts, lists registered tasks, and prints each run's dashboard URL and output. For everyone, a failed build now prints a message saying it will rebuild when errors are fixed, and retried attempts and crashed task processes now show their errors.

Bug fixes

  • Fixed run subscriptions crashing Node with Controller is already closed after breaking out of the subscription loop. Polling also stops once you break. ApiClient subscribe methods now accept a custom fetchClient.

Other changes

  • Updated the @modelcontextprotocol/sdk dependency to ^1.31.0.

Server changes

These changes are included in the v4.7.5 Docker image and are already live on Trigger.dev Cloud:

  • Recent deployments made with --local-bundle can now be redeployed from the deployments list, rebuilding the same bundle with its build-time environment variables.
  • The API keys page now prompts you to create your first key instead of showing an empty table.
  • The short link /_/billing now takes you straight to the billing page of your current organization.
  • Fixed a batchTriggerAndWait that could stay stuck executing after all child runs finished, caused by a batch creation retry while the server was slow to respond. The parent now resumes with its child runs' results.
  • The natural-language field on the schedule form returns a cron expression again instead of an error.
  • Fixed runs failing to resume from a wait when the platform had already resumed them but the confirmation was lost.
  • Run traces returned by the API no longer include internal debug events.
  • Fixed natural-language schedule generation in the schedule side panel.
  • A run whose process is killed is now only reported as out of memory when the machine actually ran out of memory. Any other kill (machine shutdown or reclaim) fails the attempt as a crash, retried using the task's retry settings on the same machine size.

How to upgrade

Update the trigger.dev/* packages to v4.7.5 using your package manager:


npx trigger.dev@latest update # npm
pnpm dlx trigger.dev@latest update # pnpm
yarn dlx trigger.dev@latest update # yarn
bunx trigger.dev@latest update # bun

Self-hosted users: update your Docker image to ghcr.io/triggerdotdev/trigger.dev:v4.7.5.

Deploy your first agent today

Get set up in minutes, either on your own or with your coding agent.

Get started for free