@trigger.dev/sdk
4.8.8 · 20 Nov 2026MIT1.7M / weekRepositoryHomepagenpmAtom feed
4.8.8 is the newest release of 4.x.
In short
1 new1 fixed1 internal
Release note
Minor Changes
Realtime streams v2
Prevent uncaught errors in the
onSuccess,onComplete, andonFailurelifecycle hooks from failing attempts/runs.Deprecated the
onStartlifecycle hook (which only fires before therunfunction on the first attempt). Replaced withonStartAttemptthat fires before the run function on every attempt:export const taskWithOnStartAttempt = task({ id: "task-with-on-start-attempt", onStartAttempt: async ({ payload, ctx }) => { //... }, run: async (payload: any, { ctx }) => { //... }, }); // Default a global lifecycle hook using tasks tasks.onStartAttempt(({ ctx, payload, task }) => { console.log( `Run ${ctx.run.id} started on task ${task} attempt ${ctx.run.attempt.number}`, ctx.run ); });If you want to execute code before just the first attempt, you can use the
onStartAttemptfunction and checkctx.run.attempt.number === 1:export const taskWithOnStartAttempt = task({ id: "task-with-on-start-attempt", onStartAttempt: async ({ payload, ctx }) => { if (ctx.run.attempt.number === 1) { console.log("Run started on attempt 1", ctx.run); } }, });
A whole project to check? Paste its package.json in the dependency check: every deprecated, outdated or vulnerable dependency, with what to upgrade to. Free, no account.