@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 breaking3 removed1 deprecated8 new7 fixed8 changed1 internal
- Breaking
Trigger.dev v4 release. Please see our upgrade to v4 docs to view the full changelog: trigger.dev/docs/upgrade-to-v4
- Removed
Removed deprecated properties from
ctx - Removed
Concurrency is never released when a run is first blocked via a waitpoint, at either the env or queue level.
- Removed
Concurrency is always released when a run is checkpointed and shutdown, at both the env and queue level.
- Deprecated
Deprecate toolTask and replace with
ai.tool(mySchemaTask)
Release note
Major Changes
- Breaking
Trigger.dev v4 release. Please see our upgrade to v4 docs to view the full changelog: trigger.dev/docs/upgrade-to-v4
Patch Changes
Importing from runEngine/index.js breaks non-node runtimes
Run Engine 2.0 (alpha)
Logging large objects is now much more performant and uses less memory
New internal idempotency implementation for trigger and batch trigger to prevent request retries from duplicating work
When you create a Waitpoint token using
wait.createToken()you get a URL back that can be used to complete it by making an HTTP POST request.Support AI SDK 5.0.
ai.toolnow accepts either a schemaTask or a task with a provided jsonSchemaExternal Trace Correlation & OpenTelemetry Package Updates.
Package Previous Version New Version Change Type @opentelemetry/api1.9.0 1.9.0 No change (stable API) @opentelemetry/api-logs0.52.1 0.203.0 Major update @opentelemetry/core- 2.0.1 New dependency @opentelemetry/exporter-logs-otlp-http0.52.1 0.203.0 Major update @opentelemetry/exporter-trace-otlp-http0.52.1 0.203.0 Major update @opentelemetry/instrumentation0.52.1 0.203.0 Major update @opentelemetry/instrumentation-fetch0.52.1 0.203.0 Major update @opentelemetry/resources1.25.1 2.0.1 Major update @opentelemetry/sdk-logs0.52.1 0.203.0 Major update @opentelemetry/sdk-node0.52.1 - Removed (functionality consolidated) @opentelemetry/sdk-trace-base1.25.1 2.0.1 Major update @opentelemetry/sdk-trace-node1.25.1 2.0.1 Major update @opentelemetry/semantic-conventions1.25.1 1.36.0 Minor update
External trace correlation and propagation
We will now correlate your external traces with trigger.dev traces and logs when using our external exporters:
```ts
import { defineConfig } from "@trigger.dev/sdk";
import { OTLPLogExporter } from "@opentelemetry/exporter-logs-otlp-http";
import { OTLPTraceExporter } from "@opentelemetry/exporter-trace-otlp-http";
export default defineConfig({
project: process.env.TRIGGER_PROJECT_REF,
dirs: ["./src/trigger"],
telemetry: {
logExporters: [
new OTLPLogExporter({
url: "https://api.axiom.co/v1/logs",
headers: {
Authorization: `Bearer ${process.env.AXIOM_TOKEN}`,
"X-Axiom-Dataset": "test",
},
}),
],
exporters: [
new OTLPTraceExporter({
url: "https://api.axiom.co/v1/traces",
headers: {
Authorization: `Bearer ${process.env.AXIOM_TOKEN}`,
"X-Axiom-Dataset": "test",
},
}),
],
},
maxDuration: 3600,
});
```
You can also now propagate your external trace context when calling back into your own backend infra from inside a trigger.dev task:
```ts
import { otel, task } from "@trigger.dev/sdk";
import { context, propagation } from "@opentelemetry/api";
async function callNextjsApp() {
return await otel.withExternalTrace(async () => {
const headersObject = {};
// Now context.active() refers to your external trace context
propagation.inject(context.active(), headersObject);
const result = await fetch("http://localhost:3000/api/demo-call-from-trigger", {
headers: new Headers(headersObject),
method: "POST",
body: JSON.stringify({
message: "Hello from Trigger.dev",
}),
});
return result.json();
});
}
export const myTask = task({
id: "my-task",
run: async (payload: any) => {
await callNextjsApp();
},
});
```Add jsonSchema support when indexing tasks
Fixed an issue with realtime streams that timeout and resume streaming dropping chunks
Added and cleaned up the run ctx param:
New optional properties
ctx.run.parentTaskRunIdandctx.run.rootTaskRunIdreference the current run's root/parent ID.Removed deprecated properties from
ctxAdded a new
ctx.deploymentobject that contains information about the deployment associated with the run.
We also update
metadata.rootandmetadata.parentto work even when the run is a "root" run (meaning it doesn't have a parent or a root associated run). This now works:metadata.root.set("foo", "bar"); metadata.parent.set("baz", 1); metadata.current().foo; // "bar" metadata.current().baz; // 1The envvars.list() and retrieve() functions receive isSecret for each value. Secret values are always redacted.
Fix issue where realtime streams would cut off after 5 minutes
- Deprecated
Deprecate toolTask and replace with
ai.tool(mySchemaTask) Display clickable links in Cursor terminal
- Removed
Removes the
releaseConcurrencyOnWaitpointoption on queues and thereleaseConcurrencyoption on various wait functions. Replaced with the following default behavior:Concurrency is never released when a run is first blocked via a waitpoint, at either the env or queue level.
Concurrency is always released when a run is checkpointed and shutdown, at both the env and queue level.
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:
PENDING_VERSION: Task is waiting for a version update because it cannot execute without additional information (task, queue, etc.)QUEUED: Task is waiting to be executed by a workerDEQUEUED: Task has been dequeued and is being sent to a worker to start executing.EXECUTING: Task is currently being executed by a workerWAITING: Task has been paused by the system, and will be resumed by the systemCOMPLETED: Task has been completed successfullyCANCELED: Task has been canceled by the userFAILED: Task has failed to complete, due to an error in the systemCRASHED: Task has crashed and won't be retried, most likely the worker ran out of resources, e.g. memory or storageSYSTEM_FAILURE: Task has failed to complete, due to an error in the systemDELAYED: Task has been scheduled to run at a specific timeEXPIRED: Task has expired and won't be executedTIMED_OUT: Task has reached it's maxDuration and has been stopped
We've removed the following statuses:
WAITING_FOR_DEPLOY: This is no longer used, and is replaced byPENDING_VERSIONFROZEN: This is no longer used, and is replaced byWAITINGINTERRUPTED: This is no longer usedREATTEMPTING: This is no longer used, and is replaced byEXECUTING
We've also added "boolean" helpers to runs returned via the API and from Realtime:
isQueued: Returns true when the status isQUEUED,PENDING_VERSION, orDELAYEDisExecuting: Returns true when the status isEXECUTING,DEQUEUED. These count against your concurrency limits.isWaiting: Returns true when the status isWAITING. These do not count against your concurrency limits.isCompleted: Returns true when the status is any of the completed statuses.isCanceled: Returns true when the status isCANCELEDisFailed: Returns true when the status is any of the failed statuses.isSuccess: Returns true when the status isCOMPLETED
This change adds the ability to easily detect which runs are being counted against your concurrency limit by filtering for both
EXECUTINGorDEQUEUED. Add onCancel lifecycle hook
Provide realtime skipColumns option via untamperable public access tokens
Removed triggerAndPoll. It was never recommended so it's been removed.
Improve metadata flushing efficiency by collapsing operations
Upgrade to zod 3.25.76
Specify a region override when triggering a run
Added runs.list filtering for queue and machine
Maintain proper context in metadata.root and parent getters
v4: New lifecycle hooks
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.