@trigger.dev/sdk 4.7.2 → 4.7.4
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/ai.d.ts +5 -0
- package/dist/commonjs/v3/ai.js +6 -2
- package/dist/commonjs/v3/ai.js.map +1 -1
- package/dist/commonjs/v3/chat-server.d.ts +7 -0
- package/dist/commonjs/v3/chat-server.js +3 -0
- package/dist/commonjs/v3/chat-server.js.map +1 -1
- package/dist/commonjs/v3/concurrencyLimits.d.ts +37 -7
- package/dist/commonjs/v3/concurrencyLimits.js +38 -70
- package/dist/commonjs/v3/concurrencyLimits.js.map +1 -1
- package/dist/commonjs/v3/index.d.ts +1 -1
- package/dist/commonjs/v3/index.js.map +1 -1
- package/dist/commonjs/v3/runs.d.ts +22 -1
- package/dist/commonjs/v3/runs.js +6 -3
- package/dist/commonjs/v3/runs.js.map +1 -1
- package/dist/commonjs/version.js +1 -1
- package/dist/esm/v3/ai.d.ts +5 -0
- package/dist/esm/v3/ai.js +6 -2
- package/dist/esm/v3/ai.js.map +1 -1
- package/dist/esm/v3/chat-server.d.ts +7 -0
- package/dist/esm/v3/chat-server.js +3 -0
- package/dist/esm/v3/chat-server.js.map +1 -1
- package/dist/esm/v3/concurrencyLimits.d.ts +37 -7
- package/dist/esm/v3/concurrencyLimits.js +38 -70
- package/dist/esm/v3/concurrencyLimits.js.map +1 -1
- package/dist/esm/v3/index.d.ts +1 -1
- package/dist/esm/v3/index.js.map +1 -1
- package/dist/esm/v3/runs.d.ts +22 -1
- package/dist/esm/v3/runs.js +6 -3
- package/dist/esm/v3/runs.js.map +1 -1
- package/dist/esm/version.js +1 -1
- package/docs/ai-chat/patterns/sub-agents.mdx +33 -0
- package/docs/apikeys.mdx +3 -3
- package/docs/billing-limits.mdx +1 -1
- package/docs/cli-env-commands.mdx +5 -4
- package/docs/cli-init-commands.mdx +27 -1
- package/docs/cli-login-commands.mdx +20 -0
- package/docs/cli-projects-commands.mdx +13 -1
- package/docs/cli-runs-commands.mdx +3 -2
- package/docs/cli-update-commands.mdx +9 -3
- package/docs/cli-whoami-commands.mdx +12 -0
- package/docs/concurrency.mdx +32 -0
- package/docs/config/extensions/audioWaveform.mdx +4 -1
- package/docs/config/extensions/overview.mdx +2 -0
- package/docs/config/extensions/prismaExtension.mdx +2 -3
- package/docs/config/extensions/puppeteer.mdx +3 -5
- package/docs/config/extensions/pythonExtension.mdx +9 -1
- package/docs/config/extensions/syncEnvVars.mdx +6 -0
- package/docs/deploy-environment-variables.mdx +1 -1
- package/docs/deployment/atomic-deployment.mdx +2 -0
- package/docs/deployment/dev-branches.mdx +5 -5
- package/docs/deployment/overview.mdx +8 -7
- package/docs/deployment/preview-branches.mdx +6 -3
- package/docs/errors-retrying.mdx +4 -4
- package/docs/how-it-works.mdx +5 -5
- package/docs/introduction.mdx +6 -0
- package/docs/limits.mdx +26 -8
- package/docs/logging.mdx +1 -1
- package/docs/machines.mdx +1 -1
- package/docs/mcp-introduction.mdx +8 -7
- package/docs/mcp-tools.mdx +15 -1
- package/docs/migrating-from-v3.mdx +1 -1
- package/docs/observability/dashboards.mdx +2 -0
- package/docs/observability/query.mdx +6 -2
- package/docs/private-networking/aws-console-setup.mdx +1 -1
- package/docs/private-networking/overview.mdx +1 -1
- package/docs/quick-start.mdx +3 -40
- package/docs/realtime/auth.mdx +1 -1
- package/docs/realtime/backend/input-streams.mdx +159 -0
- package/docs/realtime/backend/streams.mdx +25 -10
- package/docs/realtime/how-it-works.mdx +1 -1
- package/docs/realtime/react-hooks/overview.mdx +1 -1
- package/docs/realtime/react-hooks/streams.mdx +2 -2
- package/docs/realtime/react-hooks/subscribe.mdx +19 -3
- package/docs/realtime/react-hooks/triggering.mdx +2 -2
- package/docs/realtime/react-hooks/use-wait-token.mdx +1 -1
- package/docs/realtime/run-object.mdx +47 -24
- package/docs/replaying.mdx +26 -1
- package/docs/reports.mdx +4 -2
- package/docs/run-tests.mdx +2 -2
- package/docs/run-usage.mdx +3 -3
- package/docs/runs/heartbeats.mdx +2 -2
- package/docs/runs/list-best-practices.mdx +234 -0
- package/docs/runs/metadata.mdx +7 -10
- package/docs/runs.mdx +18 -8
- package/docs/self-hosting/env/supervisor.mdx +2 -1
- package/docs/self-hosting/env/webapp.mdx +6 -0
- package/docs/self-hosting/overview.mdx +26 -0
- package/docs/tags.mdx +6 -0
- package/docs/tasks/scheduled.mdx +11 -5
- package/docs/triggering.mdx +8 -0
- package/docs/troubleshooting-alerts.mdx +102 -3
- package/docs/troubleshooting.mdx +1 -1
- package/docs/upgrading-packages.mdx +3 -3
- package/docs/vercel-integration.mdx +13 -3
- package/docs/versioning.mdx +1 -1
- package/docs/wait-for-token.mdx +3 -3
- package/package.json +2 -2
|
@@ -100,6 +100,32 @@ All fields are optional. Partial overrides are supported:
|
|
|
100
100
|
}
|
|
101
101
|
```
|
|
102
102
|
|
|
103
|
+
## Custom base images
|
|
104
|
+
|
|
105
|
+
Deploys build on the published `triggerdotdev/node` and `triggerdotdev/bun` Debian images. To require a different base for every deploy to your instance, such as a FIPS-validated or hardened Node image, set `DEPLOY_BASE_IMAGES` on the webapp (and optionally `DEPLOY_BUILD_BASE_IMAGES` for the build stage):
|
|
106
|
+
|
|
107
|
+
```bash
|
|
108
|
+
DEPLOY_BASE_IMAGES="node-26=registry.example.com/node-fips:26@sha256:<64-character-digest>"
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
Entries are comma-separated `runtime=image@sha256:<digest>`. The runtimes are `node-22`, `node-24`, `node-26` and `bun`, and every image must be pinned by digest. An invalid value prevents the webapp from starting. Projects with `runtime: "node"` in their config resolve to the current default Node runtime (`node-24` today), so set that key for them. With the Helm chart, set the variables through `webapp.extraEnvVars`.
|
|
112
|
+
|
|
113
|
+
Runtimes with an entry build on that image; the others keep the published images. Deploys from CLI versions that cannot apply the images are rejected with an error asking to upgrade, and so are `--native-build`, `--local-bundle` and `--from-bundle` deploys. This is a self-hosting setting and does not apply to Trigger.dev Cloud.
|
|
114
|
+
|
|
115
|
+
You own a custom base image. It must provide:
|
|
116
|
+
|
|
117
|
+
- `node` on `PATH` at the runtime's major version (for `bun`, both `bun` and `node`, because the final stage starts the app with `dumb-init node`)
|
|
118
|
+
- `busybox`, `ca-certificates`, `dumb-init`, `git` and `openssl`
|
|
119
|
+
- a `node` user (a `bun` user for the Bun runtime)
|
|
120
|
+
- glibc, so native modules built in the build stage load at runtime
|
|
121
|
+
|
|
122
|
+
A `DEPLOY_BUILD_BASE_IMAGES` image needs everything the base image provides, plus `python3`, `make` and `g++`. Build extensions that add image instructions are replayed on it. Without an entry, the build stage uses the published build image, except for projects whose build extensions add image instructions: those build from your base image and install the toolchain with `apt-get`, so that base must be Debian-based. To avoid the published images entirely, set both variables.
|
|
123
|
+
|
|
124
|
+
<Warning>
|
|
125
|
+
`image.pkgs` and build extensions that run `apt-get` (such as `aptGet` and `playwright`) assume a
|
|
126
|
+
Debian base. On other distributions, install those packages in your base image instead.
|
|
127
|
+
</Warning>
|
|
128
|
+
|
|
103
129
|
## Community support
|
|
104
130
|
|
|
105
131
|
It's dangerous to go alone! Join the self-hosting channel on our [Discord server](https://discord.gg/NQTxt5NA7s).
|
package/docs/tags.mdx
CHANGED
|
@@ -118,3 +118,9 @@ for await (const run of runs.list({ tag: "user_123456", status: ["COMPLETED"] })
|
|
|
118
118
|
console.log(run.id, run.taskIdentifier, run.finishedAt, run.tags);
|
|
119
119
|
}
|
|
120
120
|
```
|
|
121
|
+
|
|
122
|
+
<Tip>
|
|
123
|
+
To follow runs with a tag as they change, use
|
|
124
|
+
[`runs.subscribeToRunsWithTag()`](/realtime/backend/subscribe) instead of polling `runs.list()`.
|
|
125
|
+
See [runs.list() best practices](/runs/list-best-practices).
|
|
126
|
+
</Tip>
|
package/docs/tasks/scheduled.mdx
CHANGED
|
@@ -45,7 +45,7 @@ export const firstScheduledTask = schedules.task({
|
|
|
45
45
|
//this can be undefined if you didn't provide one
|
|
46
46
|
console.log(payload.externalId); //is a string or undefined
|
|
47
47
|
|
|
48
|
-
//the next
|
|
48
|
+
//the next 10 dates this task is scheduled to run
|
|
49
49
|
console.log(payload.upcoming); //is an array of Date objects
|
|
50
50
|
},
|
|
51
51
|
});
|
|
@@ -58,14 +58,14 @@ You can see from the comments that the payload has several useful properties:
|
|
|
58
58
|
- `timezone` - the timezone the schedule was registered with, defaults to "UTC". In IANA format, e.g. "America/New_York".
|
|
59
59
|
- `scheduleId` - the id of the schedule that triggered the task
|
|
60
60
|
- `externalId` - the external id you (optionally) provided when creating the schedule
|
|
61
|
-
- `upcoming` - the next
|
|
61
|
+
- `upcoming` - the next 10 times the task is scheduled to run
|
|
62
62
|
|
|
63
63
|
<Note>
|
|
64
64
|
This task will NOT get triggered on a schedule until you attach a schedule to it. Read on for how
|
|
65
65
|
to do that.
|
|
66
66
|
</Note>
|
|
67
67
|
|
|
68
|
-
Like all tasks they
|
|
68
|
+
Like all tasks they have a [maxDuration](/runs/max-duration), they should be placed inside a [/trigger folder](/config/config-file), and you [can configure them](/tasks/overview#defining-a-task).
|
|
69
69
|
|
|
70
70
|
You can set a [TTL](/runs#time-to-live-ttl) on a scheduled task to automatically expire runs that aren't dequeued in time. This is useful when a schedule fires while the previous run is still executing - rather than queueing up stale runs, they'll expire:
|
|
71
71
|
|
|
@@ -142,7 +142,7 @@ To use imperative schedules you need to do two things:
|
|
|
142
142
|
|
|
143
143
|
## Spreading runs with windows
|
|
144
144
|
|
|
145
|
-
|
|
145
|
+
When many schedules share the same cron pattern, such as a daily `0 9 * * *`, they all fire at the same time and load your downstream systems as well as ours. A **window** spreads those runs out: each schedule is assigned a stable time within the window after its cron time, so the load is smoothed while each schedule keeps firing at a predictable, repeatable moment. New schedules use a [60-minute window by default](#default-window).
|
|
146
146
|
|
|
147
147
|
The assigned time is deterministic. A given schedule always lands at the same offset for a given interval, so runs don't jump around between occurrences. And you can always see exactly when the next run will start.
|
|
148
148
|
|
|
@@ -151,7 +151,7 @@ Set a `window` as either:
|
|
|
151
151
|
- **An absolute duration** in whole minutes or hours, up to 24 hours: `"30m"`, `"2h"`, `"24h"`. Absolute windows are capped at the next cron time, so a run is never delayed past its following occurrence.
|
|
152
152
|
- **A percentage** of the interval between runs: `"30%"`, `"100%"`. A `"50%"` window on an hourly schedule spreads runs across the first 30 minutes of each hour.
|
|
153
153
|
|
|
154
|
-
Set `"0m"` (or `"0%"`) for no spreading — the run fires at its exact cron time.
|
|
154
|
+
Set `"0m"` (or `"0%"`) for no spreading — the run fires at its exact cron time. This also overrides the [default window](#default-window).
|
|
155
155
|
|
|
156
156
|
Declarative schedules set the window on the `cron` object:
|
|
157
157
|
|
|
@@ -184,6 +184,12 @@ const createdSchedule = await schedules.create({
|
|
|
184
184
|
is the assigned time the run will actually start.
|
|
185
185
|
</Note>
|
|
186
186
|
|
|
187
|
+
### Default window
|
|
188
|
+
|
|
189
|
+
New schedules get a default 60-minute window unless you set one, so each run starts at a stable time within the hour after its cron time. Like any absolute window, it's capped at the next cron time: a schedule that runs every 15 minutes is spread across those 15 minutes.
|
|
190
|
+
|
|
191
|
+
To opt a new schedule out of the default window, set `window: "0m"`.
|
|
192
|
+
|
|
187
193
|
### Free-plan minimum window
|
|
188
194
|
|
|
189
195
|
Schedules created while an organization is on a free plan run no more than once per hour and use a minimum 60-minute window.
|
package/docs/triggering.mdx
CHANGED
|
@@ -746,6 +746,12 @@ await myTask.batchTrigger([{ payload: { some: "data" }, options: { delay: "1h" }
|
|
|
746
746
|
manually, convert Dates to ISO strings first (e.g., `date.toISOString()`).
|
|
747
747
|
</Note>
|
|
748
748
|
|
|
749
|
+
<Tip>
|
|
750
|
+
A `delay` doesn't merge triggers: each trigger still creates its own run. To collapse a burst of
|
|
751
|
+
triggers into one run, use [`debounce`](#debounce). See [runs.list() best
|
|
752
|
+
practices](/runs/list-best-practices#using-a-fixed-delay-to-space-out-triggers).
|
|
753
|
+
</Tip>
|
|
754
|
+
|
|
749
755
|
### `ttl`
|
|
750
756
|
|
|
751
757
|
You can set a TTL (time to live) when triggering a task, which will automatically expire the run if it hasn't started within the specified time. This is useful for ensuring that a run doesn't get stuck in the queue for too long.
|
|
@@ -814,6 +820,8 @@ export const myTask = task({
|
|
|
814
820
|
});
|
|
815
821
|
```
|
|
816
822
|
|
|
823
|
+
Build the key from the work being done, like an order or event ID. A random value on every trigger never matches, so it never dedupes. See [runs.list() best practices](/runs/list-best-practices#using-a-random-idempotency-key).
|
|
824
|
+
|
|
817
825
|
For more information, see our [Idempotency](/idempotency) documentation.
|
|
818
826
|
|
|
819
827
|
### `idempotencyKeyTTL`
|
|
@@ -243,13 +243,17 @@ This webhook is sent when a run fails. The payload is available on the `object`
|
|
|
243
243
|
</ParamField>
|
|
244
244
|
|
|
245
245
|
<ParamField path="object.environment.type" type="string">
|
|
246
|
-
Environment type (STAGING or
|
|
246
|
+
Environment type (`PRODUCTION`, `STAGING`, or `PREVIEW`)
|
|
247
247
|
</ParamField>
|
|
248
248
|
|
|
249
249
|
<ParamField path="object.environment.slug" type="string">
|
|
250
250
|
Environment slug
|
|
251
251
|
</ParamField>
|
|
252
252
|
|
|
253
|
+
<ParamField path="object.environment.branchName" type="string">
|
|
254
|
+
Environment branch name (optional)
|
|
255
|
+
</ParamField>
|
|
256
|
+
|
|
253
257
|
<ParamField path="object.organization.id" type="string">
|
|
254
258
|
Organization ID
|
|
255
259
|
</ParamField>
|
|
@@ -311,7 +315,7 @@ This webhook is sent when a deployment succeeds. The payload is available on the
|
|
|
311
315
|
</ParamField>
|
|
312
316
|
|
|
313
317
|
<ParamField path="object.environment.type" type="string">
|
|
314
|
-
Environment type (STAGING or
|
|
318
|
+
Environment type (`PRODUCTION`, `STAGING`, or `PREVIEW`)
|
|
315
319
|
</ParamField>
|
|
316
320
|
|
|
317
321
|
<ParamField path="object.environment.slug" type="string">
|
|
@@ -346,6 +350,54 @@ This webhook is sent when a deployment succeeds. The payload is available on the
|
|
|
346
350
|
Project name
|
|
347
351
|
</ParamField>
|
|
348
352
|
|
|
353
|
+
<ParamField path="object.git" type="object">
|
|
354
|
+
Git metadata for the deployment (optional). When present, `branch`, `commitSha`, `commitMessage`, `commitUrl` and `branchUrl` are always set.
|
|
355
|
+
</ParamField>
|
|
356
|
+
|
|
357
|
+
<ParamField path="object.git.branch" type="string">
|
|
358
|
+
Git branch
|
|
359
|
+
</ParamField>
|
|
360
|
+
|
|
361
|
+
<ParamField path="object.git.commitSha" type="string">
|
|
362
|
+
Short commit SHA (first 7 characters)
|
|
363
|
+
</ParamField>
|
|
364
|
+
|
|
365
|
+
<ParamField path="object.git.commitMessage" type="string">
|
|
366
|
+
Commit message (empty string if unavailable)
|
|
367
|
+
</ParamField>
|
|
368
|
+
|
|
369
|
+
<ParamField path="object.git.commitUrl" type="string">
|
|
370
|
+
URL of the commit
|
|
371
|
+
</ParamField>
|
|
372
|
+
|
|
373
|
+
<ParamField path="object.git.branchUrl" type="string">
|
|
374
|
+
URL of the branch
|
|
375
|
+
</ParamField>
|
|
376
|
+
|
|
377
|
+
<ParamField path="object.git.pullRequestNumber" type="number">
|
|
378
|
+
Pull request number (optional)
|
|
379
|
+
</ParamField>
|
|
380
|
+
|
|
381
|
+
<ParamField path="object.git.pullRequestTitle" type="string">
|
|
382
|
+
Pull request title (optional)
|
|
383
|
+
</ParamField>
|
|
384
|
+
|
|
385
|
+
<ParamField path="object.git.pullRequestUrl" type="string">
|
|
386
|
+
Pull request URL (optional)
|
|
387
|
+
</ParamField>
|
|
388
|
+
|
|
389
|
+
<ParamField path="object.git.provider" type="string">
|
|
390
|
+
Git provider (optional)
|
|
391
|
+
</ParamField>
|
|
392
|
+
|
|
393
|
+
<ParamField path="object.vercel" type="object">
|
|
394
|
+
Vercel metadata for the deployment (optional)
|
|
395
|
+
</ParamField>
|
|
396
|
+
|
|
397
|
+
<ParamField path="object.vercel.deploymentUrl" type="string">
|
|
398
|
+
URL of the deployment in the Vercel dashboard
|
|
399
|
+
</ParamField>
|
|
400
|
+
|
|
349
401
|
### Deployment Failed Alert
|
|
350
402
|
|
|
351
403
|
This webhook is sent when a deployment fails. The payload is available on the `object` property:
|
|
@@ -391,7 +443,7 @@ This webhook is sent when a deployment fails. The payload is available on the `o
|
|
|
391
443
|
</ParamField>
|
|
392
444
|
|
|
393
445
|
<ParamField path="object.environment.type" type="string">
|
|
394
|
-
Environment type (STAGING or
|
|
446
|
+
Environment type (`PRODUCTION`, `STAGING`, or `PREVIEW`)
|
|
395
447
|
</ParamField>
|
|
396
448
|
|
|
397
449
|
<ParamField path="object.environment.slug" type="string">
|
|
@@ -426,6 +478,53 @@ This webhook is sent when a deployment fails. The payload is available on the `o
|
|
|
426
478
|
Project name
|
|
427
479
|
</ParamField>
|
|
428
480
|
|
|
481
|
+
<ParamField path="object.git" type="object">
|
|
482
|
+
Git metadata for the deployment (optional). When present, `branch`, `commitSha`, `commitMessage`, `commitUrl` and `branchUrl` are always set.
|
|
483
|
+
</ParamField>
|
|
484
|
+
|
|
485
|
+
<ParamField path="object.git.branch" type="string">
|
|
486
|
+
Git branch
|
|
487
|
+
</ParamField>
|
|
488
|
+
|
|
489
|
+
<ParamField path="object.git.commitSha" type="string">
|
|
490
|
+
Short commit SHA (first 7 characters)
|
|
491
|
+
</ParamField>
|
|
492
|
+
|
|
493
|
+
<ParamField path="object.git.commitMessage" type="string">
|
|
494
|
+
Commit message (empty string if unavailable)
|
|
495
|
+
</ParamField>
|
|
496
|
+
|
|
497
|
+
<ParamField path="object.git.commitUrl" type="string">
|
|
498
|
+
URL of the commit
|
|
499
|
+
</ParamField>
|
|
500
|
+
|
|
501
|
+
<ParamField path="object.git.branchUrl" type="string">
|
|
502
|
+
URL of the branch
|
|
503
|
+
</ParamField>
|
|
504
|
+
|
|
505
|
+
<ParamField path="object.git.pullRequestNumber" type="number">
|
|
506
|
+
Pull request number (optional)
|
|
507
|
+
</ParamField>
|
|
508
|
+
|
|
509
|
+
<ParamField path="object.git.pullRequestTitle" type="string">
|
|
510
|
+
Pull request title (optional)
|
|
511
|
+
</ParamField>
|
|
512
|
+
|
|
513
|
+
<ParamField path="object.git.pullRequestUrl" type="string">
|
|
514
|
+
Pull request URL (optional)
|
|
515
|
+
</ParamField>
|
|
516
|
+
|
|
517
|
+
<ParamField path="object.git.provider" type="string">
|
|
518
|
+
Git provider (optional)
|
|
519
|
+
</ParamField>
|
|
520
|
+
|
|
521
|
+
<ParamField path="object.vercel" type="object">
|
|
522
|
+
Vercel metadata for the deployment (optional)
|
|
523
|
+
</ParamField>
|
|
524
|
+
|
|
525
|
+
<ParamField path="object.vercel.deploymentUrl" type="string">
|
|
526
|
+
URL of the deployment in the Vercel dashboard
|
|
527
|
+
</ParamField>
|
|
429
528
|
|
|
430
529
|
### Error Group Alert
|
|
431
530
|
|
package/docs/troubleshooting.mdx
CHANGED
|
@@ -251,7 +251,7 @@ If runs are staying in the `QUEUED` state for extended periods, check your concu
|
|
|
251
251
|
**Solutions:**
|
|
252
252
|
|
|
253
253
|
- **Increase concurrency limits** - If you're on a paid plan, increase your environment concurrency limit via the dashboard
|
|
254
|
-
- **Review
|
|
254
|
+
- **Review concurrency settings** - Check if your tasks have restrictive `concurrency` settings, or your queues a restrictive legacy `concurrencyLimit`. See [Concurrency](/concurrency)
|
|
255
255
|
- **Check for stuck runs** - See if stalled runs are blocking new executions
|
|
256
256
|
|
|
257
257
|
### Runs queued because a billing limit was reached
|
|
@@ -39,12 +39,12 @@ You can deploy using [GitHub Actions](/github-actions). We recommend that you lo
|
|
|
39
39
|
|
|
40
40
|
<Steps>
|
|
41
41
|
<Step title="Find your workflow file">
|
|
42
|
-
In your `.
|
|
42
|
+
In your `.github/workflows` folder you can find your workflow yml files. You may have a prod
|
|
43
43
|
and staging one.
|
|
44
44
|
</Step>
|
|
45
45
|
<Step title="Update the version for the run command">
|
|
46
46
|
In the steps you'll see a `run` command. It will run the trigger.dev deploy CLI command. Make
|
|
47
|
-
sure to update this version to the latest version (e.g. `npx trigger.dev@
|
|
47
|
+
sure to update this version to the latest version (e.g. `npx trigger.dev@4.7.3 deploy`).
|
|
48
48
|
</Step>
|
|
49
49
|
</Steps>
|
|
50
50
|
|
|
@@ -57,7 +57,7 @@ For example:
|
|
|
57
57
|
```json
|
|
58
58
|
{
|
|
59
59
|
"devDependencies": {
|
|
60
|
-
"trigger.dev": "
|
|
60
|
+
"trigger.dev": "4.7.3"
|
|
61
61
|
}
|
|
62
62
|
}
|
|
63
63
|
```
|
|
@@ -129,7 +129,17 @@ The integration sets this up for you:
|
|
|
129
129
|
- It passes your commit SHA as the deployment's external id.
|
|
130
130
|
- `VERCEL_GIT_COMMIT_SHA` is available at runtime on Vercel, so the SDK finds the matching id with no work from you.
|
|
131
131
|
|
|
132
|
-
There is nothing to enable, and it works in production, staging and preview alike.
|
|
132
|
+
There is nothing to enable, and it works in production, staging and preview alike.
|
|
133
|
+
|
|
134
|
+
### Production waits for your tasks
|
|
135
|
+
|
|
136
|
+
A production deployment from a push to the branch Trigger.dev builds for production gets a blocking **Trigger.dev Build** check. Vercel holds the deployment until the task build for the same commit finishes, then assigns your production domains as usual. If the task build fails or is canceled, the check fails and the Vercel deployment doesn't go live, so your app never ships against tasks that didn't build.
|
|
137
|
+
|
|
138
|
+
If no task build for the commit has started within 10 minutes, the check fails too.
|
|
139
|
+
|
|
140
|
+
To retry after a failed build, re-run the **Trigger.dev deployment** check on the commit in GitHub. Once that build succeeds, redeploy from Vercel or push a new commit.
|
|
141
|
+
|
|
142
|
+
A production deployment with no task build to wait for is never held: its check is marked skipped. That covers deployments from the Vercel CLI, from a branch that isn't your production branch in Trigger.dev, and from projects without a connected GitHub repository. Preview and staging deployments aren't held either: their check passes straight away, and version skew protection makes their runs wait for the matching task build instead.
|
|
133
143
|
|
|
134
144
|
<Note>
|
|
135
145
|
Version skew protection requires the `@trigger.dev/sdk` release that introduces external
|
|
@@ -146,8 +156,8 @@ To opt out, set `TRIGGER_AUTOMATIC_SKEW_VERSION_PROTECTION` to `0` on your Verce
|
|
|
146
156
|
<Warning>
|
|
147
157
|
**Automatic atomic deployments are deprecated.** Use [version skew
|
|
148
158
|
protection](/deployment/atomic-deployment) instead — it needs no second Vercel deployment,
|
|
149
|
-
|
|
150
|
-
|
|
159
|
+
doesn't touch `Auto-assign Custom Production Domains`, and covers staging and preview as well as
|
|
160
|
+
production. Production deployments still wait for your task build through the blocking check.
|
|
151
161
|
|
|
152
162
|
Nothing is being switched off. The setting stays in your project's Vercel settings, keeps working,
|
|
153
163
|
and remains the way to hold your Vercel deployment back until your tasks have built. New
|
package/docs/versioning.mdx
CHANGED
|
@@ -51,7 +51,7 @@ Because your application and your tasks deploy separately, a release of your app
|
|
|
51
51
|
|
|
52
52
|
## Retries and reattempts
|
|
53
53
|
|
|
54
|
-
When a task has an uncaught error it will [retry](/errors-retrying),
|
|
54
|
+
When a task has an uncaught error it will [retry](/errors-retrying), if the task has retries configured (the `retry` option or `retries.default` in your config). Retries are locked to the original version of the run.
|
|
55
55
|
|
|
56
56
|
## Replays
|
|
57
57
|
|
package/docs/wait-for-token.mdx
CHANGED
|
@@ -135,7 +135,7 @@ Create a waitpoint token.
|
|
|
135
135
|
The `createToken` function accepts an object with the following properties:
|
|
136
136
|
|
|
137
137
|
<ParamField query="timeout" type="string" optional>
|
|
138
|
-
The maximum amount of time to wait for the token to be completed.
|
|
138
|
+
The maximum amount of time to wait for the token to be completed. If omitted, the token has no timeout. Accepts a duration string like `"30s"` or `"4w"`, or a `Date`.
|
|
139
139
|
</ParamField>
|
|
140
140
|
|
|
141
141
|
<ParamField query="idempotencyKey" type="string" optional>
|
|
@@ -144,7 +144,7 @@ The `createToken` function accepts an object with the following properties:
|
|
|
144
144
|
</ParamField>
|
|
145
145
|
|
|
146
146
|
<ParamField query="idempotencyKeyTTL" type="string" optional>
|
|
147
|
-
The time to live for the idempotency key.
|
|
147
|
+
The time to live for the idempotency key. If omitted, the key does not expire.
|
|
148
148
|
</ParamField>
|
|
149
149
|
|
|
150
150
|
<ParamField query="tags" type="string[]" optional>
|
|
@@ -380,7 +380,7 @@ The `listTokens` function accepts an object with the following properties:
|
|
|
380
380
|
</ParamField>
|
|
381
381
|
|
|
382
382
|
<ParamField query="period" type="string" optional>
|
|
383
|
-
The period to filter by
|
|
383
|
+
The period to filter by, as a duration string such as `1h`, `1d`, `7d` or `30d`.
|
|
384
384
|
</ParamField>
|
|
385
385
|
|
|
386
386
|
<ParamField query="from" type="Date | number" optional>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@trigger.dev/sdk",
|
|
3
|
-
"version": "4.7.
|
|
3
|
+
"version": "4.7.4",
|
|
4
4
|
"description": "trigger.dev Node.JS SDK",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"publishConfig": {
|
|
@@ -69,7 +69,7 @@
|
|
|
69
69
|
"dependencies": {
|
|
70
70
|
"@opentelemetry/api": "1.9.1",
|
|
71
71
|
"@opentelemetry/semantic-conventions": "1.41.1",
|
|
72
|
-
"@trigger.dev/core": "4.7.
|
|
72
|
+
"@trigger.dev/core": "4.7.4",
|
|
73
73
|
"uncrypto": "^0.1.3"
|
|
74
74
|
},
|
|
75
75
|
"devDependencies": {
|