Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/ai-chat/reference.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ description: "Complete API reference for the AI Agents SDK — backend options,
| Dependency | Supported | Notes |
|---|---|---|
| `@trigger.dev/sdk` | `>=4.5.0` | The chat agent surface lives in this SDK release. Install with `@trigger.dev/sdk@latest`. |
| `ai` (Vercel AI SDK) | `^5.0.0 \|\| ^6.0.0 \|\| >=7.0.0-canary <8` | Declared as a peer. v6 is what we develop against day to day; v5 and v7 work too (v7 is in canary/beta upstream). Your installed `ai` major drives the chat surface's types. |
| `ai` (Vercel AI SDK) | `^5.0.0 \|\| ^6.0.0 \|\| >=7.0.0-canary <8` | Declared as a peer. v6 is what we develop against day to day; v5 and v7 work too. Your installed `ai` major drives the chat surface's types. |
| `@ai-sdk/otel` | `1.x` (v7 only) | Optional. AI SDK 7 moved model-call span emission out of `ai` core into this adapter. Install it alongside `ai@7` and the SDK auto-registers it, so your model calls show up as spans in the run trace. Not needed on v5/v6, where `ai` core emits spans. See [AI SDK 7 telemetry](#ai-sdk-7-telemetry) below. |
| `@ai-sdk/react` | matches your `ai` major | Pulled in by `useChat`. The transport works with whichever React hook ships in the same major as your `ai` version. |
| `react` | `^18.0 \|\| ^19.0` | Required only if you use `@trigger.dev/sdk/chat/react` (the frontend transport). Server-only consumers can skip React entirely. |
Expand Down
2 changes: 1 addition & 1 deletion docs/cli-init-commands.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ yarn dlx trigger.dev@latest init
</ParamField>

<ParamField body="Runtime" type="-r, --runtime <runtime>">
The runtime to use: `node`, `node-22`, `node-24`, `node-26` or `bun`. Defaults to `node-24`.
The runtime to use: `node`, `node-22`, `node-24`, `node-26`, `bun-1.4` or `bun` (deprecated). Defaults to `node-24`.
</ParamField>

<ParamField body="Yes" type="-y, --yes">
Expand Down
12 changes: 6 additions & 6 deletions docs/config/extensions/prismaExtension.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ Use this decision tree to determine which mode is right for your project:

```mermaid
flowchart TD
Start([Which mode should I use?]) --> Q1{Using Prisma 7 or<br/>6.20+ beta?}
Start([Which mode should I use?]) --> Q1{Using Prisma 7?}
Q1 -->|Yes| Modern[Modern Mode]
Q1 -->|No| Q2{Using Prisma 6.16+<br/>with engineType='client'?}
Q2 -->|Yes| Modern
Expand Down Expand Up @@ -210,7 +210,7 @@ prismaExtension({
- Designed for the new Prisma architecture
- Zero configuration required
- Automatically marks `@prisma/client` as external
- Works with Prisma 7 beta releases & Prisma 7 when released
- Works with Prisma 7
- You manage client generation (like engine-only mode)

**Schema configuration (Prisma 6.16+ with engineType):**
Expand Down Expand Up @@ -272,7 +272,7 @@ export default defineConfig({
**Important notes:**

- You **must** run `prisma generate` yourself.
- Requires Prisma 6.16.0+ or Prisma 7 beta
- Requires Prisma 6.16.0+ or Prisma 7
- The new `prisma-client` provider generates plain TypeScript (no Rust binaries)
- Requires database adapters (e.g., `@prisma/adapter-pg` for PostgreSQL)

Expand Down Expand Up @@ -331,7 +331,7 @@ steps:
- name: Generate Prisma client
run: npx prisma@6.19.0 generate
- name: Deploy Trigger.dev
run: npx trigger.dev@4.1.1 deploy --env prod
run: npx trigger.dev@latest deploy --env prod

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor · Functional Correctness · Quick win

Supported by static analysis

Script executed:

sed -n '320,345p' docs/config/extensions/prismaExtension.mdx
rg -n 'trigger.dev@' docs --glob '*.mdx' | head -50
rg -n -i 'mismatch|version pinning|pin' docs/github-actions.mdx docs/upgrading-packages.mdx docs/cli-deploy-commands.mdx | head -30

Repository: triggerdotdev/trigger.dev

Length of output: 6845


Pin the deploy CLI to the project's SDK version in this CI example.

@latest installs whatever CLI version is newest at run time. When the project's @trigger.dev/sdk lags behind, the deploy step fails. The GitHub Actions guide documents this failure in its CLI version pinning section. Use the CLI version that matches the project's SDK, as the upgrade guide does.

Suggested fix

--- "a/docs/config/extensions/prismaExtension.mdx"
+++ "b/docs/config/extensions/prismaExtension.mdx"
@@ -331,7 +331,7 @@
   - name: Generate Prisma client
     run: npx prisma@6.19.0 generate
   - name: Deploy Trigger.dev
-    run: npx trigger.dev@latest deploy --env prod
+    run: npx trigger.dev@4.8.5 deploy --env prod
     env:
       TRIGGER_ACCESS_TOKEN: ${{ secrets.TRIGGER_ACCESS_TOKEN }}
 ```
Committable suggestion

IMPORTANT
Review the replacement and indentation, then test before committing.

Suggested change
run: npx trigger.dev@latest deploy --env prod
run: npx trigger.dev@4.8.5 deploy --env prod

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Leaving this as @latest: every other CI deploy example in the docs (GitHub Actions, preview branches) uses @latest, and the GitHub Actions page's pinning section covers matching the SDK version. Changing it here alone would make this one example inconsistent.

🤖 Addressed by Claude Code

env:
TRIGGER_ACCESS_TOKEN: ${{ secrets.TRIGGER_ACCESS_TOKEN }}
```
Expand All @@ -352,7 +352,7 @@ If you are using the [Trigger.dev Github integration](/github-integration), you
| 5.0 - 6.15 | Legacy | Standard Prisma setup |
| 6.7+ | Legacy | Multi-file schema support |
| 6.16+ | Engine-only or Modern | Modern mode requires `engineType = "client"` |
| 6.20+ (7.0 beta) | Modern | Prisma 7 with new architecture |
| 7.0+ | Modern | Prisma 7 with new architecture |

---

Expand Down Expand Up @@ -1008,6 +1008,6 @@ export const db = new PrismaClient({ adapter });
- [Prisma Documentation](https://www.prisma.io/docs)
- [Multi-File Schema (Prisma 6.7+)](https://www.prisma.io/docs/orm/prisma-schema/overview/location#multi-file-prisma-schema)
- [TypedSQL (Prisma 5.19+)](https://www.prisma.io/docs/orm/prisma-client/using-raw-sql/typedsql)
- [Prisma 7 Beta Documentation](https://www.prisma.io/docs)
- [Prisma 7 Documentation](https://www.prisma.io/docs)

---
4 changes: 2 additions & 2 deletions docs/deployment/preview-branches.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -115,10 +115,10 @@ jobs:
steps:
- uses: actions/checkout@v4

- name: Use Node.js 20.x
- name: Use Node.js 24.x
uses: actions/setup-node@v4
with:
node-version: "20.x"
node-version: "24.x"

- name: Install dependencies
run: npm install
Expand Down
18 changes: 9 additions & 9 deletions docs/github-actions.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,10 @@ jobs:
steps:
- uses: actions/checkout@v4

- name: Use Node.js 20.x
- name: Use Node.js 24.x
uses: actions/setup-node@v4
with:
node-version: "20.x"
node-version: "24.x"

- name: Install dependencies
run: npm install
Expand All @@ -64,10 +64,10 @@ jobs:
steps:
- uses: actions/checkout@v4

- name: Use Node.js 20.x
- name: Use Node.js 24.x
uses: actions/setup-node@v4
with:
node-version: "20.x"
node-version: "24.x"

- name: Install dependencies
run: npm install
Expand Down Expand Up @@ -124,10 +124,10 @@ jobs:
steps:
- uses: actions/checkout@v4

- name: Use Node.js 20.x
- name: Use Node.js 24.x
uses: actions/setup-node@v4
with:
node-version: "20.x"
node-version: "24.x"

- name: Install dependencies
run: npm install
Expand Down Expand Up @@ -188,7 +188,7 @@ Tip: add the `trigger.dev` CLI to your `devDependencies` and the deploy command
"deploy:trigger": "trigger deploy --env staging"
},
"devDependencies": {
"trigger.dev": "4.7.0"
"trigger.dev": "4.8.5"
}
}
```
Expand Down Expand Up @@ -230,10 +230,10 @@ jobs:
steps:
- uses: actions/checkout@v4

- name: Use Node.js 20.x
- name: Use Node.js 24.x
uses: actions/setup-node@v4
with:
node-version: "20.x"
node-version: "24.x"

- name: Install dependencies
run: npm install
Expand Down
9 changes: 6 additions & 3 deletions docs/how-it-works.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ All these commands work with the Trigger.dev cloud and/or your self-hosted insta

```sh
npx trigger.dev@latest login --profile <profile> -a https://trigger.example.com # Log in to a specific profile into a self-hosted instance
npx trigger.dev@latest dev --profile <profile> # Initialize Trigger.dev in your project
npx trigger.dev@latest dev --profile <profile> # Run your tasks locally
npx trigger.dev@latest deploy --profile <profile> # Deploy your tasks to the Trigger.dev instance
```

Expand Down Expand Up @@ -408,7 +408,7 @@ When you run `npx trigger.dev@latest deploy` or `npx trigger.dev@latest dev`, we

- **Bundled by default**: Code + dependencies are bundled and tree-shaked by default.
- **Build extensions**: Use and write custom build extensions to transform your code or the resulting docker image.
- **ESM ouput**: We output to ESM, which allows tree-shaking and better performance.
- **ESM output**: We output to ESM, which allows tree-shaking and better performance.

You can review the build output by running deploy with the `--dry-run` flag, which will output the Containerfile and the build output.

Expand Down Expand Up @@ -451,6 +451,9 @@ import { AwsInstrumentation } from "@opentelemetry/instrumentation-aws-sdk";

export default defineConfig({
project: "<your-project-ref>",
instrumentations: [new PrismaInstrumentation(), new AwsInstrumentation()],
maxDuration: 3600,
telemetry: {
instrumentations: [new PrismaInstrumentation(), new AwsInstrumentation()],
},
});
```
6 changes: 3 additions & 3 deletions docs/limits.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -107,10 +107,10 @@ Additional bundles above the Pro tier are available for $10/month per preview br
| Pricing tier | Limit |
| :----------- | :-------------------------- |
| Free | 10 concurrent connections |
| Hobby | 50 concurrent connections |
| Pro | 500+ concurrent connections |
| Hobby | 150 concurrent connections |
| Pro | 1,000+ concurrent connections |

Additional bundles are available for $10/month per 100 concurrent connections. Contact us via [email](https://trigger.dev/contact) or [Discord](https://trigger.dev/discord) to request more.
Additional bundles are available for $10/month per 1,000 concurrent connections. Contact us via [email](https://trigger.dev/contact) or [Discord](https://trigger.dev/discord) to request more.

## Task payloads and outputs

Expand Down
2 changes: 1 addition & 1 deletion docs/management/overview.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ yarn add @trigger.dev/sdk@latest

## Usage

All `v3` functionality is provided through the `@trigger.dev/sdk` module. You can import the entire module or individual resources as needed.
All functionality is provided through the `@trigger.dev/sdk` module. You can import the entire module or individual resources as needed.

```ts
import { configure, runs } from "@trigger.dev/sdk";
Expand Down
14 changes: 8 additions & 6 deletions docs/manual-setup.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ export default defineConfig({

// Retry configuration
retries: {
enabledInDev: false, // Enable retries in development
enabledInDev: true, // Enable retries in development
default: {
maxAttempts: 3,
minTimeoutInMs: 1000,
Expand Down Expand Up @@ -175,7 +175,8 @@ import { defineConfig } from "@trigger.dev/sdk";

export default defineConfig({
project: "<your-project-ref>",
runtime: "bun",
maxDuration: 3600,
runtime: "bun-1.4",
dirs: ["./src/trigger"],
});
```
Expand Down Expand Up @@ -258,10 +259,10 @@ bun add @trigger.dev/react-hooks@latest
```typescript
import { auth } from "@trigger.dev/sdk";

// In your backend API
export async function getPublicAccessToken() {
// In your backend API, after checking the user can access this run
export async function getPublicAccessToken(runId: string) {
const publicAccessToken = await auth.createPublicToken({
scopes: ["read:runs"], // Customize based on needs
scopes: { read: { runs: [runId] } }, // Only this run
});

return publicAccessToken;
Expand Down Expand Up @@ -290,7 +291,7 @@ export function TaskStatus({
return (
<div>
<p>Status: {run.status}</p>
<p>Progress: {run.completedAt ? "Complete" : "Running..."}</p>
<p>Progress: {run.isCompleted ? "Complete" : "Running..."}</p>
</div>
);
}
Expand All @@ -310,6 +311,7 @@ import { prismaExtension } from "@trigger.dev/build/extensions/prisma";

export default defineConfig({
project: "<project-ref>",
maxDuration: 3600,
build: {
extensions: [
prismaExtension({
Expand Down
18 changes: 11 additions & 7 deletions docs/migrating-from-v3.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ Trigger.dev v3 is end of life. v4 is stable, fully supported, and recommended fo
| [onComplete](/tasks/overview#oncomplete-function) | Run code when a run completes, regardless of whether it succeeded or failed. |
| [onCancel](/tasks/overview#oncancel-function) | Run code when a run is cancelled. |
| [Hidden tasks](/hidden-tasks) | Create tasks that are not exported from your trigger files but can still be executed. |
| [Middleware & locals](#middleware-and-locals) | The middleware system runs at the top level, executing before and after all lifecycle hooks. The locals API allows sharing data between middleware and hooks. |
| [Middleware & locals](/tasks/overview#middleware-and-locals-functions) | The middleware system runs at the top level, executing before and after all lifecycle hooks. The locals API allows sharing data between middleware and hooks. |
| [useWaitToken](/realtime/react-hooks/use-wait-token) | Use the useWaitToken hook to complete a wait token from a React component. |
| [Task-backed AI tools](/tasks/schemaTask#task-backed-ai-tools) | Use `schemaTask` with AI SDK `tool()` and `ai.toolExecute()` (legacy `ai.tool` is deprecated). |

Expand Down Expand Up @@ -260,20 +260,24 @@ import { task } from "@trigger.dev/sdk";

export const myTask = task({
id: "my-task",
onStart: ({ payload, ctx }) => {},
onStartAttempt: ({ payload, ctx }) => {},
Comment thread
jackbridger marked this conversation as resolved.
Resolved
Comment thread
coderabbitai[bot] marked this conversation as resolved.
Resolved
// The run function still uses separate parameters
run: async (payload, { ctx }) => {},
});
```

<Note>
`onStart` is deprecated in favor of `onStartAttempt`. `onStart` ran once per run, but `onStartAttempt` runs before every attempt, including retries. If your hook has side effects that should only happen once, check `ctx.attempt.number === 1` inside it.
</Note>

This is true for all the lifecycle hooks:

```ts
import { task } from "@trigger.dev/sdk";

export const myTask = task({
id: "my-task",
onStart: ({ payload, ctx, task }) => {},
onStartAttempt: ({ payload, ctx, task }) => {},
onSuccess: ({ payload, ctx, task, output }) => {},
onFailure: ({ payload, ctx, task, error }) => {},
onWait: ({ payload, ctx, task, wait }) => {},
Expand Down Expand Up @@ -326,7 +330,7 @@ We are now using newer versions of the OpenTelemetry packages. This means that i

| Package | Previous Version | New Version | Change Type |
| ----------------------------------------- | ---------------- | ----------- | ------------ |
| `@opentelemetry/api-logs` | 0.52.1 | 0.203.0 | Major update |
| `@opentelemetry/exporter-logs-otlp-http` | 0.52.1 | 0.203.0 | Major update |
| `@opentelemetry/exporter-trace-otlp-http` | 0.52.1 | 0.203.0 | Major update |
| `@opentelemetry/instrumentation` | 0.52.1 | 0.203.0 | Major update |
| `@opentelemetry/api-logs` | 0.52.1 | 0.219.0 | Major update |
| `@opentelemetry/exporter-logs-otlp-http` | 0.52.1 | 0.219.0 | Major update |
| `@opentelemetry/exporter-trace-otlp-http` | 0.52.1 | 0.219.0 | Major update |
| `@opentelemetry/instrumentation` | 0.52.1 | 0.219.0 | Major update |
10 changes: 5 additions & 5 deletions docs/runs.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -143,13 +143,13 @@ await runs.cancel(runId);

When a run is canceled:

– The task execution is stopped
- The task execution is stopped

– The run is marked as canceled
- The run is marked as canceled

– The task will not be retried
- The task will not be retried

– Any in-progress child runs are also canceled
- Any in-progress child runs are also canceled

### Time-to-live (TTL)

Expand Down Expand Up @@ -398,7 +398,7 @@ for await (const run of runs.subscribeToRun<typeof myTask>(runId)) {
}
```

For more on real-time updates, see the [Realtime](/realtime) documentation.
For more on real-time updates, see the [Realtime](/realtime/overview) documentation.

### Triggering runs for undeployed tasks

Expand Down
1 change: 1 addition & 0 deletions docs/snippets/node-versions.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,6 @@ export default defineConfig({
// "node", "node-22", "node-24", "node-26", "bun" or "bun-1.4"
runtime: "node-24",
project: "<your-project-ref>",
maxDuration: 3600,
});
```
2 changes: 1 addition & 1 deletion docs/tasks/overview.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -428,7 +428,7 @@ You can also define a global `onComplete` function using `tasks.onComplete()`.
```ts init.ts
import { tasks } from "@trigger.dev/sdk";

tasks.onComplete(({ ctx, payload, output }) => {
tasks.onComplete(({ ctx, payload, result }) => {
console.log("Task completed", ctx.task.id);
});
```
Expand Down
2 changes: 1 addition & 1 deletion docs/tasks/scheduled.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ You can see from the comments that the payload has several useful properties:
- `lastTimestamp` - the time the task was last run, as a UTC date.
- `timezone` - the timezone the schedule was registered with, defaults to "UTC". In IANA format, e.g. "America/New_York".
- `scheduleId` - the id of the schedule that triggered the task
- `type` - the type of schedule, either "DECLARATIVE" (defined with the `cron` property on your task) or "IMPERATIVE" (created with `schedules.create` or in the dashboard)
- `externalId` - the external id you (optionally) provided when creating the schedule
- `upcoming` - the next 10 times the task is scheduled to run

Expand Down Expand Up @@ -438,7 +439,6 @@ const updatedSchedule = await schedules.update(scheduleId, {
task: firstScheduledTask.id,
cron: "0 0 1 * *",
externalId: "ext_1234444",
deduplicationKey: "my-deduplication-key",
});
```

Expand Down
2 changes: 1 addition & 1 deletion docs/tasks/schemaTask.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ const myTask = schemaTask({
});
```

`schemaTask` takes all the same options as [task](/tasks/overview), with the addition of a `schema` field. The `schema` field is a schema parser function from a schema library or or a custom parser function.
`schemaTask` takes all the same options as [task](/tasks/overview), with the addition of a `schema` field. The `schema` field is a schema parser function from a schema library or a custom parser function.

<Note>
We will probably eventually combine `task` and `schemaTask` into a single function, but because
Expand Down
Loading
Loading