@trigger.dev/sdk 4.5.3 → 4.5.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/commonjs/v3/chat.js +25 -18
- package/dist/commonjs/v3/chat.js.map +1 -1
- package/dist/commonjs/version.js +1 -1
- package/dist/esm/v3/chat.js +25 -18
- package/dist/esm/v3/chat.js.map +1 -1
- package/dist/esm/version.js +1 -1
- package/docs/ai-chat/client-protocol.mdx +7 -3
- package/docs/bulk-actions.mdx +46 -19
- package/docs/cli-introduction.mdx +1 -1
- package/docs/config/extensions/syncEnvVars.mdx +27 -0
- package/docs/errors-retrying.mdx +4 -0
- package/docs/limits.mdx +5 -1
- package/docs/migrating-from-v3.mdx +5 -7
- package/docs/run-tests.mdx +12 -11
- package/docs/runs/bulk-actions.mdx +182 -0
- package/docs/self-hosting/docker.mdx +6 -2
- package/docs/self-hosting/env/webapp.mdx +3 -7
- package/docs/self-hosting/kubernetes.mdx +6 -1
- package/docs/self-hosting/overview.mdx +7 -0
- package/docs/tasks/scheduled.mdx +36 -14
- package/package.json +2 -2
package/docs/bulk-actions.mdx
CHANGED
|
@@ -1,9 +1,15 @@
|
|
|
1
1
|
---
|
|
2
2
|
title: "Bulk actions"
|
|
3
|
-
description: "
|
|
3
|
+
description: "Replay or cancel multiple runs from the dashboard using filters or selected run IDs."
|
|
4
4
|
---
|
|
5
5
|
|
|
6
|
-
Bulk actions
|
|
6
|
+
**Bulk actions let you replay or cancel multiple runs asynchronously from the dashboard.**
|
|
7
|
+
|
|
8
|
+
Use bulk actions when you need to retry failed runs after deploying a fix, or stop a group of queued or executing runs.
|
|
9
|
+
|
|
10
|
+
<Note>
|
|
11
|
+
For backend code, see [Bulk actions with the SDK](/runs/bulk-actions).
|
|
12
|
+
</Note>
|
|
7
13
|
|
|
8
14
|
<video
|
|
9
15
|
src="https://content.trigger.dev/bulk-actions.mp4"
|
|
@@ -16,34 +22,55 @@ Bulk actions allow you to perform replaying and canceling on multiple runs at on
|
|
|
16
22
|
height="100%"
|
|
17
23
|
/>
|
|
18
24
|
|
|
19
|
-
##
|
|
25
|
+
## Create a bulk action in the dashboard
|
|
20
26
|
|
|
21
|
-
<
|
|
27
|
+
<Steps>
|
|
28
|
+
<Step title="Open the bulk action panel">
|
|
29
|
+
Open the runs page and click **Bulk action** in the top right.
|
|
22
30
|
|
|
23
|
-

|
|
32
|
+
</Step>
|
|
24
33
|
|
|
34
|
+
<Step title="Choose the runs">
|
|
35
|
+
Filter the runs table to target a group of runs, or select individual runs from the table.
|
|
36
|
+
</Step>
|
|
25
37
|
|
|
26
|
-
<
|
|
38
|
+
<Step title="Configure the action">
|
|
39
|
+
Choose **Replay** or **Cancel**, add an optional name, then confirm the action.
|
|
27
40
|
|
|
28
|
-
|
|
41
|
+

|
|
42
|
+
</Step>
|
|
29
43
|
|
|
30
|
-
<
|
|
44
|
+
<Step title="Track progress">
|
|
45
|
+
Open the bulk action page to see progress, view affected runs, or replay the action.
|
|
31
46
|
|
|
32
|
-
|
|
47
|
+

|
|
48
|
+
</Step>
|
|
49
|
+
</Steps>
|
|
33
50
|
|
|
34
|
-
<
|
|
51
|
+
<Note>
|
|
52
|
+
You can only cancel runs that are still cancelable, such as queued or executing runs. Runs that have already reached a final state cannot be canceled.
|
|
53
|
+
</Note>
|
|
35
54
|
|
|
36
|
-
<Icon icon="circle-7" iconType="solid" color="#FF2D6B" size="20" /> Click the "Replay" or "Cancel" button and confirm in the dialog
|
|
37
55
|
|
|
38
|
-
|
|
56
|
+
## Create a bulk action from the SDK
|
|
39
57
|
|
|
40
|
-
|
|
58
|
+
Use `runs.bulk.replay()` or `runs.bulk.cancel()` when you want to create a bulk action from your backend code.
|
|
41
59
|
|
|
42
|
-
|
|
60
|
+
```ts Your backend code
|
|
61
|
+
import { runs } from "@trigger.dev/sdk";
|
|
43
62
|
|
|
44
|
-
|
|
63
|
+
const action = await runs.bulk.replay({
|
|
64
|
+
filter: {
|
|
65
|
+
status: "FAILED",
|
|
66
|
+
taskIdentifier: "sync-customer",
|
|
67
|
+
period: "24h",
|
|
68
|
+
},
|
|
69
|
+
name: "Replay failed customer syncs",
|
|
70
|
+
});
|
|
45
71
|
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
72
|
+
const completed = await runs.bulk.poll(action.id);
|
|
73
|
+
console.log(completed.status, completed.counts);
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
See [Bulk actions with the SDK](/runs/bulk-actions) for canceling, listing, polling, and aborting bulk actions from your backend code.
|
|
@@ -18,7 +18,7 @@ import VersionOption from '/snippets/cli-options-version.mdx';
|
|
|
18
18
|
| [login](/cli-login-commands) | Login with Trigger.dev so you can perform authenticated actions. |
|
|
19
19
|
| [init](/cli-init-commands) | Initialize your existing project for development with Trigger.dev. |
|
|
20
20
|
| [dev](/cli-dev-commands) | Run your Trigger.dev tasks locally. |
|
|
21
|
-
| [deploy](/cli-deploy-commands) | Deploy your Trigger.dev
|
|
21
|
+
| [deploy](/cli-deploy-commands) | Deploy your Trigger.dev project to the cloud. |
|
|
22
22
|
| [whoami](/cli-whoami-commands) | Display the current logged in user and project details. |
|
|
23
23
|
| [logout](/cli-logout-commands) | Logout of Trigger.dev. |
|
|
24
24
|
| [list-profiles](/cli-list-profiles-commands) | List all of your CLI profiles. |
|
|
@@ -32,6 +32,33 @@ The callback is passed a context object with the following properties:
|
|
|
32
32
|
- `projectRef`: The project ref of the Trigger.dev project
|
|
33
33
|
- `env`: The environment variables that are currently set in the Trigger.dev project
|
|
34
34
|
|
|
35
|
+
### Marking variables as secrets
|
|
36
|
+
|
|
37
|
+
Return the array form and set `isSecret: true` on any variable you want stored as a [secret](/deploy-environment-variables). Secret env vars are redacted in the dashboard and their values can't be revealed after they're set, just like manually created secret variables. You can mix secret and non-secret variables in the same callback.
|
|
38
|
+
|
|
39
|
+
```ts
|
|
40
|
+
import { defineConfig } from "@trigger.dev/sdk";
|
|
41
|
+
import { syncEnvVars } from "@trigger.dev/build/extensions/core";
|
|
42
|
+
|
|
43
|
+
export default defineConfig({
|
|
44
|
+
build: {
|
|
45
|
+
extensions: [
|
|
46
|
+
syncEnvVars(async (ctx) => {
|
|
47
|
+
return [
|
|
48
|
+
{ name: "PUBLIC_API_URL", value: "https://api.example.com" },
|
|
49
|
+
{ name: "DATABASE_URL", value: "postgres://...", isSecret: true },
|
|
50
|
+
];
|
|
51
|
+
}),
|
|
52
|
+
],
|
|
53
|
+
},
|
|
54
|
+
});
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
<Note>
|
|
58
|
+
`isSecret` is only available when you return the array form (`{ name, value, isSecret }`). The
|
|
59
|
+
record form (`{ KEY: "value" }`) always creates non-secret variables.
|
|
60
|
+
</Note>
|
|
61
|
+
|
|
35
62
|
### Example: Sync env vars from Infisical
|
|
36
63
|
|
|
37
64
|
In this example we're using env vars from [Infisical](https://infisical.com).
|
package/docs/errors-retrying.mdx
CHANGED
|
@@ -377,3 +377,7 @@ export const openaiTask = task({
|
|
|
377
377
|
},
|
|
378
378
|
});
|
|
379
379
|
```
|
|
380
|
+
|
|
381
|
+
## Replay failed runs in bulk
|
|
382
|
+
|
|
383
|
+
After you deploy a fix, use [bulk actions](/bulk-actions) to replay multiple failed runs from the dashboard, or [bulk actions with the SDK](/runs/bulk-actions) to replay them from backend code. Bulk replay creates an asynchronous action that targets selected run IDs or a `runs.list()` filter, so you can retry a known failure set without replaying each run individually.
|
package/docs/limits.mdx
CHANGED
|
@@ -104,7 +104,11 @@ Additional bundles are available for $10/month per 100 concurrent connections. C
|
|
|
104
104
|
| Batch trigger payload | Each item can be up to 3MB (SDK 4.3.1+). Prior: 1MB total combined |
|
|
105
105
|
| Task outputs | Must not exceed 10MB |
|
|
106
106
|
|
|
107
|
-
|
|
107
|
+
Large payloads and outputs are offloaded to object storage automatically. You don't need to do anything to handle this in your tasks, as we upload and download the data transparently during operation.
|
|
108
|
+
|
|
109
|
+
On the way in, the SDK uploads any trigger or batch-item payload over 128KB to object storage before sending, so large triggers and batches don't exceed the request body limit. `trigger` and `triggerAndWait` have done this since SDK 4.5.0, and `batchTrigger` and `batchTriggerAndWait` (including the by-id and by-task variants) do too from SDK 4.5.2.
|
|
110
|
+
|
|
111
|
+
Payloads and outputs over 512KB are kept in object storage rather than inline. Calling `runs.retrieve` returns that offloaded data as a presigned download URL (`payloadPresignedUrl` / `outputPresignedUrl`).
|
|
108
112
|
|
|
109
113
|
## Batch size
|
|
110
114
|
|
|
@@ -7,16 +7,14 @@ import NodeVersions from "/snippets/node-versions.mdx";
|
|
|
7
7
|
import MigrateV4UsingAi from "/snippets/migrate-v4-using-ai.mdx";
|
|
8
8
|
|
|
9
9
|
<Warning>
|
|
10
|
-
**
|
|
10
|
+
**Trigger.dev v3 has been retired**
|
|
11
11
|
|
|
12
|
-
|
|
12
|
+
Trigger.dev v3 is end of life. v4 is stable, fully supported, and recommended for all users.
|
|
13
13
|
|
|
14
|
-
|
|
14
|
+
- On Trigger.dev Cloud, v3 has been shut down: v3 triggers and deploys no longer run.
|
|
15
|
+
- If you self-host, 4.5.0 is the last version we officially support for running v3. Stay on 4.5.0 or upgrade to v4; 4.5.1 and later reject v3 triggers, batch triggers, and deploys with an upgrade message.
|
|
15
16
|
|
|
16
|
-
|
|
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).
|
|
17
|
+
**What you need to do:** Migrate to v4. The migration takes about 2 minutes; follow the steps 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
18
|
|
|
21
19
|
</Warning>
|
|
22
20
|
|
package/docs/run-tests.mdx
CHANGED
|
@@ -3,18 +3,19 @@ title: "Run tests"
|
|
|
3
3
|
description: "You can use the dashboard to run a test of your tasks."
|
|
4
4
|
---
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
You can run a test for any of your tasks, in any environment, from the dashboard.
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
<Note>
|
|
9
|
+
There is no longer a "Test" page in the sidebar. You test a task from the task itself: on the
|
|
10
|
+
Tasks page open a task (or use the "Test" action next to a task in the Runs list) and press the
|
|
11
|
+
"Test" button to open its test page.
|
|
12
|
+
</Note>
|
|
9
13
|
|
|
10
|
-
|
|
14
|
+
On a task's test page you can:
|
|
11
15
|
|
|
12
|
-
|
|
16
|
+
- Enter the run's input — a JSON **payload** and optional **metadata**. Scheduled tasks show timestamp fields instead of a payload.
|
|
17
|
+
- Configure run **options** like the machine size, version, queue, tags, retries, max duration, or a delay.
|
|
18
|
+
- Pre-populate the form from a previous run with **Recent runs**, or save and reuse a configuration with **Templates**.
|
|
19
|
+
- Press **Run test** to trigger the run.
|
|
13
20
|
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
<Icon icon="circle-4" iconType="solid" color="#FF2D6B" size="20" /> Select from previous test runs
|
|
17
|
-
|
|
18
|
-
<Icon icon="circle-5" iconType="solid" color="#FF2D6B" size="20" /> Save the current test configuration as a template for later
|
|
19
|
-
|
|
20
|
-
<Icon icon="circle-6" iconType="solid" color="#FF2D6B" size="20" /> Run the test
|
|
21
|
+

|
|
@@ -0,0 +1,182 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: "Bulk actions"
|
|
3
|
+
description: "Cancel or replay many runs from the SDK using run IDs or SDK run-list filters."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
**Bulk actions let you cancel or replay many runs asynchronously from the SDK by selecting runs with run IDs or SDK run-list filters.**
|
|
7
|
+
|
|
8
|
+
A bulk action returns a handle immediately. Use the handle to retrieve progress, poll until completion, list previous actions, or abort pending work.
|
|
9
|
+
|
|
10
|
+
## Create a bulk replay
|
|
11
|
+
|
|
12
|
+
Use `runs.bulk.replay()` to replay every run that matches a filter.
|
|
13
|
+
|
|
14
|
+
```ts Your backend code
|
|
15
|
+
import { runs } from "@trigger.dev/sdk";
|
|
16
|
+
|
|
17
|
+
const action = await runs.bulk.replay({
|
|
18
|
+
filter: {
|
|
19
|
+
status: "FAILED",
|
|
20
|
+
taskIdentifier: "sync-customer",
|
|
21
|
+
period: "24h",
|
|
22
|
+
},
|
|
23
|
+
name: "Replay failed customer syncs",
|
|
24
|
+
targetRegion: "eu-central-1",
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
const completed = await runs.bulk.poll(action.id);
|
|
28
|
+
console.log(completed.status, completed.counts);
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
`filter` accepts the SDK run-list filter fields, excluding pagination fields such as `limit`, `after`, and `before`. This is the TypeScript SDK shape used by `runs.list()` (`from`, `to`, and `period` are top-level fields), not the nested `filter[createdAt]` query shape shown in the raw HTTP list-runs endpoint. Provide at least one filter field; use `runIds` when you want to target specific runs. Relative time filters such as `period` are resolved when the bulk action is created, so later batches process the same fixed time range.
|
|
32
|
+
|
|
33
|
+
<Warning>
|
|
34
|
+
Filters inherit the same time semantics as `runs.list()`: when you don't pass `from`, `to`, or `period`, the action defaults to the **last 7 days** and won't target older matching runs. To cover a wider range, pass an explicit `period` (such as `"30d"`), a `from` timestamp, or a `from`/`to` pair. This default only applies to `filter` selections; `runIds` selections are never time-bounded.
|
|
35
|
+
</Warning>
|
|
36
|
+
|
|
37
|
+
<ParamField body="filter" type="BulkActionFilter">
|
|
38
|
+
Selects runs using the SDK run-list filter shape, excluding `limit`, `after`, and `before`. In raw HTTP requests these fields are sent as JSON body properties, so time fields are top-level (`from`, `to`, `period`) instead of nested under `createdAt`.
|
|
39
|
+
</ParamField>
|
|
40
|
+
|
|
41
|
+
<ParamField body="runIds" type="string[]">
|
|
42
|
+
Selects specific run IDs. Provide either `filter` or `runIds`, not both.
|
|
43
|
+
</ParamField>
|
|
44
|
+
|
|
45
|
+
<ParamField body="name" type="string" optional>
|
|
46
|
+
A name for the bulk action.
|
|
47
|
+
</ParamField>
|
|
48
|
+
|
|
49
|
+
<ParamField body="targetRegion" type="string" optional>
|
|
50
|
+
Replays matching runs in a specific region. When omitted, each replay keeps the original run's region. This option is only available for `runs.bulk.replay()`.
|
|
51
|
+
</ParamField>
|
|
52
|
+
|
|
53
|
+
## Create a bulk cancel
|
|
54
|
+
|
|
55
|
+
Use `runs.bulk.cancel()` to cancel every run that matches a filter, or specific run IDs.
|
|
56
|
+
|
|
57
|
+
```ts Your backend code
|
|
58
|
+
import { runs } from "@trigger.dev/sdk";
|
|
59
|
+
|
|
60
|
+
const action = await runs.bulk.cancel({
|
|
61
|
+
runIds: ["run_1234", "run_5678"],
|
|
62
|
+
name: "Cancel selected runs",
|
|
63
|
+
});
|
|
64
|
+
|
|
65
|
+
console.log(action.id);
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
Only runs that are still cancelable when the action reaches them are canceled. Runs that have already reached a final state count as failures in the bulk action summary.
|
|
69
|
+
|
|
70
|
+
## Retrieve progress
|
|
71
|
+
|
|
72
|
+
Use `runs.bulk.retrieve()` to read the current status and aggregate counts.
|
|
73
|
+
|
|
74
|
+
```ts Your backend code
|
|
75
|
+
import { runs } from "@trigger.dev/sdk";
|
|
76
|
+
|
|
77
|
+
const action = await runs.bulk.retrieve("bulk_1234");
|
|
78
|
+
|
|
79
|
+
console.log(action.status);
|
|
80
|
+
console.log(action.counts.total, action.counts.success, action.counts.failure);
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
The returned bulk action object has these fields:
|
|
84
|
+
|
|
85
|
+
<ResponseField name="id" type="string">
|
|
86
|
+
The bulk action ID, starting with `bulk_`.
|
|
87
|
+
</ResponseField>
|
|
88
|
+
|
|
89
|
+
<ResponseField name="type" type="'CANCEL' | 'REPLAY'">
|
|
90
|
+
The action being performed.
|
|
91
|
+
</ResponseField>
|
|
92
|
+
|
|
93
|
+
<ResponseField name="status" type="'PENDING' | 'COMPLETED' | 'ABORTED'">
|
|
94
|
+
The current bulk action status.
|
|
95
|
+
</ResponseField>
|
|
96
|
+
|
|
97
|
+
<ResponseField name="counts" type="object">
|
|
98
|
+
Aggregate processing counts.
|
|
99
|
+
|
|
100
|
+
<Expandable title="properties">
|
|
101
|
+
<ResponseField name="total" type="number">
|
|
102
|
+
The number of runs selected when the bulk action was created.
|
|
103
|
+
</ResponseField>
|
|
104
|
+
<ResponseField name="success" type="number">
|
|
105
|
+
The number of runs processed successfully.
|
|
106
|
+
</ResponseField>
|
|
107
|
+
<ResponseField name="failure" type="number">
|
|
108
|
+
The number of runs that could not be processed.
|
|
109
|
+
</ResponseField>
|
|
110
|
+
</Expandable>
|
|
111
|
+
</ResponseField>
|
|
112
|
+
|
|
113
|
+
<ResponseField name="createdAt" type="Date">
|
|
114
|
+
The date and time the bulk action was created.
|
|
115
|
+
</ResponseField>
|
|
116
|
+
|
|
117
|
+
<ResponseField name="completedAt" type="Date" optional>
|
|
118
|
+
The date and time the bulk action completed.
|
|
119
|
+
</ResponseField>
|
|
120
|
+
|
|
121
|
+
## Poll for completion
|
|
122
|
+
|
|
123
|
+
Use `runs.bulk.poll()` to wait until the bulk action leaves the `PENDING` state.
|
|
124
|
+
|
|
125
|
+
```ts Your backend code
|
|
126
|
+
import { runs } from "@trigger.dev/sdk";
|
|
127
|
+
|
|
128
|
+
const completed = await runs.bulk.poll("bulk_1234", {
|
|
129
|
+
pollIntervalMs: 2_000,
|
|
130
|
+
});
|
|
131
|
+
|
|
132
|
+
console.log(completed.status);
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
## Abort a bulk action
|
|
136
|
+
|
|
137
|
+
Use `runs.bulk.abort()` to stop future batches from being processed.
|
|
138
|
+
|
|
139
|
+
```ts Your backend code
|
|
140
|
+
import { runs } from "@trigger.dev/sdk";
|
|
141
|
+
|
|
142
|
+
await runs.bulk.abort("bulk_1234");
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
Abort is best effort. Runs already being processed in the current batch may still finish.
|
|
146
|
+
|
|
147
|
+
<Note>
|
|
148
|
+
Each environment can only run a limited number of bulk replays at the same time. If you start a replay while too many are still in progress, the call fails and returns an error. Wait for an in-progress replay to finish or abort one before starting another. Bulk cancels are not subject to this limit.
|
|
149
|
+
</Note>
|
|
150
|
+
|
|
151
|
+
## List bulk actions
|
|
152
|
+
|
|
153
|
+
Use `runs.bulk.list()` to page through previous bulk actions in the current environment.
|
|
154
|
+
|
|
155
|
+
```ts Your backend code
|
|
156
|
+
import { runs } from "@trigger.dev/sdk";
|
|
157
|
+
|
|
158
|
+
const page = await runs.bulk.list({ limit: 25 });
|
|
159
|
+
|
|
160
|
+
for (const action of page.data) {
|
|
161
|
+
console.log(action.id, action.status);
|
|
162
|
+
}
|
|
163
|
+
```
|
|
164
|
+
|
|
165
|
+
List results support the same auto-pagination helpers as other management API list methods:
|
|
166
|
+
|
|
167
|
+
```ts Your backend code
|
|
168
|
+
import { runs } from "@trigger.dev/sdk";
|
|
169
|
+
|
|
170
|
+
for await (const action of runs.bulk.list({ limit: 25 })) {
|
|
171
|
+
console.log(action.id, action.status);
|
|
172
|
+
}
|
|
173
|
+
```
|
|
174
|
+
|
|
175
|
+
## API reference
|
|
176
|
+
|
|
177
|
+
The SDK methods use the bulk actions HTTP API:
|
|
178
|
+
|
|
179
|
+
- [Create bulk action](/management/bulk-actions/create)
|
|
180
|
+
- [List bulk actions](/management/bulk-actions/list)
|
|
181
|
+
- [Retrieve bulk action](/management/bulk-actions/retrieve)
|
|
182
|
+
- [Abort bulk action](/management/bulk-actions/abort)
|
|
@@ -344,6 +344,12 @@ TRIGGER_IMAGE_TAG=v4.5.0
|
|
|
344
344
|
|
|
345
345
|
We patch the latest released version line only, so keep an eye on new releases to receive security fixes. See [Security & vulnerability reporting](/self-hosting/security).
|
|
346
346
|
|
|
347
|
+
<Note>
|
|
348
|
+
Trigger.dev 4.5.0 is the last version we officially support for running v3 (SDK v3) tasks. If
|
|
349
|
+
you still have v3 tasks, pin `TRIGGER_IMAGE_TAG` to exactly `v4.5.0` or [migrate to
|
|
350
|
+
v4](/migrating-from-v3). 4.5.1 and later reject v3 triggers and deploys with an upgrade message.
|
|
351
|
+
</Note>
|
|
352
|
+
|
|
347
353
|
## Task events
|
|
348
354
|
|
|
349
355
|
By default, task events (timeline, logs, spans) are stored in PostgreSQL. For production deployments we recommend storing them in ClickHouse instead, it scales to much higher volumes and avoids unbounded growth of the `TaskEvent` table.
|
|
@@ -390,8 +396,6 @@ See the [webapp environment variables](/self-hosting/env/webapp) for the full li
|
|
|
390
396
|
docker compose logs -f webapp
|
|
391
397
|
```
|
|
392
398
|
|
|
393
|
-
- **Deploy fails with `ERROR: schema "graphile_worker" does not exist`.** This error occurs when Graphile Worker migrations fail to run during webapp startup. Check the webapp logs for certificate-related errors like `self-signed certificate in certificate chain`. This is often caused by PostgreSQL SSL certificate issues when using an external PostgreSQL instance with SSL enabled. Ensure that both the webapp and supervisor containers have access to the same CA certificate used by your PostgreSQL instance. You can configure this by mounting the certificate file and setting the `NODE_EXTRA_CA_CERTS` environment variable to point to the certificate path. Once the certificate issue is resolved, the migrations will complete and create the required `graphile_worker` schema.
|
|
394
|
-
|
|
395
399
|
- **ClickHouse migrations say "no migrations to run" but schema is missing.** The goose migration tracker is out of sync. Exec into the webapp container, set the GOOSE env vars (from webapp startup logs), and run `goose reset && goose up`.
|
|
396
400
|
|
|
397
401
|
<Warning>
|
|
@@ -52,11 +52,8 @@ mode: "wide"
|
|
|
52
52
|
| `AWS_REGION` | No | — | AWS region for SES. |
|
|
53
53
|
| `AWS_ACCESS_KEY_ID` | No | — | AWS access key ID for SES. |
|
|
54
54
|
| `AWS_SECRET_ACCESS_KEY` | No | — | AWS secret access key for SES. |
|
|
55
|
-
| **
|
|
56
|
-
| `
|
|
57
|
-
| `WORKER_POLL_INTERVAL` | No | 1000 | Redis worker poll interval (ms). |
|
|
58
|
-
| `WORKER_SCHEMA` | No | graphile_worker | Graphile worker schema. |
|
|
59
|
-
| `GRACEFUL_SHUTDOWN_TIMEOUT` | No | 60000 (1m) | Graphile graceful shutdown timeout (ms). Affects shutdown time. |
|
|
55
|
+
| **Worker** | | | |
|
|
56
|
+
| `GRACEFUL_SHUTDOWN_TIMEOUT` | No | 60000 (1m) | Graceful shutdown timeout (ms). Affects shutdown time. |
|
|
60
57
|
| **Concurrency limits** | | | |
|
|
61
58
|
| `DEFAULT_ENV_EXECUTION_CONCURRENCY_LIMIT` | No | 100 | Default env execution concurrency. |
|
|
62
59
|
| `DEFAULT_ORG_EXECUTION_CONCURRENCY_LIMIT` | No | 300 | Default org execution concurrency, needs to be 3x env concurrency. |
|
|
@@ -138,6 +135,7 @@ mode: "wide"
|
|
|
138
135
|
| `SERVER_OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT` | No | 8192 | OTel span attribute value length limit. |
|
|
139
136
|
| **Task events** | | | |
|
|
140
137
|
| `EVENT_REPOSITORY_DEFAULT_STORE` | No | postgres | Where to store task events. Set to `clickhouse_v2` to store in ClickHouse (recommended for production). |
|
|
138
|
+
| `EVENT_REPOSITORY_POSTGRES_WRITES_DISABLED` | No | 0 | Skip all PostgreSQL task-event writes (set to `1`). Only enable when `EVENT_REPOSITORY_DEFAULT_STORE` is `clickhouse_v2`, otherwise task events are lost. |
|
|
141
139
|
| **Realtime** | | | |
|
|
142
140
|
| `REALTIME_STREAM_VERSION` | No | v1 | Stream version exposed to tasks via the `TRIGGER_REALTIME_STREAM_VERSION` variable. Distinct from `REALTIME_STREAMS_DEFAULT_VERSION`. One of `v1`, `v2`. |
|
|
143
141
|
| `REALTIME_STREAM_MAX_LENGTH` | No | 1000 | Realtime stream max length. |
|
|
@@ -168,8 +166,6 @@ mode: "wide"
|
|
|
168
166
|
| `MAXIMUM_DEV_QUEUE_SIZE` | No | — | Maximum queued runs per queue in development environments. |
|
|
169
167
|
| `MAXIMUM_DEPLOYED_QUEUE_SIZE` | No | — | Maximum queued runs per queue in deployed (staging/prod) environments. |
|
|
170
168
|
| **Misc** | | | |
|
|
171
|
-
| `PROVIDER_SECRET` | No | provider-secret | Secret for provider auth. **Must be set to a secure value in self-hosted/production**; the default is insecure. |
|
|
172
|
-
| `COORDINATOR_SECRET` | No | coordinator-secret | Secret for coordinator auth. **Must be set to a secure value in self-hosted/production**; the default is insecure. |
|
|
173
169
|
| `TRIGGER_TELEMETRY_DISABLED` | No | — | Disable telemetry. |
|
|
174
170
|
| `NODE_MAX_OLD_SPACE_SIZE` | No | 8192 | Maximum memory allocation for Node.js heap in MiB (e.g. "4096" for 4GB). |
|
|
175
171
|
| `OPENAI_API_KEY` | No | — | OpenAI API key. |
|
|
@@ -528,6 +528,12 @@ webapp:
|
|
|
528
528
|
|
|
529
529
|
## Version locking
|
|
530
530
|
|
|
531
|
+
<Note>
|
|
532
|
+
Trigger.dev 4.5.0 is the last version we officially support for running v3 (SDK v3) tasks. If
|
|
533
|
+
you still have v3 tasks, pin to exactly 4.5.0 or [migrate to v4](/migrating-from-v3). 4.5.1 and
|
|
534
|
+
later reject v3 triggers and deploys with an upgrade message.
|
|
535
|
+
</Note>
|
|
536
|
+
|
|
531
537
|
You can lock versions in two ways:
|
|
532
538
|
|
|
533
539
|
**Helm chart version (recommended):**
|
|
@@ -602,7 +608,6 @@ kubectl delete namespace trigger
|
|
|
602
608
|
- **Deploy fails**: Verify registry access and authentication
|
|
603
609
|
- **Pods stuck pending**: Describe the pod and check the events
|
|
604
610
|
- **Worker token issues**: Check webapp and supervisor logs for errors
|
|
605
|
-
- **Deploy fails with `ERROR: schema "graphile_worker" does not exist`**: See the [Docker troubleshooting](/self-hosting/docker#troubleshooting) section for details on resolving PostgreSQL SSL certificate issues that prevent Graphile Worker migrations.
|
|
606
611
|
|
|
607
612
|
See the [Docker troubleshooting](/self-hosting/docker#troubleshooting) section for more information.
|
|
608
613
|
|
|
@@ -10,6 +10,13 @@ You are responsible for provisioning resources, handling updates, and managing a
|
|
|
10
10
|
|
|
11
11
|
We provide version-tagged releases for self-hosted deployments. It's highly advised to use these tags exclusively and keep them locked with your CLI version.
|
|
12
12
|
|
|
13
|
+
<Warning>
|
|
14
|
+
**v3 is end of life.** Trigger.dev 4.5.0 is the last version we officially support for running
|
|
15
|
+
v3 (SDK v3) tasks. If you still have v3 tasks, stay on 4.5.0 or [migrate to
|
|
16
|
+
v4](/migrating-from-v3). 4.5.1 and later reject v3 triggers, batch triggers, and deploys with an
|
|
17
|
+
upgrade message; v4 workloads are unaffected.
|
|
18
|
+
</Warning>
|
|
19
|
+
|
|
13
20
|
## Should you self-host?
|
|
14
21
|
|
|
15
22
|
Trigger.dev Cloud is fully managed, scalable, and comes with dedicated support. For most users, it offers the best experience. However, if you have specific requirements around data residency, compliance, or infrastructure control, self-hosting may be the right choice for you.
|
package/docs/tasks/scheduled.mdx
CHANGED
|
@@ -127,11 +127,11 @@ export const secondScheduledTask = schedules.task({
|
|
|
127
127
|
});
|
|
128
128
|
```
|
|
129
129
|
|
|
130
|
-
When you run the [dev](/cli-dev-commands) or [deploy](/cli-deploy-commands) commands, declarative schedules will be synced. If you add, delete or edit the `cron` property it will be updated when you run these commands. You can view your schedules on the
|
|
130
|
+
When you run the [dev](/cli-dev-commands) or [deploy](/cli-deploy-commands) commands, declarative schedules will be synced. If you add, delete or edit the `cron` property it will be updated when you run these commands. You can view your synced schedules in the dashboard: open the task on the Tasks page and check its "Schedules" tab.
|
|
131
131
|
|
|
132
132
|
### Imperative schedules
|
|
133
133
|
|
|
134
|
-
Alternatively you can explicitly attach schedules to a `schedules.task`. You can do this in the
|
|
134
|
+
Alternatively you can explicitly attach schedules to a `schedules.task`. You can do this in the dashboard from the scheduled task's page by pressing the "Create schedule" button, or you can use the SDK to create schedules.
|
|
135
135
|
|
|
136
136
|
The advantage of imperative schedules is that they can be created dynamically, for example, you could create a schedule for each user in your database. They can also be activated, disabled, edited, and deleted without deploying new code by using the SDK or dashboard.
|
|
137
137
|
|
|
@@ -166,26 +166,37 @@ There are two situations when a scheduled task won't trigger:
|
|
|
166
166
|
|
|
167
167
|
## Attaching schedules in the dashboard
|
|
168
168
|
|
|
169
|
-
You need to attach a schedule to a task before it will run on a schedule. You can attach
|
|
169
|
+
You need to attach a schedule to a task before it will run on a schedule. You can attach imperative schedules in the dashboard:
|
|
170
|
+
|
|
171
|
+
<Note>
|
|
172
|
+
**The Schedules page has moved.** There is no longer a standalone "Schedules" page in the
|
|
173
|
+
sidebar. Schedules now live on the Tasks page: open a scheduled task to create, view, edit,
|
|
174
|
+
enable/disable, and delete its schedules. The old `/schedules` URL redirects to the Tasks page.
|
|
175
|
+
|
|
176
|
+
The scheduled task must already exist first — define it in your code with `schedules.task()` and
|
|
177
|
+
sync it to the environment by running the [dev](/cli-dev-commands) or
|
|
178
|
+
[deploy](/cli-deploy-commands) command so it appears on the Tasks page. A project with no tasks
|
|
179
|
+
yet will only show the deploy onboarding.
|
|
180
|
+
</Note>
|
|
170
181
|
|
|
171
182
|
<Steps>
|
|
172
183
|
|
|
173
|
-
<Step title="
|
|
174
|
-
In the sidebar select the "
|
|
175
|
-
|
|
176
|
-
page](/images/schedules-blank.png)
|
|
184
|
+
<Step title="Open the scheduled task">
|
|
185
|
+
In the sidebar select the "Tasks" page, then select the scheduled task you want to attach a
|
|
186
|
+
schedule to (scheduled tasks have a clock icon, and you can filter the list to Scheduled).
|
|
187
|
+

|
|
177
188
|
</Step>
|
|
178
189
|
|
|
179
190
|
<Step title="Create your schedule">
|
|
180
|
-
|
|
181
|
-
|
|
191
|
+
Press the "Create schedule" button, fill in the form, and press "Create schedule" when you're
|
|
192
|
+
done. 
|
|
182
193
|
|
|
183
194
|
These are the options when creating a schedule:
|
|
184
195
|
|
|
185
196
|
| Name | Description |
|
|
186
197
|
| ----------------- | --------------------------------------------------------------------------------------------- |
|
|
187
198
|
| Task | The id of the task you want to attach to. |
|
|
188
|
-
| Cron pattern | The schedule in cron format.
|
|
199
|
+
| Cron pattern | The schedule in cron format. You can also describe it in natural language and press "Generate" to fill this in. |
|
|
189
200
|
| Timezone | The timezone the schedule will run in. Defaults to "UTC" |
|
|
190
201
|
| External id | An optional external id, usually you'd use a userId. |
|
|
191
202
|
| Deduplication key | An optional deduplication key. If you pass the same value, it will update rather than create. Scoped per project, not per environment. |
|
|
@@ -195,6 +206,12 @@ These are the options when creating a schedule:
|
|
|
195
206
|
|
|
196
207
|
</Steps>
|
|
197
208
|
|
|
209
|
+
## Managing schedules in the dashboard
|
|
210
|
+
|
|
211
|
+
Open the scheduled task and switch to the "Schedules" tab to see every schedule attached to it — both declarative and imperative — with its type, cron pattern, external id, next and last run, and status.
|
|
212
|
+
|
|
213
|
+
Click a schedule to open the inspector, where you can **enable/disable**, **edit**, or **delete** imperative schedules without deploying new code. Declarative schedules are managed in your code, so they can't be edited or deleted from here.
|
|
214
|
+
|
|
198
215
|
## Attaching schedules with the SDK
|
|
199
216
|
|
|
200
217
|
You call `schedules.create()` to create a schedule from your code. Here's the simplest possible example:
|
|
@@ -302,14 +319,19 @@ You can also retrieve, list, delete, deactivate and re-activate schedules using
|
|
|
302
319
|
|
|
303
320
|
You can test a scheduled task in the dashboard. Note that the `scheduleId` will always come through as `sched_1234` to the run.
|
|
304
321
|
|
|
322
|
+
<Note>
|
|
323
|
+
There is no longer a standalone "Test" page in the sidebar. You test a task from the task itself —
|
|
324
|
+
open it on the Tasks page and press the "Test schedule" button.
|
|
325
|
+
</Note>
|
|
326
|
+
|
|
305
327
|
<Steps>
|
|
306
328
|
|
|
307
|
-
<Step title="
|
|
308
|
-
|
|
309
|
-
|
|
329
|
+
<Step title="Open the test page for your task">
|
|
330
|
+
On the "Tasks" page, open your scheduled task and press the "Test schedule" button.
|
|
331
|
+

|
|
310
332
|
</Step>
|
|
311
333
|
|
|
312
|
-
<Step title="
|
|
334
|
+
<Step title="Run the test">
|
|
313
335
|
Fill in the form [1]. You can select from a recent run [2] to pre-populate the fields. Press "Run
|
|
314
336
|
test" when you're ready 
|
|
315
337
|
</Step>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@trigger.dev/sdk",
|
|
3
|
-
"version": "4.5.
|
|
3
|
+
"version": "4.5.5",
|
|
4
4
|
"description": "trigger.dev Node.JS SDK",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"publishConfig": {
|
|
@@ -66,7 +66,7 @@
|
|
|
66
66
|
"dependencies": {
|
|
67
67
|
"@opentelemetry/api": "1.9.1",
|
|
68
68
|
"@opentelemetry/semantic-conventions": "1.41.1",
|
|
69
|
-
"@trigger.dev/core": "4.5.
|
|
69
|
+
"@trigger.dev/core": "4.5.5",
|
|
70
70
|
"chalk": "^5.2.0",
|
|
71
71
|
"cronstrue": "^2.21.0",
|
|
72
72
|
"debug": "^4.3.4",
|