Packages

@trigger.dev/sdk

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

Your version

180 stable releases, newest first, by release line. Notes are quoted as the maintainers published them.

  1. 4.x · latest line
  2. 4.2.0

    5 Dec 2025
    • cli: Upgrade bun deployments to v1.3.3

    • otel: Exported logs and spans will now have matching trace IDs

    • The --force-local-build flag is now renamed to just --local-build

  3. 4.1.1 – 4.1.22 releases that only update dependencies@trigger.dev/core 4.1.2Show each
  4. 4.1.0

    14 Nov 2025
    • 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);
          }
        },
      });
  5. 4.0.4 – 4.0.74 releases that only update dependencies@trigger.dev/core 4.0.7Show each
  6. 4.0.3

    18 Sep 2025
    • Added the heartbeats.yield utility to allow tasks that do continuous CPU-heavy work to heartbeat and continue running

  7. 4.0.1 – 4.0.22 releases that only update dependencies@trigger.dev/core 4.0.2Show each
  8. 4.0.0

    18 Aug 2025
    • Breaking

      Trigger.dev v4 release. Please see our upgrade to v4 docs to view the full changelog: trigger.dev/docs/upgrade-to-v4

    • Deprecated

      Deprecate toolTask and replace with ai.tool(mySchemaTask)

    • Removed

      Removes the releaseConcurrencyOnWaitpoint option on queues and the releaseConcurrency option on various wait functions. Replaced with the following default behavior:

      Additionally, environment concurrency limits now have a new "Burst Factor", defaulting to 2.0x. The "Burst Factor" allows the environment-wide concurrency limit to be higher than any individual queue's concurrency limit. For example, if you have an environment concurrency limit of 100, and a Burst Factor of 2.0x, then you can execute up to 200 runs concurrently, but any one task/queue can still only execute 100 runs concurrently.

      We've done some work cleaning up the run statuses. The new statuses are:

      We've removed the following statuses:

      We've also added "boolean" helpers to runs returned via the API and from Realtime:

      This change adds the ability to easily detect which runs are being counted against your concurrency limit by filtering for both EXECUTING or DEQUEUED.

  9. 3.x
  10. 3.3.17

    4 Mar 2025
    • Add support for two-phase deployments and task version pinning

  11. 3.3.16

    13 Feb 2025
    • You can add Alerts in the dashboard. One of these is a webhook, which this change greatly improves.

      The main change is that there's now an SDK function to verify and parse them (similar to Stripe SDK).

      const event = await webhooks.constructEvent(request, process.env.ALERT_WEBHOOK_SECRET!);

      If the signature you provide matches the one from the dashboard when you create the webhook, you will get a nicely typed object back for these three types:

  12. 3.3.15

    12 Feb 2025
    • Detect ffmpeg OOM errors, added manual OutOfMemoryError

  13. 3.3.14

    11 Feb 2025
    • Added the ability to retry runs that fail with an Out Of Memory (OOM) error on a larger machine.

  14. 3.3.13

    4 Feb 2025
    • Fixed issue with asResponse and withResponse not working on runs.retrieve

  15. 3.3.12

    24 Jan 2025

    Only updates a dependency:@trigger.dev/core 3.3.12

  16. 3.3.11

    17 Jan 2025
    • Add support for specifying machine preset at trigger time. Works with any trigger function:

      // Same as usual, will use the machine preset on childTask, defaults to "small-1x"
      await childTask.trigger({ message: "Hello, world!" });
      
      // This will override the task's machine preset and any defaults. Works with all trigger functions.
      await childTask.trigger({ message: "Hello, world!" }, { machine: "small-2x" });
      await childTask.triggerAndWait({ message: "Hello, world!" }, { machine: "small-2x" });
      
      await childTask.batchTrigger([
        { payload: { message: "Hello, world!" }, options: { machine: "micro" } },
        { payload: { message: "Hello, world!" }, options: { machine: "large-1x" } },
      ]);
      await childTask.batchTriggerAndWait([
        { payload: { message: "Hello, world!" }, options: { machine: "micro" } },
        { payload: { message: "Hello, world!" }, options: { machine: "large-1x" } },
      ]);
      
      await tasks.trigger<typeof childTask>(
        "child",
        { message: "Hello, world!" },
        { machine: "small-2x" }
      );
      await tasks.batchTrigger<typeof childTask>("child", [
        { payload: { message: "Hello, world!" }, options: { machine: "micro" } },
        { payload: { message: "Hello, world!" }, options: { machine: "large-1x" } },
      ]);
  17. 3.3.10

    10 Jan 2025

    Only updates a dependency:@trigger.dev/core 3.3.10

  18. 3.3.9

    9 Jan 2025
    • Adding ability to update parent run metadata from child runs/tasks

  19. 3.3.8

    8 Jan 2025

    Only updates a dependency:@trigger.dev/core 3.3.8

  20. 3.3.7

    13 Dec 2024
    • Fixes an issue in streams where "chunks" could get split across multiple reads

  21. 3.3.6

    10 Dec 2024
    • Realtime streams now powered by electric. Also, this change fixes a realtime bug that was causing too many re-renders, even on records that didn't change

    • Add option to trigger batched items sequentially, and default to parallel triggering which is faster

  22. 3.3.3 – 3.3.53 releases that only update dependencies@trigger.dev/core 3.3.5Show each
  23. 3.3.2

    2 Dec 2024
    • Add one-time use public tokens to trigger and batch trigger

    • Fix for waiting for realtime streams to finish

  24. 3.3.1

    29 Nov 2024
    • Fixed the missing icons in trigger spans

    • Public access token scopes with just tags or just a batch can now access runs that have those tags or are in the batch. Previously, the only way to access a run was to have a specific scope for that exact run.

  25. 3.3.0

    28 Nov 2024
    • Improved Batch Triggering:

      await myTask.batchTrigger([{ payload: { foo: "bar" } }], {
        idempotencyKey: "my-key",
        idempotencyKeyTTL: "60s",
      });
      // Works for individual items as well:
      await myTask.batchTrigger([
        { payload: { foo: "bar" }, options: { idempotencyKey: "my-key", idempotencyKeyTTL: "60s" } },
      ]);
      // And `trigger`:
      await myTask.trigger({ foo: "bar" }, { idempotencyKey: "my-key", idempotencyKeyTTL: "60s" });
    • Added new batch.trigger and batch.triggerByTask methods that allows triggering multiple different tasks in a single batch:

      import { batch } from "@trigger.dev/sdk/v3";
      import type { myTask1, myTask2 } from "./trigger/tasks";
      
      // Somewhere in your backend code
      const response = await batch.trigger<typeof myTask1 | typeof myTask2>([
        { id: "task1", payload: { foo: "bar" } },
        { id: "task2", payload: { baz: "qux" } },
      ]);
      
      for (const run of response.runs) {
        if (run.ok) {
          console.log(run.output);
        } else {
          console.error(run.error);
        }
      }

      Or if you are inside of a task, you can use triggerByTask:

      import { batch, task, runs } from "@trigger.dev/sdk/v3";
      
      export const myParentTask = task({
        id: "myParentTask",
        run: async () => {
          const response = await batch.triggerByTask([
            { task: myTask1, payload: { foo: "bar" } },
            { task: myTask2, payload: { baz: "qux" } },
          ]);
      
          const run1 = await runs.retrieve(response.runs[0]);
          console.log(run1.output); // typed as { foo: string }
      
          const run2 = await runs.retrieve(response.runs[1]);
          console.log(run2.output); // typed as { baz: string }
      
          const response2 = await batch.triggerByTaskAndWait([
            { task: myTask1, payload: { foo: "bar" } },
            { task: myTask2, payload: { baz: "qux" } },
          ]);
      
          if (response2.runs[0].ok) {
            console.log(response2.runs[0].output); // typed as { foo: string }
          }
      
          if (response2.runs[1].ok) {
            console.log(response2.runs[1].output); // typed as { baz: string }
          }
        },
      });
      
      export const myTask1 = task({
        id: "myTask1",
        run: async () => {
          return {
            foo: "bar",
          };
        },
      });
      
      export const myTask2 = task({
        id: "myTask2",
        run: async () => {
          return {
            baz: "qux",
          };
        },
      });
    • Added ability to subscribe to a batch of runs using runs.subscribeToBatch

  26. 3.2.2

    27 Nov 2024

    Only updates a dependency:@trigger.dev/core 3.2.2

  27. 3.2.1

    20 Nov 2024
    • React hooks now all accept accessToken and baseURL options so the use of the Provider is no longer necessary

    • Upgrade zod to latest (3.23.8)

    • Realtime streams

  28. 3.1.2 – 3.2.02 releases that only update dependencies@trigger.dev/core 3.2.0Show each
  29. 3.1.1

    1 Nov 2024
    • Removed

      Remove browser export condition - not necessary with the react-hooks package that uses core

  30. 3.1.0

    29 Oct 2024
    • Access run status updates in realtime, from your server or from your frontend

  31. 3.0.13

    18 Oct 2024
    • README updates

  32. 3.0.11 – 3.0.122 releases that only update dependencies@trigger.dev/core 3.0.12Show each
  33. 3.0.10

    4 Oct 2024
    • Adding maxDuration to tasks to allow timing out runs after they exceed a certain number of seconds

  34. 3.0.9

    30 Sep 2024
    • Removed the inline-code accessory from the logs when calling trigger or batchTrigger from a run

  35. 3.0.8

    26 Sep 2024
    • Add Run metadata to allow for storing up to 4KB of data on a run and update it during the run

  36. 3.0.7

    24 Sep 2024

    Only updates a dependency:@trigger.dev/core 3.0.7

  37. 3.0.6

    20 Sep 2024
    • Runs.retrieve() now includes details about related runs (root, parent, and children) as well how how the runs were triggered and if they are in a batch

  38. 3.0.5

    18 Sep 2024

    Only updates a dependency:@trigger.dev/core 3.0.5

  39. 3.0.4

    18 Sep 2024
    • Auto-resolve payload/output presigned urls when retrieving a run with runs.retrieve

  40. 3.0.2 – 3.0.32 releases that only update dependencies@trigger.dev/core 3.0.3Show each
  41. 3.0.1

    16 Sep 2024
    • Fixing false-positive package version mismatches

  42. 3.0.0

    16 Sep 2024
    • Breaking

      Updates to support Trigger.dev v3

    • Add machine config and secure zod connection

    • Implement task.onSuccess/onFailure and config.onSuccess/onFailure

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.