Skip to content

Commit 525145d

Browse files
authored
docs: v3 deprecation notice and Migrate using AI updates on migrating-from-v3 (#3098)
Adds a deprecation warning at the top of the migrating-from-v3 page and updates the “Migrate using AI” prompt and intro
1 parent 23c327e commit 525145d

File tree

2 files changed

+25
-5
lines changed

2 files changed

+25
-5
lines changed

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
```

0 commit comments

Comments
 (0)