Packages

@trigger.dev/sdk

4.8.8 · 20 Nov 2026MIT1.7M / weekRepositoryHomepagenpmAtom feed

Your version

4.1.0

14 Nov 2025Where it was published

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, and onFailure lifecycle hooks from failing attempts/runs.

    Deprecated the onStart lifecycle hook (which only fires before the run function on the first attempt). Replaced with onStartAttempt that 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 onStartAttempt function and check ctx.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.