@trigger.dev/sdk 4.6.4 → 4.7.1
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 -2
- package/dist/commonjs/v3/ai.js +189 -266
- package/dist/commonjs/v3/ai.js.map +1 -1
- package/dist/commonjs/v3/chat-client.js +7 -0
- package/dist/commonjs/v3/chat-client.js.map +1 -1
- package/dist/commonjs/v3/chat-server.d.ts +1 -0
- package/dist/commonjs/v3/chat-server.js +8 -0
- package/dist/commonjs/v3/chat-server.js.map +1 -1
- package/dist/commonjs/v3/chat.d.ts +28 -4
- package/dist/commonjs/v3/chat.js +41 -9
- package/dist/commonjs/v3/chat.js.map +1 -1
- package/dist/commonjs/v3/chatRouteWait.d.ts +21 -0
- package/dist/commonjs/v3/chatRouteWait.js +43 -0
- package/dist/commonjs/v3/chatRouteWait.js.map +1 -0
- package/dist/commonjs/v3/compactionResponse.js +5 -0
- package/dist/commonjs/v3/compactionResponse.js.map +1 -1
- package/dist/commonjs/v3/concurrency-shared.d.ts +13 -0
- package/dist/commonjs/v3/concurrency-shared.js +35 -0
- package/dist/commonjs/v3/concurrency-shared.js.map +1 -0
- package/dist/commonjs/v3/concurrencyLimits.d.ts +73 -0
- package/dist/commonjs/v3/concurrencyLimits.js +166 -0
- package/dist/commonjs/v3/concurrencyLimits.js.map +1 -0
- package/dist/commonjs/v3/index.d.ts +2 -1
- package/dist/commonjs/v3/index.js +3 -1
- package/dist/commonjs/v3/index.js.map +1 -1
- package/dist/commonjs/v3/managedChatResponse.d.ts +44 -0
- package/dist/commonjs/v3/managedChatResponse.js +233 -0
- package/dist/commonjs/v3/managedChatResponse.js.map +1 -0
- package/dist/commonjs/v3/queues.d.ts +31 -0
- package/dist/commonjs/v3/queues.js +31 -0
- package/dist/commonjs/v3/queues.js.map +1 -1
- package/dist/commonjs/v3/shared.d.ts +18 -1
- package/dist/commonjs/v3/shared.js +137 -47
- package/dist/commonjs/v3/shared.js.map +1 -1
- package/dist/commonjs/v3/steeringContext.d.ts +41 -0
- package/dist/commonjs/v3/steeringContext.js +118 -0
- package/dist/commonjs/v3/steeringContext.js.map +1 -0
- package/dist/commonjs/v3/transcriptStorage.d.ts +4 -1
- package/dist/commonjs/v3/transcriptStorage.js +51 -4
- package/dist/commonjs/v3/transcriptStorage.js.map +1 -1
- package/dist/commonjs/version.js +1 -1
- package/dist/esm/v3/ai.d.ts +5 -2
- package/dist/esm/v3/ai.js +189 -266
- package/dist/esm/v3/ai.js.map +1 -1
- package/dist/esm/v3/chat-client.js +7 -0
- package/dist/esm/v3/chat-client.js.map +1 -1
- package/dist/esm/v3/chat-server.d.ts +1 -0
- package/dist/esm/v3/chat-server.js +8 -0
- package/dist/esm/v3/chat-server.js.map +1 -1
- package/dist/esm/v3/chat.d.ts +28 -4
- package/dist/esm/v3/chat.js +41 -9
- package/dist/esm/v3/chat.js.map +1 -1
- package/dist/esm/v3/chatRouteWait.d.ts +21 -0
- package/dist/esm/v3/chatRouteWait.js +40 -0
- package/dist/esm/v3/chatRouteWait.js.map +1 -0
- package/dist/esm/v3/compactionResponse.js +5 -0
- package/dist/esm/v3/compactionResponse.js.map +1 -1
- package/dist/esm/v3/concurrency-shared.d.ts +13 -0
- package/dist/esm/v3/concurrency-shared.js +31 -0
- package/dist/esm/v3/concurrency-shared.js.map +1 -0
- package/dist/esm/v3/concurrencyLimits.d.ts +73 -0
- package/dist/esm/v3/concurrencyLimits.js +158 -0
- package/dist/esm/v3/concurrencyLimits.js.map +1 -0
- package/dist/esm/v3/index.d.ts +2 -1
- package/dist/esm/v3/index.js +2 -1
- package/dist/esm/v3/index.js.map +1 -1
- package/dist/esm/v3/managedChatResponse.d.ts +44 -0
- package/dist/esm/v3/managedChatResponse.js +228 -0
- package/dist/esm/v3/managedChatResponse.js.map +1 -0
- package/dist/esm/v3/queues.d.ts +31 -0
- package/dist/esm/v3/queues.js +31 -0
- package/dist/esm/v3/queues.js.map +1 -1
- package/dist/esm/v3/shared.d.ts +18 -1
- package/dist/esm/v3/shared.js +136 -47
- package/dist/esm/v3/shared.js.map +1 -1
- package/dist/esm/v3/steeringContext.d.ts +41 -0
- package/dist/esm/v3/steeringContext.js +113 -0
- package/dist/esm/v3/steeringContext.js.map +1 -0
- package/dist/esm/v3/transcriptStorage.d.ts +4 -1
- package/dist/esm/v3/transcriptStorage.js +51 -4
- package/dist/esm/v3/transcriptStorage.js.map +1 -1
- package/dist/esm/version.js +1 -1
- package/docs/ai-chat/client-protocol.mdx +3 -1
- package/docs/ai-chat/error-handling.mdx +44 -76
- package/docs/ai-chat/fast-starts.mdx +1 -1
- package/docs/ai-chat/frontend.mdx +27 -21
- package/docs/ai-chat/patterns/branching-conversations.mdx +95 -230
- package/docs/ai-chat/patterns/human-in-the-loop.mdx +166 -164
- package/docs/ai-chat/patterns/tool-result-auditing.mdx +28 -27
- package/docs/ai-chat/patterns/version-upgrades.mdx +4 -4
- package/docs/ai-chat/pending-messages.mdx +19 -5
- package/docs/ai-chat/quick-start.mdx +26 -20
- package/docs/ai-chat/reference.mdx +21 -3
- package/docs/ai-chat/sessions.mdx +1 -1
- package/docs/ai-chat/testing.mdx +16 -4
- package/docs/concurrency.mdx +384 -0
- package/docs/config/config-file.mdx +2 -0
- package/docs/database-connections.mdx +3 -3
- package/docs/deploy-environment-variables.mdx +6 -0
- package/docs/deployment/atomic-deployment.mdx +416 -132
- package/docs/deployment/overview.mdx +2 -2
- package/docs/deployment/preview-branches.mdx +2 -2
- package/docs/github-actions.mdx +26 -16
- package/docs/github-integration.mdx +2 -2
- package/docs/idempotency.mdx +43 -5
- package/docs/introduction.mdx +1 -1
- package/docs/limits.mdx +16 -6
- package/docs/manual-setup.mdx +1 -1
- package/docs/observability/query.mdx +25 -0
- package/docs/queues.mdx +271 -0
- package/docs/reports.mdx +1 -1
- package/docs/runs/priority.mdx +2 -25
- package/docs/self-hosting/env/webapp.mdx +9 -0
- package/docs/self-hosting/kubernetes.mdx +14 -3
- package/docs/tasks/overview.mdx +3 -5
- package/docs/troubleshooting-alerts.mdx +124 -1
- package/docs/troubleshooting.mdx +12 -0
- package/docs/vercel-integration.mdx +6 -7
- package/docs/versioning.mdx +1 -1
- package/docs/writing-tasks-introduction.mdx +2 -1
- package/package.json +2 -2
- package/docs/deployment/version-skew-protection.mdx +0 -492
- package/docs/queue-concurrency.mdx +0 -358
|
@@ -35,7 +35,13 @@ flowchart TD
|
|
|
35
35
|
workers --> reg
|
|
36
36
|
```
|
|
37
37
|
|
|
38
|
-
Each component maps to a top-level key in `values.yaml`: `webapp`, `supervisor`, `postgres`, `redis`, `
|
|
38
|
+
Each component maps to a top-level key in `values.yaml`: `webapp`, `supervisor`, `postgres`, `redis`, `clickhouse`, `s3` (object storage), `s2`, and `registry`. The datastores default to `deploy: true` and run in-cluster; set `deploy: false` with an `external` block to bring your own. The registry is the exception - it defaults to `deploy: false`, so you point it at an external one. Webapp settings live under `webapp`, supervisor settings under `supervisor.config`, and each service takes `extraEnvVars` for anything else.
|
|
39
|
+
|
|
40
|
+
Realtime run subscriptions use the native backend with the configured PostgreSQL, Redis, and ClickHouse services. The chart sets `REALTIME_BACKEND_NATIVE_ENABLED=1` and `REALTIME_BACKEND_DEFAULT=native`; no Electric service is required. These settings are separate from the S2-backed realtime streams configuration.
|
|
41
|
+
|
|
42
|
+
<Warning>
|
|
43
|
+
Before upgrading from a chart that deploys Electric, unset the global `realtimeBackend` feature flag and any organization overrides, or set them to `native`. Both take precedence over the environment default. Values of `electric` or `shadow` still select the Electric backend, which this chart no longer deploys.
|
|
44
|
+
</Warning>
|
|
39
45
|
|
|
40
46
|
## Requirements
|
|
41
47
|
|
|
@@ -91,7 +97,7 @@ Bundled datastores let you run the whole stack with a single command and no exte
|
|
|
91
97
|
--create-namespace
|
|
92
98
|
```
|
|
93
99
|
|
|
94
|
-
The chart deploys the webapp, supervisor, and bundled Postgres, Redis,
|
|
100
|
+
The chart deploys the webapp, supervisor, and bundled Postgres, Redis, ClickHouse, MinIO, and s2-lite. The registry is not deployed by default - configure an external one before deploying tasks.
|
|
95
101
|
</Step>
|
|
96
102
|
|
|
97
103
|
<Step title="Port-forward the webapp">
|
|
@@ -533,9 +539,14 @@ With external datastores, secrets, registry, and authentication in place, you ha
|
|
|
533
539
|
|
|
534
540
|
### Upgrading
|
|
535
541
|
|
|
536
|
-
|
|
542
|
+
Your generated secrets, data volumes, and the bundled ClickHouse are preserved and migrated automatically. Before running `helm upgrade`, complete any prerequisites below that apply to your installation.
|
|
537
543
|
|
|
538
544
|
<AccordionGroup>
|
|
545
|
+
<Accordion title="You upgrade from a chart that deploys Electric">
|
|
546
|
+
Unset the global `realtimeBackend` feature flag and any organization overrides, or set them to `native`, before upgrading. Organization overrides take precedence over the global flag, and the global flag takes precedence over `REALTIME_BACKEND_DEFAULT`.
|
|
547
|
+
|
|
548
|
+
The chart enables native realtime and removes the Electric service. A remaining `electric` or `shadow` flag value directs run subscriptions to that removed service and breaks realtime updates.
|
|
549
|
+
</Accordion>
|
|
539
550
|
<Accordion title="You supply your own secret (secrets.existingSecret)">
|
|
540
551
|
With `secrets.existingSecret` set, the chart reads every key from your Secret and generates none, so any key the app needs must already be present there.
|
|
541
552
|
|
package/docs/tasks/overview.mdx
CHANGED
|
@@ -98,16 +98,14 @@ For more information read [the retrying guide](/errors-retrying).
|
|
|
98
98
|
|
|
99
99
|
It's also worth mentioning that you can [retry a block of code](/errors-retrying) inside your tasks as well.
|
|
100
100
|
|
|
101
|
-
### `queue` options
|
|
101
|
+
### `queue` and `concurrency` options
|
|
102
102
|
|
|
103
|
-
Queues
|
|
103
|
+
Queues control the order your runs execute in, and concurrency limits control how many execute at once: one-at-a-time execution, parallel executions, and more advanced techniques like separate concurrency for different sets of your users. For more information read the [Queues](/queues) and [Concurrency](/concurrency) guides.
|
|
104
104
|
|
|
105
105
|
```ts /trigger/one-at-a-time.ts
|
|
106
106
|
export const oneAtATime = task({
|
|
107
107
|
id: "one-at-a-time",
|
|
108
|
-
|
|
109
|
-
concurrencyLimit: 1,
|
|
110
|
-
},
|
|
108
|
+
concurrency: { total: 1 },
|
|
111
109
|
run: async (payload: any, { ctx }) => {
|
|
112
110
|
//...
|
|
113
111
|
},
|
|
@@ -7,6 +7,14 @@ We support receiving alerts for the following events:
|
|
|
7
7
|
- Run fails
|
|
8
8
|
- Deployment fails
|
|
9
9
|
- Deployment succeeds
|
|
10
|
+
- A new error group appears, regresses, or is unignored
|
|
11
|
+
|
|
12
|
+
The first three are created from the **Alerts** page. The fourth — an **Error group** alert — is created from the **Errors** page instead, but appears in the same Alerts table once created. It behaves quite differently from a run failure alert; see [Error group alerts](#error-group-alerts) below.
|
|
13
|
+
|
|
14
|
+
<Note>
|
|
15
|
+
If you want to be told about **every** run that fails, choose a **run fails** alert. An Error group
|
|
16
|
+
alert will not do this — it deliberately stays quiet once it has alerted on a given error.
|
|
17
|
+
</Note>
|
|
10
18
|
|
|
11
19
|
## How to setup alerts
|
|
12
20
|
|
|
@@ -36,6 +44,37 @@ Click on the triple dot menu on the right side of the table row and select "Disa
|
|
|
36
44
|
</Steps>
|
|
37
45
|
|
|
38
46
|
|
|
47
|
+
## Error group alerts
|
|
48
|
+
|
|
49
|
+
Error group alerts are **issue-based**, not run-based. They are created from the **Errors** page in the dashboard (the "Configure alerts…" button), not from the New alert modal on the Alerts page. Once created they show up in the Alerts table alongside your other alerts, labelled "Error group".
|
|
50
|
+
|
|
51
|
+
An error group is one distinct error — the same error from many runs is a single group, with a status of **Unresolved**, **Resolved** or **Ignored** that you set from the Errors page.
|
|
52
|
+
|
|
53
|
+
### When an error group alert fires
|
|
54
|
+
|
|
55
|
+
The alert only fires when a group's status *changes* in one of these three ways:
|
|
56
|
+
|
|
57
|
+
| Trigger | Meaning |
|
|
58
|
+
| :------ | :------ |
|
|
59
|
+
| New issue | The error has been seen for the first time. |
|
|
60
|
+
| Regression | The group was marked **Resolved**, and the error has occurred again since. |
|
|
61
|
+
| Unignored | The group was **Ignored**, and the ignore condition you set has been breached. |
|
|
62
|
+
|
|
63
|
+
### Why it goes quiet
|
|
64
|
+
|
|
65
|
+
This is the part that surprises people, so it is worth stating plainly:
|
|
66
|
+
|
|
67
|
+
**An Unresolved error group does not alert.** After an error group alert fires, the group is set to Unresolved, and it stays silent no matter how many more times that error occurs. It will only alert again once you mark it **Resolved** (and it then recurs) or **Ignored** (and the ignore condition is breached).
|
|
68
|
+
|
|
69
|
+
This is intentional — one persistently broken task should not flood your Slack channel with a message per failed run. But it means an Error group alert is not a substitute for a run failure alert. If a task has been failing in production for days and you have had no notification, check whether the only alert you have configured is an Error group alert whose group is sitting at Unresolved.
|
|
70
|
+
|
|
71
|
+
### Which alert type should I use?
|
|
72
|
+
|
|
73
|
+
- **"Tell me about every run that fails"** → a **run fails** alert, from the Alerts page. It fires for every run that fails once its retries are exhausted.
|
|
74
|
+
- **"Tell me when something new breaks"** → an **Error group** alert, from the Errors page.
|
|
75
|
+
|
|
76
|
+
The two are complementary, and many teams want both.
|
|
77
|
+
|
|
39
78
|
## Alert webhooks
|
|
40
79
|
|
|
41
80
|
For the alert webhooks you can use the SDK to parse them. Here is an example of how to parse the webhook payload in Remix:
|
|
@@ -69,6 +108,10 @@ export async function action({ request }: ActionFunctionArgs) {
|
|
|
69
108
|
console.log("[Webhook Internal Test] Deployment failed alert webhook received", { event });
|
|
70
109
|
break;
|
|
71
110
|
}
|
|
111
|
+
case "alert.error": {
|
|
112
|
+
console.log("[Webhook Internal Test] Error group alert webhook received", { event });
|
|
113
|
+
break;
|
|
114
|
+
}
|
|
72
115
|
default: {
|
|
73
116
|
console.log("[Webhook Internal Test] Unhandled webhook type", { event });
|
|
74
117
|
}
|
|
@@ -112,7 +155,7 @@ When you create a webhook alert, you'll receive different payloads depending on
|
|
|
112
155
|
</ParamField>
|
|
113
156
|
|
|
114
157
|
<ParamField path="type" type="string">
|
|
115
|
-
The type of alert webhook. One of: `alert.run.failed`, `alert.deployment.success`,
|
|
158
|
+
The type of alert webhook. One of: `alert.run.failed`, `alert.deployment.success`, `alert.deployment.failed`, or `alert.error`
|
|
116
159
|
</ParamField>
|
|
117
160
|
|
|
118
161
|
### Run Failed Alert
|
|
@@ -383,3 +426,83 @@ This webhook is sent when a deployment fails. The payload is available on the `o
|
|
|
383
426
|
Project name
|
|
384
427
|
</ParamField>
|
|
385
428
|
|
|
429
|
+
|
|
430
|
+
### Error Group Alert
|
|
431
|
+
|
|
432
|
+
This webhook is sent for an [error group alert](#error-group-alerts). The payload is available on the `object` property:
|
|
433
|
+
|
|
434
|
+
<ParamField path="object.classification" type="string">
|
|
435
|
+
Why the alert fired. One of: `new_issue`, `regression`, `unignored`
|
|
436
|
+
</ParamField>
|
|
437
|
+
|
|
438
|
+
<ParamField path="object.error.fingerprint" type="string">
|
|
439
|
+
Identifier for the error group
|
|
440
|
+
</ParamField>
|
|
441
|
+
|
|
442
|
+
<ParamField path="object.error.type" type="string">
|
|
443
|
+
Error type
|
|
444
|
+
</ParamField>
|
|
445
|
+
|
|
446
|
+
<ParamField path="object.error.message" type="string">
|
|
447
|
+
Error message
|
|
448
|
+
</ParamField>
|
|
449
|
+
|
|
450
|
+
<ParamField path="object.error.stackTrace" type="string">
|
|
451
|
+
Sample stack trace, if available
|
|
452
|
+
</ParamField>
|
|
453
|
+
|
|
454
|
+
<ParamField path="object.error.firstSeen" type="string">
|
|
455
|
+
When the error was first seen
|
|
456
|
+
</ParamField>
|
|
457
|
+
|
|
458
|
+
<ParamField path="object.error.lastSeen" type="string">
|
|
459
|
+
When the error was last seen
|
|
460
|
+
</ParamField>
|
|
461
|
+
|
|
462
|
+
<ParamField path="object.error.occurrenceCount" type="number">
|
|
463
|
+
Number of occurrences
|
|
464
|
+
</ParamField>
|
|
465
|
+
|
|
466
|
+
<ParamField path="object.error.taskIdentifier" type="string">
|
|
467
|
+
Task the error occurred in
|
|
468
|
+
</ParamField>
|
|
469
|
+
|
|
470
|
+
<ParamField path="object.environment.id" type="string">
|
|
471
|
+
Environment ID
|
|
472
|
+
</ParamField>
|
|
473
|
+
|
|
474
|
+
<ParamField path="object.environment.name" type="string">
|
|
475
|
+
Environment name
|
|
476
|
+
</ParamField>
|
|
477
|
+
|
|
478
|
+
<ParamField path="object.organization.id" type="string">
|
|
479
|
+
Organization ID
|
|
480
|
+
</ParamField>
|
|
481
|
+
|
|
482
|
+
<ParamField path="object.organization.slug" type="string">
|
|
483
|
+
Organization slug
|
|
484
|
+
</ParamField>
|
|
485
|
+
|
|
486
|
+
<ParamField path="object.organization.name" type="string">
|
|
487
|
+
Organization name
|
|
488
|
+
</ParamField>
|
|
489
|
+
|
|
490
|
+
<ParamField path="object.project.id" type="string">
|
|
491
|
+
Project ID
|
|
492
|
+
</ParamField>
|
|
493
|
+
|
|
494
|
+
<ParamField path="object.project.ref" type="string">
|
|
495
|
+
Project reference
|
|
496
|
+
</ParamField>
|
|
497
|
+
|
|
498
|
+
<ParamField path="object.project.slug" type="string">
|
|
499
|
+
Project slug
|
|
500
|
+
</ParamField>
|
|
501
|
+
|
|
502
|
+
<ParamField path="object.project.name" type="string">
|
|
503
|
+
Project name
|
|
504
|
+
</ParamField>
|
|
505
|
+
|
|
506
|
+
<ParamField path="object.dashboardUrl" type="string">
|
|
507
|
+
URL to view the error in the dashboard
|
|
508
|
+
</ParamField>
|
package/docs/troubleshooting.mdx
CHANGED
|
@@ -163,6 +163,18 @@ You need to be on at least these minor versions:
|
|
|
163
163
|
|
|
164
164
|
## Runtime issues
|
|
165
165
|
|
|
166
|
+
### Runs stuck in "Pending version"
|
|
167
|
+
|
|
168
|
+
A run sits in **Pending version** when the version deployed to that environment doesn't contain the run's task, or doesn't contain the queue it was triggered on. The run isn't lost: unless it's pinned to a specific deployment (see the last cause below), it starts automatically once a version containing both is deployed.
|
|
169
|
+
|
|
170
|
+
Usually one of:
|
|
171
|
+
|
|
172
|
+
- **The task isn't in the deployed version.** It was renamed or removed, or the deploy adding it hasn't landed yet. Check the Tasks page for that environment.
|
|
173
|
+
- **The queue doesn't exist in the deployed version.** Overriding `queue` at trigger time only works if a deployed task declares that queue — see [Queues](/queues).
|
|
174
|
+
- **You triggered into the wrong organization, project or environment.** Check the secret key you triggered with belongs to the same place you deployed to.
|
|
175
|
+
- **A later deploy removed or renamed the task or queue while the run was waiting.** Most likely with `delay`. Pin the run to a version to avoid this: `trigger(payload, { delay: "1h", version: "20260227.2" })`. See [version locking](/deployment/overview#version-locking).
|
|
176
|
+
- **The run is pinned to an external deployment id that hasn't arrived.** This is [version skew protection](/deployment/atomic-deployment#waiting-and-expiry), and it behaves differently: only a deployment carrying the matching id releases the run, and it expires after 1 hour if none does.
|
|
177
|
+
|
|
166
178
|
### `Environment variable not found:`
|
|
167
179
|
|
|
168
180
|
Your code is deployed separately from the rest of your app(s) so you need to make sure that you set any environment variables you use in your tasks in the Trigger.dev dashboard. [Read the guide](/deploy-environment-variables).
|
|
@@ -5,7 +5,7 @@ description: "Automatically deploy your tasks whenever you deploy to Vercel."
|
|
|
5
5
|
|
|
6
6
|
## How it works
|
|
7
7
|
|
|
8
|
-
The Vercel integration connects your Vercel project to your Trigger.dev project so that every Vercel deployment automatically triggers a Trigger.dev deployment. It also syncs environment variables from Vercel into Trigger.dev, and sets up [version skew protection](/deployment/
|
|
8
|
+
The Vercel integration connects your Vercel project to your Trigger.dev project so that every Vercel deployment automatically triggers a Trigger.dev deployment. It also syncs environment variables from Vercel into Trigger.dev, and sets up [version skew protection](/deployment/atomic-deployment) so your app and tasks stay in sync.
|
|
9
9
|
|
|
10
10
|
This eliminates the need to manually run the `trigger.dev deploy` command or maintain custom CI/CD workflows for Vercel-based projects.
|
|
11
11
|
|
|
@@ -121,7 +121,7 @@ If you use [Supabase Branching](https://supabase.com/docs/guides/deployment/bran
|
|
|
121
121
|
|
|
122
122
|
## Version skew protection
|
|
123
123
|
|
|
124
|
-
Your Vercel app and your tasks are deployed separately, so there is always a window where a new app can trigger tasks built from older code. [Version skew protection](/deployment/
|
|
124
|
+
Your Vercel app and your tasks are deployed separately, so there is always a window where a new app can trigger tasks built from older code. [Version skew protection](/deployment/atomic-deployment) closes that window: each Trigger.dev deployment is tagged with your commit SHA, your app sends the same SHA when it triggers, and every run is pinned to the deployment built from the same commit. Runs triggered before the task build finishes wait for it rather than running on the previous version.
|
|
125
125
|
|
|
126
126
|
The integration sets this up for you:
|
|
127
127
|
|
|
@@ -145,7 +145,7 @@ To opt out, set `TRIGGER_AUTOMATIC_SKEW_VERSION_PROTECTION` to `0` on your Verce
|
|
|
145
145
|
|
|
146
146
|
<Warning>
|
|
147
147
|
**Automatic atomic deployments are deprecated.** Use [version skew
|
|
148
|
-
protection](/deployment/
|
|
148
|
+
protection](/deployment/atomic-deployment) instead — it needs no second Vercel deployment,
|
|
149
149
|
never gates your app's deploy, doesn't touch `Auto-assign Custom Production Domains`, and covers
|
|
150
150
|
staging and preview as well as production.
|
|
151
151
|
|
|
@@ -193,7 +193,7 @@ Atomic deployments are off by default for new connections. Projects that already
|
|
|
193
193
|
that setting in Vercel or promote deployments yourself.
|
|
194
194
|
</Note>
|
|
195
195
|
|
|
196
|
-
Previously, setting up atomic deployments with Vercel required custom GitHub Actions workflows. The Vercel integration automates this entirely. For
|
|
196
|
+
Previously, setting up atomic deployments with Vercel required custom GitHub Actions workflows. The Vercel integration automates this entirely. For how to move off them, see [legacy atomic deployments](/deployment/atomic-deployment#legacy-atomic-deployments).
|
|
197
197
|
|
|
198
198
|
## Environment mapping
|
|
199
199
|
|
|
@@ -217,7 +217,7 @@ If your Vercel project has a custom environment, you can select which one maps t
|
|
|
217
217
|
|
|
218
218
|
You can configure the following settings per-environment from your project's Vercel settings:
|
|
219
219
|
|
|
220
|
-
- **Atomic deployments** (deprecated): Controls whether Trigger.dev gates and redeploys your Vercel deployment to keep it in sync. Off by default for new connections — use [version skew protection](/deployment/
|
|
220
|
+
- **Atomic deployments** (deprecated): Controls whether Trigger.dev gates and redeploys your Vercel deployment to keep it in sync. Off by default for new connections — use [version skew protection](/deployment/atomic-deployment) instead.
|
|
221
221
|
- **Pull env vars before build**: When enabled, Trigger.dev pulls the latest environment variables from Vercel before each build. Enabled for production, staging, and preview by default.
|
|
222
222
|
- **Discover new env vars**: When enabled, new environment variables found in Vercel that don't yet exist in Trigger.dev are created automatically during builds. Only available for environments that also have env var pulling enabled. Enabled for production, staging, and preview by default.
|
|
223
223
|
|
|
@@ -234,8 +234,7 @@ Disconnecting stops automatic deployments, environment variable syncing, and dep
|
|
|
234
234
|
|
|
235
235
|
## Related
|
|
236
236
|
|
|
237
|
-
- [
|
|
237
|
+
- [Atomic deployments (version skew protection)](/deployment/atomic-deployment)
|
|
238
238
|
- [GitHub integration](/github-integration)
|
|
239
|
-
- [Atomic deploys](/deployment/atomic-deployment) (deprecated for Vercel)
|
|
240
239
|
- [Environment variables](/deploy-environment-variables)
|
|
241
240
|
- [Preview branches](/deployment/preview-branches)
|
package/docs/versioning.mdx
CHANGED
|
@@ -47,7 +47,7 @@ So a task run will continue running on the version it was locked to. We do this
|
|
|
47
47
|
|
|
48
48
|
Every deployment creates a new version of all tasks for that environment.
|
|
49
49
|
|
|
50
|
-
Because your application and your tasks deploy separately, a release of your app can briefly trigger tasks that belong to a different version. [Version skew protection](/deployment/
|
|
50
|
+
Because your application and your tasks deploy separately, a release of your app can briefly trigger tasks that belong to a different version. [Version skew protection](/deployment/atomic-deployment) pins each run to the deployment built from the same commit, once your app sends the id it was deployed with.
|
|
51
51
|
|
|
52
52
|
## Retries and reattempts
|
|
53
53
|
|
|
@@ -15,7 +15,8 @@ Before digging deeper into the details of writing tasks, you should read the [fu
|
|
|
15
15
|
| [Logging](/logging) | View and send logs and traces from your tasks. |
|
|
16
16
|
| [Errors & retrying](/errors-retrying) | How to deal with errors and write reliable tasks. |
|
|
17
17
|
| [Wait](/wait) | Wait for periods of time or for external events to occur before continuing. |
|
|
18
|
-
| [
|
|
18
|
+
| [Queues](/queues) | Control the order your runs execute in. |
|
|
19
|
+
| [Concurrency](/concurrency) | Limit how many runs execute at once: per task, per tenant, or shared across tasks. |
|
|
19
20
|
| [Realtime notifications](/realtime/overview) | Send realtime notifications from your task that you can subscribe to from your backend or frontend. |
|
|
20
21
|
| [Versioning](/versioning) | How versioning works. |
|
|
21
22
|
| [Machines](/machines) | Configure the CPU and RAM of the machine your task runs on |
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@trigger.dev/sdk",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.7.1",
|
|
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.
|
|
72
|
+
"@trigger.dev/core": "4.7.1",
|
|
73
73
|
"uncrypto": "^0.1.3"
|
|
74
74
|
},
|
|
75
75
|
"devDependencies": {
|