Trigger.dev v4.4.5

Run replay detection with ctx.run.isReplay, a --no-browser CLI flag for headless environments, and a 24-hour grace window for API key rotations.

3 improvements and 12 server changes.

Highlights

ctx.run.isReplay

Tasks can now check whether the current run is a replay via ctx.run.isReplay. (#3454)


export const myTask = task({
id: "my-task",
run: async (payload, { ctx }) => {
if (ctx.run.isReplay) {
// Skip side effects like sending emails or charging cards on replay
return;
}
await sendEmail(payload.to);
},
});

Improvements

  • Add --no-browser flag to init and login to skip auto-opening the browser during authentication. Useful for CI and headless environments. Also errors loudly when init is run without --yes under non-TTY stdin, instead of silently half-initializing the project. Both commands now include an Examples section in --help. (#3483)
  • Truncate large error stacks and messages to prevent OOM crashes: stack traces capped at 50 frames (top 5 + bottom 45 with an omission notice), individual lines at 1024 chars, and error messages at 1000 chars. Applied in parseError, sanitizeError, and OTel span recording. (#3405)

Server changes

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

  • Add a server-side deprecation gate for deploys from v3 CLI versions, controlled by the DEPRECATE_V3_CLI_DEPLOYS_ENABLED env var. v4 CLI deploys are unaffected. (#3415)
  • Regenerating an environment API key no longer invalidates the previous key immediately. The old key gets a 24-hour grace window via a new RevokedApiKey table, and PATs signed with the rotated key also remain valid during that window. (#3420, #3464)
  • Ship the Errors page to all users, with Slack alert improvements (viewer-timezone timestamps via <!date^> token, pinned "No channel" picker item), activity sparkline peak tooltips, and several dashboard UI fixes. (#3477)
  • Session primitive server infrastructure: Postgres Session + SessionRun tables, ClickHouse sessions_v1 + replication, the sessions JWT scope, and CRUD + realtime routes including end-and-continue for server-orchestrated run handoffs. (#3417)
  • Increase the default maximum project count per organization from 10 to 25. (#3409)
  • Replace the DISTINCT query for task filter dropdowns with a dedicated TaskIdentifier registry table backed by Redis. Fixes duplicate entries when a task changes trigger source and adds active/archived grouping. Environments migrate automatically on their next deploy. (#3368)
  • Stop writing per-tick state (lastScheduledTimestamp, nextScheduledTimestamp, lastRunTriggeredAt) on TaskSchedule. Customer-facing payload.lastTimestamp semantics are unchanged. (#3476)
  • Batch items that hit the environment queue size limit now fast-fail without retries and without creating pre-failed TaskRuns. (#3352)
  • Fix RSS memory leak in realtime proxy routes: thread getRequestAbortSignal() through RealtimeClient to cancel upstream Electric requests on client disconnect. Isolated reproducer showed ~44 KB retained per leaked request. (#3442)
  • Fix memory leak where aborted SSE connections pinned the full request/response graph on Node 20, caused by AbortSignal.any() retaining source signals indefinitely. Also clears the setTimeout(abort) timer in entry.server.tsx so successful HTML renders don't retain the React tree for 30 seconds. (#3430)
  • Fix Redis connection leak in realtime streams: non-blocking methods now share a single connection, and streaming connections tear down via disconnect() immediately with a 15-second inactivity fallback. (#3399)
  • Upgrade Remix from 2.1.0 to 2.17.4 to address React Router security vulnerabilities. (#3372)

How to upgrade

Update the trigger.dev/* packages to v4.4.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.4.5.

Ready to start building?

Build and deploy your first task in 3 minutes.

Get started now