Skip to content

Commit 67c6e1a

Browse files
authored
Merge branch 'main' into fix(webapp)-logs-button
2 parents 7691f82 + 98bf706 commit 67c6e1a

File tree

23 files changed

+169
-64
lines changed

23 files changed

+169
-64
lines changed

.changeset/fix-coderabbit-review-items.md

Lines changed: 0 additions & 6 deletions
This file was deleted.

docs/migrating-from-v3.mdx

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,20 @@ description: "What's new in v4, how to migrate, and breaking changes."
66
import NodeVersions from "/snippets/node-versions.mdx";
77
import MigrateV4UsingAi from "/snippets/migrate-v4-using-ai.mdx";
88

9+
<Warning>
10+
**Action required: Trigger.dev v3 deprecation**
11+
12+
We're retiring Trigger.dev v3. **New v3 deploys will stop working from 1 April 2026.** Trigger.dev v4 is stable, fully supported, and recommended for all users.
13+
14+
**Key dates:**
15+
16+
- **1 April 2026** — New v3 deploys will no longer work. Existing v3 runs will continue to execute.
17+
- **1 July 2026** — v3 will be fully shut down. All v3 runs will stop executing.
18+
19+
**What you need to do:** Migrate to v4 before April to avoid disruption to your task executions. The migration takes about 2 minutes — follow the steps on this page below. If you have questions or need help, [contact us](https://trigger.dev/contact) or reach out in our [Discord](https://trigger.dev/discord).
20+
21+
</Warning>
22+
923
## What's new in v4?
1024

1125
| Feature | Description |

docs/snippets/migrate-v4-using-ai.mdx

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ await myTask.trigger({ foo: "bar" });
151151
await myTask.trigger({ foo: "bar" }, { queue: "my-queue" });
152152

153153

154-
**Lifecycle hooks**: Function signatures have changed to use a single object parameter instead of separate parameters. This is the old version:
154+
**Lifecycle hooks**: Function signatures have changed to use a single object parameter instead of separate parameters. Prefer `onStartAttempt` over the deprecated `onStart` when you need code to run before each attempt. This is the old version:
155155

156156

157157
// Old v3 way
@@ -171,10 +171,10 @@ This is the new version:
171171
// New v4 way - single object parameter for hooks
172172
export const myTask = task({
173173
id: "my-task",
174-
onStart: ({ payload, ctx }) => {},
175-
onSuccess: ({ payload, output, ctx }) => {},
176-
onFailure: ({ payload, error, ctx }) => {},
177-
catchError: ({ payload, ctx, error, retry }) => {},
174+
onStartAttempt: ({ payload, ctx }) => {}, // prefer over deprecated onStart
175+
onSuccess: ({ payload, ctx, task, output }) => {},
176+
onFailure: ({ payload, ctx, task, error }) => {},
177+
catchError: ({ payload, ctx, task, error, retry, retryAt, retryDelayInMs }) => {},
178178
run: async (payload, { ctx }) => {}, // run function unchanged
179179
});
180180

@@ -204,6 +204,12 @@ const batch = await batch.retrieve(batchHandle.batchId); // Use batch.retrieve()
204204
console.log(batch.runs);
205205

206206

207+
**triggerAndWait / batchTriggerAndWait**: In v4 these return a Result object, not the raw output. Use `if (result.ok) { ... result.output }` or call `.unwrap()` to get the output (throws if the run failed). Do not wrap `triggerAndWait` or `batchTriggerAndWait` in `Promise.all` — this is not supported.
208+
209+
210+
**Context (ctx) changes**: `ctx.attempt.id` and `ctx.attempt.status` have been removed; use `ctx.attempt.number` where needed. `ctx.task.exportName` has been removed.
211+
212+
207213
Can you help me convert the following code from v3 to v4? Please include the full converted code in the answer, do not truncate it anywhere.
208214

209215
```

docs/vercel-integration.mdx

Lines changed: 45 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@ The Vercel integration connects your Vercel project to your Trigger.dev project
1010
This eliminates the need to manually run the `trigger.dev deploy` command or maintain custom CI/CD workflows for Vercel-based projects.
1111

1212
<Note>
13-
The Vercel integration requires the [GitHub integration](/github-integration) to be connected as well, since Trigger.dev builds your tasks from your GitHub repository.
13+
The Vercel integration requires the [GitHub integration](/github-integration) to be connected as
14+
well, since Trigger.dev builds your tasks from your GitHub repository.
1415
</Note>
1516

1617
## Installation
@@ -22,23 +23,27 @@ You can connect Vercel from two entry points:
2223
<Steps>
2324

2425
<Step title="Connect Vercel">
25-
Go to your project's **Settings** page and click **Connect Vercel**. This will redirect you to Vercel to authorize the Trigger.dev app.
26+
Go to your project's **Settings** page and click **Connect Vercel**. This will redirect you to
27+
Vercel to authorize the Trigger.dev app.
2628
</Step>
2729

2830
<Step title="Select a Vercel project">
2931
Choose which Vercel project to connect to your Trigger.dev project.
3032
</Step>
3133

3234
<Step title="Map environments">
33-
If your Vercel project has custom environments, choose which one maps to your Trigger.dev staging environment.
35+
If your Vercel project has custom environments, choose which one maps to your Trigger.dev staging
36+
environment.
3437
</Step>
3538

3639
<Step title="Sync environment variables">
37-
Review the environment variables that will be pulled from Vercel into Trigger.dev. You can deselect any variables you don't want to sync.
40+
Review the environment variables that will be pulled from Vercel into Trigger.dev. You can
41+
deselect any variables you don't want to sync.
3842
</Step>
3943

40-
<Step title="Configure build settings">
41-
Optionally adjust [build settings](#build-settings) for atomic deployments, env var pulling, and new env var discovery.
44+
<Step title="Configure build options">
45+
Optionally adjust [build options](#build-options) for atomic deployments, env var pulling, and new
46+
env var discovery.
4247
</Step>
4348

4449
<Step title="Connect GitHub">
@@ -52,11 +57,14 @@ You can connect Vercel from two entry points:
5257
<Steps>
5358

5459
<Step title="Install the integration">
55-
Find Trigger.dev on the Vercel Marketplace and install it. This will redirect you to Trigger.dev to complete setup.
60+
Install the [Trigger.dev integration from the Vercel
61+
Marketplace](https://vercel.com/marketplace/trigger). This will redirect you to Trigger.dev to
62+
complete setup.
5663
</Step>
5764

5865
<Step title="Select your Trigger.dev organization and project">
59-
Choose which Trigger.dev organization and project to connect. If you're new to Trigger.dev, you'll be guided through creating an organization and project.
66+
Choose which Trigger.dev organization and project to connect. If you're new to Trigger.dev, you'll
67+
be guided through creating an organization and project.
6068
</Step>
6169

6270
<Step title="Connect GitHub">
@@ -66,9 +74,21 @@ You can connect Vercel from two entry points:
6674
</Steps>
6775

6876
<Note>
69-
When installing from the Vercel Marketplace, default build settings are applied automatically. You can adjust them later in your project settings.
77+
When installing from the Vercel Marketplace, default Build options are applied automatically. You
78+
can adjust them later in your project settings.
7079
</Note>
7180

81+
<Warning>
82+
**Vercel Root Directory:** If your Vercel project uses a **Root Directory** (e.g. you deploy a
83+
single subfolder such as `app` or `web`), you may see "The specified Root Directory does not
84+
exist" after connecting the integration. If you see this error, try using the **repository root**
85+
(leave Root Directory empty) in your Vercel project settings. If your Vercel frontend build
86+
requires a Root Directory (e.g. in a monorepo), keep that setting in Vercel and instead point
87+
Trigger.dev to the subfolder by setting the **Trigger config file** path (and other [Build
88+
options](#build-options)) in your Trigger.dev project configuration. Trigger.dev always builds
89+
from the repo root.
90+
</Warning>
91+
7292
## Environment variable sync
7393

7494
The integration syncs environment variables in both directions:
@@ -78,13 +98,15 @@ The integration syncs environment variables in both directions:
7898
**Trigger.dev → Vercel**: Trigger.dev syncs API keys (like `TRIGGER_SECRET_KEY`) to your Vercel project so your app can communicate with Trigger.dev.
7999

80100
The following variables are excluded from the Vercel → Trigger.dev sync:
101+
81102
- `TRIGGER_SECRET_KEY`, `TRIGGER_VERSION`, `TRIGGER_PREVIEW_BRANCH` (managed by Trigger.dev)
82103
- Sensitive/secret-type variables (Vercel API limitation)
83104

84105
You can control sync behavior per-variable from your project's Vercel settings. Deselecting a variable prevents its value from being updated during future syncs.
85106

86107
<Tip>
87-
For dynamic environment variables (e.g., from NeonDB branching), use the `syncEnvVars` build extension instead. Learn more about [environment variables](/deploy-environment-variables).
108+
For dynamic environment variables (e.g., from NeonDB branching), use the `syncEnvVars` build
109+
extension instead. Learn more about [environment variables](/deploy-environment-variables).
88110
</Tip>
89111

90112
## Atomic deployments
@@ -94,7 +116,9 @@ Atomic deployments ensure your Vercel app and Trigger.dev tasks are deployed in
94116
Atomic deployments are enabled for the production environment by default.
95117

96118
<Note>
97-
When atomic deployments are enabled, the integration automatically disables `Auto-assign Custom Production Domains` on your Vercel project. This is required so that Vercel doesn't promote a deployment before the Trigger.dev build is ready.
119+
When atomic deployments are enabled, the integration automatically disables `Auto-assign Custom
120+
Production Domains` on your Vercel project. This is required so that Vercel doesn't promote a
121+
deployment before the Trigger.dev build is ready.
98122
</Note>
99123

100124
Previously, setting up atomic deployments with Vercel required custom GitHub Actions workflows. The Vercel integration automates this entirely. For more details on how atomic deployments work, see [Atomic deploys](/deployment/atomic-deployment).
@@ -103,27 +127,30 @@ Previously, setting up atomic deployments with Vercel required custom GitHub Act
103127

104128
The integration maps Vercel environments to Trigger.dev environments:
105129

106-
| Vercel environment | Trigger.dev environment |
107-
| --- | --- |
108-
| Production | Production |
130+
| Vercel environment | Trigger.dev environment |
131+
| ------------------ | ------------------------------ |
132+
| Production | Production |
109133
| Custom environment | Staging (you choose which one) |
110-
| Preview | Preview |
111-
| Development | Development |
134+
| Preview | Preview |
135+
| Development | Development |
112136

113137
If your Vercel project has a custom environment, you can select which one maps to your Trigger.dev staging environment during setup or in your project settings.
114138

115139
<Note>
116-
Preview deployments require the preview environment to be enabled on your project. Learn more about [preview branches](/deployment/preview-branches).
140+
Preview deployments require the preview environment to be enabled on your project. Learn more
141+
about [preview branches](/deployment/preview-branches).
117142
</Note>
118143

119-
## Build settings
144+
## Build options
120145

121146
You can configure the following settings per-environment from your project's Vercel settings:
122147

123148
- **Atomic deployments**: Controls whether Trigger.dev and Vercel deployments are synchronized. Enabled for production by default.
124149
- **Pull env vars before build**: When enabled, Trigger.dev pulls the latest environment variables from Vercel before each build. Enabled for production, staging, and preview by default.
125150
- **Discover new env vars**: When enabled, new environment variables found in Vercel that don't yet exist in Trigger.dev are created automatically during builds. Only available for environments that also have env var pulling enabled. Enabled for production, staging, and preview by default.
126151

152+
To change build options that would normally go in `trigger.config.ts` (such as [extensions](/config/config-file#extensions) or other build configuration), use **Build options** on your project's configuration page in the Trigger.dev dashboard.
153+
127154
## Disconnecting
128155

129156
You can disconnect the Vercel integration from either side:

packages/build/CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
# @trigger.dev/build
22

3+
## 4.4.1
4+
5+
### Patch Changes
6+
7+
- Updated dependencies:
8+
- `@trigger.dev/core@4.4.1`
9+
310
## 4.4.0
411

512
### Patch Changes

packages/build/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@trigger.dev/build",
3-
"version": "4.4.0",
3+
"version": "4.4.1",
44
"description": "trigger.dev build extensions",
55
"license": "MIT",
66
"publishConfig": {
@@ -78,7 +78,7 @@
7878
},
7979
"dependencies": {
8080
"@prisma/config": "^6.10.0",
81-
"@trigger.dev/core": "workspace:4.4.0",
81+
"@trigger.dev/core": "workspace:4.4.1",
8282
"mlly": "^1.7.1",
8383
"pkg-types": "^1.1.3",
8484
"resolve": "^1.22.8",

packages/cli-v3/CHANGELOG.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,15 @@
11
# trigger.dev
22

3+
## 4.4.1
4+
5+
### Patch Changes
6+
7+
- Add OTEL metrics pipeline for task workers. Workers collect process CPU/memory, Node.js runtime metrics (event loop utilization, event loop delay, heap usage), and user-defined custom metrics via `otel.metrics.getMeter()`. Metrics are exported to ClickHouse with 10-second aggregation buckets and 1m/5m rollups, and are queryable through the dashboard query engine with typed attribute columns, `prettyFormat()` for human-readable values, and AI query support. ([#3061](https://github.com/triggerdotdev/trigger.dev/pull/3061))
8+
- Updated dependencies:
9+
- `@trigger.dev/build@4.4.1`
10+
- `@trigger.dev/core@4.4.1`
11+
- `@trigger.dev/schema-to-json@4.4.1`
12+
313
## 4.4.0
414

515
### Patch Changes

packages/cli-v3/package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "trigger.dev",
3-
"version": "4.4.0",
3+
"version": "4.4.1",
44
"description": "A Command-Line Interface for Trigger.dev projects",
55
"type": "module",
66
"license": "MIT",
@@ -93,9 +93,9 @@
9393
"@opentelemetry/sdk-trace-node": "2.0.1",
9494
"@opentelemetry/semantic-conventions": "1.36.0",
9595
"@s2-dev/streamstore": "^0.17.6",
96-
"@trigger.dev/build": "workspace:4.4.0",
97-
"@trigger.dev/core": "workspace:4.4.0",
98-
"@trigger.dev/schema-to-json": "workspace:4.4.0",
96+
"@trigger.dev/build": "workspace:4.4.1",
97+
"@trigger.dev/core": "workspace:4.4.1",
98+
"@trigger.dev/schema-to-json": "workspace:4.4.1",
9999
"ansi-escapes": "^7.0.0",
100100
"braces": "^3.0.3",
101101
"c12": "^1.11.1",

packages/core/CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# internal-platform
22

3+
## 4.4.1
4+
35
## 4.4.0
46

57
### Patch Changes

packages/core/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@trigger.dev/core",
3-
"version": "4.4.0",
3+
"version": "4.4.1",
44
"description": "Core code used across the Trigger.dev SDK and platform",
55
"license": "MIT",
66
"publishConfig": {

0 commit comments

Comments
 (0)