Skip to content

Commit fade220

Browse files
samejrmatt-aitkenD-K-P
authored
Docs – v4 GA updates (#2298)
* Adds new features table to top of v4 upgrade guide * Adds wait idempotency to wait-until, wait-for, and wait-for-token pages * Adds new priority docs page and updates the v4 upgrade guide * Adds new task lifecycle hooks * Removes the message about requiring tasks to be exported * Adds new global lifecycle hooks section * Moves sections from upgrade guide into the table * Adds hidden task page * Improves the global lifecycle hooks section * Updates middleware and locals section * Adds new useWaitToken page to the react hooks section * Adds a new ai.tool section * Moves Docker (legacy) page into self-hosting section * Removes known issues from v4 upgrade guide * Replace “toolTask” with “ai.tool” in the Streams page example * Renames guide to “Migrating from v3” and adds redirect * Remove references to v4 * Removes changelog from migration guide * The installation guide now references `@latest update` * Changes all references from `/sdk/v3` to `/sdk` * Updates @v4-beta to @latest * Fixed broken link * Fixes broken link * Adds an upgrade to v4 using AI section * Fixes 2 broken links * Adds an entry for targetting preview branches * Updates the run statuses * Adds boolean helpers section to the runs and realtime pages * Updates the concurrency page * Updates the test page to include the new options * Adds SDK and curl options for the preview branch targeting * Updates new bulk actions page * Remove the releasing concurrency section * Got rid of some more @v4-beta mentions * Improved rate limit docs * Improved migrating docs * Removed commented sections of the docs * useWaitToken hook * Fixed the description * Fix for missing test image --------- Co-authored-by: Matt Aitken <[email protected]> Co-authored-by: Dan <[email protected]>
1 parent 78af477 commit fade220

File tree

127 files changed

+1668
-606
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

127 files changed

+1668
-606
lines changed

docs/apikeys.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ The default URL is `https://api.trigger.dev`.
3939
If you prefer to manually configure the SDK, you can call the `configure` method:
4040

4141
```ts
42-
import { configure } from "@trigger.dev/sdk/v3";
42+
import { configure } from "@trigger.dev/sdk";
4343
import { myTask } from "./trigger/myTasks";
4444

4545
configure({

docs/bulk-actions.mdx

Lines changed: 25 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,10 @@ title: "Bulk actions"
33
description: "Perform actions like replay and cancel on multiple runs at once."
44
---
55

6-
Bulk actions allow you to perform operations like replaying or canceling on multiple runs at once. This is especially useful when you need to retry a batch of failed runs with a new version of your code, or when you need to cancel multiple in-progress runs.
7-
8-
## Bulk replaying
9-
10-
You can replay multiple runs at once by selecting them from the table on the Runs page using the checkbox on the left hand side of the row. Then click the "Replay runs" button from the bulk action bar that appears at the bottom of the screen.
11-
12-
This is especially useful if you have lots of failed runs and want to run them all again. To do this, first filter the runs by the status you want, then select all the runs you want to replay and click the "Replay runs" button from the bulk action bar at the bottom of the page.
6+
Bulk actions allow you to perform replaying and canceling on multiple runs at once. This is especially useful when you need to retry a batch of failed runs with a new version of your code, or when you need to cancel multiple in-progress runs.
137

148
<video
15-
src="https://content.trigger.dev/bulk-replaying-runs.mp4"
9+
src="https://content.trigger.dev/bulk-actions.mp4"
1610
preload="auto"
1711
controls={true}
1812
loop
@@ -22,19 +16,34 @@ This is especially useful if you have lots of failed runs and want to run them a
2216
height="100%"
2317
/>
2418

25-
## Bulk canceling
19+
## How to create a new bulk action
20+
21+
<Icon icon="circle-1" iconType="solid" color="#FF2D6B" size="20" /> Open the bulk action panel from the top right of the runs page
22+
23+
![Access bulk actions](/images/bulk-action-open-panel.png)
24+
25+
26+
<Icon icon="circle-2" iconType="solid" color="#FF2D6B" size="20" /> Filter the runs table to show the runs you want to bulk action
27+
28+
<Icon icon="circle-3" iconType="solid" color="#FF2D6B" size="20" /> Alternatively, you can select individual runs
29+
30+
<Icon icon="circle-4" iconType="solid" color="#FF2D6B" size="20" /> Choose the runs you want to bulk action
31+
32+
<Icon icon="circle-5" iconType="solid" color="#FF2D6B" size="20" /> Name your bulk action (optional)
33+
34+
<Icon icon="circle-6" iconType="solid" color="#FF2D6B" size="20" /> Choose the action you want to perform, replay or cancel
35+
36+
<Icon icon="circle-7" iconType="solid" color="#FF2D6B" size="20" /> Click the "Replay" or "Cancel" button and confirm in the dialog
2637

27-
Similar to replaying multiple runs, you can cancel multiple runs at once. This is particularly useful when you have a batch of runs that you want to stop, perhaps because they were triggered with incorrect parameters or are no longer needed.
38+
![Access bulk actions](/images/bulk-action-create.png)
2839

29-
To cancel multiple runs:
40+
<Icon icon="circle-8" iconType="solid" color="#FF2D6B" size="20" /> You'll now view the bulk action processing from the bulk action page
3041

31-
1. Filter the runs table to show the runs you want to cancel (e.g., all runs with status "QUEUED" or "EXECUTING")
32-
2. Use the checkboxes on the left side of the runs table to select the runs you want to cancel
33-
3. Click the "Cancel runs" button in the bulk action bar that appears at the bottom of the screen
42+
<Icon icon="circle-9" iconType="solid" color="#FF2D6B" size="20" /> You can replay or view the runs from this page
3443

35-
After confirming, all selected runs that can be canceled (those in appropriate states like QUEUED or EXECUTING) will be canceled. The status of these runs will change to "CANCELED" and they will not be resumed.
44+
![Access bulk actions](/images/bulk-action-page.png)
3645

3746
<Note>
3847
You can only cancel runs that are in states that allow cancellation (like QUEUED or EXECUTING).
39-
Runs that are already completed, failed, or in other final states cannot be canceled.
48+
Runs that are already completed, failed, or in other final states by the time the bulk action process gets to them, cannot be canceled.
4049
</Note>

docs/cli-preview-archive.mdx

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,8 @@
22
title: "CLI preview archive command"
33
sidebarTitle: "preview archive"
44
description: "The `trigger.dev preview archive` command can be used to archive a preview branch."
5-
tag: "v4"
65
---
76

8-
import UpgradeToV4Note from "/snippets/upgrade-to-v4-note.mdx";
97
import ProjectPathArg from "/snippets/cli-args-project-path.mdx";
108
import CommonOptions from "/snippets/cli-options-common.mdx";
119
import ProjectRefOption from "/snippets/cli-options-project-ref.mdx";
@@ -14,22 +12,20 @@ import ConfigFileOption from "/snippets/cli-options-config-file.mdx";
1412
import SkipUpdateCheckOption from "/snippets/cli-options-skip-update-check.mdx";
1513
import BranchOption from "/snippets/cli-options-branch.mdx";
1614

17-
<UpgradeToV4Note />
18-
1915
Run the command like this:
2016

2117
<CodeGroup>
2218

2319
```bash npm
24-
npx trigger.dev@v4-beta preview archive
20+
npx trigger.dev@latest preview archive
2521
```
2622

2723
```bash pnpm
28-
pnpm dlx trigger.dev@v4-beta preview archive
24+
pnpm dlx trigger.dev@latest preview archive
2925
```
3026

3127
```bash yarn
32-
yarn dlx trigger.dev@v4-beta preview archive
28+
yarn dlx trigger.dev@latest preview archive
3329
```
3430

3531
</CodeGroup>
@@ -39,7 +35,7 @@ It will archive the preview branch, automatically detecting the branch name from
3935
## Arguments
4036

4137
```
42-
npx trigger.dev@v4-beta preview archive [path]
38+
npx trigger.dev@latest preview archive [path]
4339
```
4440

4541
<ProjectPathArg />

docs/cli-switch.mdx

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,8 @@
22
title: "CLI switch command"
33
sidebarTitle: "switch"
44
description: "The `trigger.dev switch` command can be used to switch between profiles."
5-
tag: "v4"
65
---
76

8-
import UpgradeToV4Note from "/snippets/upgrade-to-v4-note.mdx";
97
import ProjectPathArg from "/snippets/cli-args-project-path.mdx";
108
import CommonOptions from "/snippets/cli-options-common.mdx";
119
import ProjectRefOption from "/snippets/cli-options-project-ref.mdx";
@@ -14,22 +12,20 @@ import ConfigFileOption from "/snippets/cli-options-config-file.mdx";
1412
import SkipUpdateCheckOption from "/snippets/cli-options-skip-update-check.mdx";
1513
import BranchOption from "/snippets/cli-options-branch.mdx";
1614

17-
<UpgradeToV4Note />
18-
1915
Run the command like this:
2016

2117
<CodeGroup>
2218

2319
```bash npm
24-
npx trigger.dev@v4-beta switch [profile]
20+
npx trigger.dev@latest switch [profile]
2521
```
2622

2723
```bash pnpm
28-
pnpm dlx trigger.dev@v4-beta switch [profile]
24+
pnpm dlx trigger.dev@latest switch [profile]
2925
```
3026

3127
```bash yarn
32-
yarn dlx trigger.dev@v4-beta switch [profile]
28+
yarn dlx trigger.dev@latest switch [profile]
3329
```
3430

3531
</CodeGroup>
@@ -39,7 +35,7 @@ It will switch to the specified profile. If no profile is specified, it will lis
3935
## Arguments
4036

4137
```
42-
npx trigger.dev@v4-beta switch [profile]
38+
npx trigger.dev@latest switch [profile]
4339
```
4440

4541
<ParamField body="Profile" type="[profile]">

docs/config/config-file.mdx

Lines changed: 16 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import NodeVersions from "/snippets/node-versions.mdx";
1111
The `trigger.config.ts` file is used to configure your Trigger.dev project. It is a TypeScript file at the root of your project that exports a default configuration object. Here's an example:
1212

1313
```ts trigger.config.ts
14-
import { defineConfig } from "@trigger.dev/sdk/v3";
14+
import { defineConfig } from "@trigger.dev/sdk";
1515

1616
export default defineConfig({
1717
// Your project ref (you can see it on the Project settings page in the dashboard)
@@ -53,7 +53,7 @@ The config file handles a lot of things, like:
5353
You can specify the directories where your tasks are located using the `dirs` option:
5454

5555
```ts trigger.config.ts
56-
import { defineConfig } from "@trigger.dev/sdk/v3";
56+
import { defineConfig } from "@trigger.dev/sdk";
5757

5858
export default defineConfig({
5959
project: "<project ref>",
@@ -66,7 +66,7 @@ If you omit the `dirs` option, we will automatically detect directories that are
6666
We will search for TypeScript and JavaScript files in the specified directories and include them in the build process. We automatically exclude files that have `.test` or `.spec` in the name, but you can customize this by specifying glob patterns in the `ignorePatterns` option:
6767

6868
```ts trigger.config.ts
69-
import { defineConfig } from "@trigger.dev/sdk/v3";
69+
import { defineConfig } from "@trigger.dev/sdk";
7070

7171
export default defineConfig({
7272
project: "<project ref>",
@@ -80,7 +80,7 @@ export default defineConfig({
8080
You can add lifecycle functions to get notified when any task starts, succeeds, or fails using `onStart`, `onSuccess` and `onFailure`:
8181

8282
```ts trigger.config.ts
83-
import { defineConfig } from "@trigger.dev/sdk/v3";
83+
import { defineConfig } from "@trigger.dev/sdk";
8484

8585
export default defineConfig({
8686
project: "<project ref>",
@@ -111,7 +111,7 @@ We use OpenTelemetry (OTEL) for our run logs. This means you get a lot of inform
111111
Here we add Prisma and OpenAI instrumentations to your `trigger.config.ts` file.
112112

113113
```ts trigger.config.ts
114-
import { defineConfig } from "@trigger.dev/sdk/v3";
114+
import { defineConfig } from "@trigger.dev/sdk";
115115
import { PrismaInstrumentation } from "@prisma/instrumentation";
116116
import { OpenAIInstrumentation } from "@traceloop/instrumentation-openai";
117117

@@ -152,7 +152,7 @@ You can also configure custom telemetry exporters to send your traces and logs t
152152
Then, configure the exporters in your `trigger.config.ts` file:
153153

154154
```ts trigger.config.ts
155-
import { defineConfig } from "@trigger.dev/sdk/v3";
155+
import { defineConfig } from "@trigger.dev/sdk";
156156
import { OTLPTraceExporter } from "@opentelemetry/exporter-trace-otlp-http";
157157
import { OTLPLogExporter } from "@opentelemetry/exporter-logs-otlp-http";
158158

@@ -188,15 +188,10 @@ export default defineConfig({
188188

189189
Make sure to set the `AXIOM_API_TOKEN` and `AXIOM_DATASET` environment variables in your project.
190190

191-
<Note>
192-
The `logExporters` option is available in the v4 beta SDK. See our [v4 upgrade
193-
guide](/upgrade-to-v4) for more information.
194-
</Note>
195-
196191
It's important to note that you cannot configure exporters using `OTEL_*` environment variables, as they would conflict with our internal telemetry. Instead you should configure the exporters via passing in arguments to the `OTLPTraceExporter` and `OTLPLogExporter` constructors. For example, here is how you can configure exporting to Honeycomb:
197192

198193
```ts trigger.config.ts
199-
import { defineConfig } from "@trigger.dev/sdk/v3";
194+
import { defineConfig } from "@trigger.dev/sdk";
200195
import { OTLPTraceExporter } from "@opentelemetry/exporter-trace-otlp-http";
201196
import { OTLPLogExporter } from "@opentelemetry/exporter-logs-otlp-http";
202197

@@ -235,7 +230,7 @@ export default defineConfig({
235230
We currently only officially support the `node` runtime, but you can try our experimental `bun` runtime by setting the `runtime` option in your config file:
236231

237232
```ts trigger.config.ts
238-
import { defineConfig } from "@trigger.dev/sdk/v3";
233+
import { defineConfig } from "@trigger.dev/sdk";
239234

240235
export default defineConfig({
241236
project: "<project ref>",
@@ -255,7 +250,7 @@ See our [Bun guide](/guides/frameworks/bun) for more information.
255250
You can specify the default machine for all tasks in your project:
256251

257252
```ts trigger.config.ts
258-
import { defineConfig } from "@trigger.dev/sdk/v3";
253+
import { defineConfig } from "@trigger.dev/sdk";
259254

260255
export default defineConfig({
261256
project: "<project ref>",
@@ -271,7 +266,7 @@ See our [machines documentation](/machines) for more information.
271266
You can set the log level for your project:
272267

273268
```ts trigger.config.ts
274-
import { defineConfig } from "@trigger.dev/sdk/v3";
269+
import { defineConfig } from "@trigger.dev/sdk";
275270

276271
export default defineConfig({
277272
project: "<project ref>",
@@ -287,7 +282,7 @@ The `logLevel` only determines which logs are sent to the Trigger.dev instance w
287282
You can set the default `maxDuration` for all tasks in your project:
288283

289284
```ts trigger.config.ts
290-
import { defineConfig } from "@trigger.dev/sdk/v3";
285+
import { defineConfig } from "@trigger.dev/sdk";
291286

292287
export default defineConfig({
293288
project: "<project ref>",
@@ -303,7 +298,7 @@ See our [maxDuration guide](/runs/max-duration) for more information.
303298
You can customize the build process using the `build` option:
304299

305300
```ts trigger.config.ts
306-
import { defineConfig } from "@trigger.dev/sdk/v3";
301+
import { defineConfig } from "@trigger.dev/sdk";
307302

308303
export default defineConfig({
309304
project: "<project ref>",
@@ -326,7 +321,7 @@ export default defineConfig({
326321
All code is bundled by default, but you can exclude some packages from the bundle using the `external` option:
327322

328323
```ts trigger.config.ts
329-
import { defineConfig } from "@trigger.dev/sdk/v3";
324+
import { defineConfig } from "@trigger.dev/sdk";
330325

331326
export default defineConfig({
332327
project: "<project ref>",
@@ -342,7 +337,7 @@ When a package is excluded from the bundle, it will be added to a dynamically ge
342337
Each entry in the external should be a package name, not necessarily the import path. For example, if you want to exclude the `ai` package, but you are importing `ai/rsc`, you should just include `ai` in the `external` array:
343338

344339
```ts trigger.config.ts
345-
import { defineConfig } from "@trigger.dev/sdk/v3";
340+
import { defineConfig } from "@trigger.dev/sdk";
346341

347342
export default defineConfig({
348343
project: "<project ref>",
@@ -363,7 +358,7 @@ export default defineConfig({
363358
You can customize the `jsx` options that are passed to `esbuild` using the `jsx` option:
364359

365360
```ts trigger.config.ts
366-
import { defineConfig } from "@trigger.dev/sdk/v3";
361+
import { defineConfig } from "@trigger.dev/sdk";
367362

368363
export default defineConfig({
369364
project: "<project ref>",
@@ -390,7 +385,7 @@ See the [esbuild JSX documentation](https://esbuild.github.io/content-types/#jsx
390385
You can add custom [import conditions](https://esbuild.github.io/api/#conditions) to your build using the `conditions` option:
391386

392387
```ts trigger.config.ts
393-
import { defineConfig } from "@trigger.dev/sdk/v3";
388+
import { defineConfig } from "@trigger.dev/sdk";
394389

395390
export default defineConfig({
396391
project: "<project ref>",

docs/config/extensions/additionalFiles.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ description: "Use the additionalFiles build extension to copy additional files t
77
Import the `additionalFiles` build extension and use it in your `trigger.config.ts` file:
88

99
```ts
10-
import { defineConfig } from "@trigger.dev/sdk/v3";
10+
import { defineConfig } from "@trigger.dev/sdk";
1111
import { additionalFiles } from "@trigger.dev/build/extensions/core";
1212

1313
export default defineConfig({

docs/config/extensions/additionalPackages.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ description: "Use the additionalPackages build extension to include additional p
77
Import the `additionalPackages` build extension and use it in your `trigger.config.ts` file:
88

99
```ts
10-
import { defineConfig } from "@trigger.dev/sdk/v3";
10+
import { defineConfig } from "@trigger.dev/sdk";
1111
import { additionalPackages } from "@trigger.dev/build/extensions/core";
1212

1313
export default defineConfig({
@@ -22,7 +22,7 @@ export default defineConfig({
2222
This allows you to include additional packages in the build that are not automatically included via imports. This is useful if you want to install a package that includes a CLI tool that you want to invoke in your tasks via `exec`. We will try to automatically resolve the version of the package but you can specify the version by using the `@` symbol:
2323

2424
```ts
25-
import { defineConfig } from "@trigger.dev/sdk/v3";
25+
import { defineConfig } from "@trigger.dev/sdk";
2626

2727
export default defineConfig({
2828
project: "<project ref>",

docs/config/extensions/aptGet.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ description: "Use the aptGet build extension to install system packages into the
77
You can install system packages into the deployed image using the `aptGet` extension:
88

99
```ts
10-
import { defineConfig } from "@trigger.dev/sdk/v3";
10+
import { defineConfig } from "@trigger.dev/sdk";
1111
import { aptGet } from "@trigger.dev/build/extensions/core";
1212

1313
export default defineConfig({
@@ -22,7 +22,7 @@ export default defineConfig({
2222
If you want to install a specific version of a package, you can specify the version like this:
2323

2424
```ts
25-
import { defineConfig } from "@trigger.dev/sdk/v3";
25+
import { defineConfig } from "@trigger.dev/sdk";
2626

2727
export default defineConfig({
2828
project: "<project ref>",

docs/config/extensions/audioWaveform.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ description: "Use the audioWaveform build extension to add support for Audio Wav
77
Previously, we installed [Audio Waveform](https://github.com/bbc/audiowaveform) in the build image. That's been moved to a build extension:
88

99
```ts
10-
import { defineConfig } from "@trigger.dev/sdk/v3";
10+
import { defineConfig } from "@trigger.dev/sdk";
1111
import { audioWaveform } from "@trigger.dev/build/extensions/audioWaveform";
1212

1313
export default defineConfig({

0 commit comments

Comments
 (0)