@trigger.dev/sdk 4.8.0-webhooks.20261015065339 → 4.8.0

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.
Files changed (53) hide show
  1. package/dist/commonjs/v3/ai.d.ts +69 -2
  2. package/dist/commonjs/v3/ai.js +120 -30
  3. package/dist/commonjs/v3/ai.js.map +1 -1
  4. package/dist/commonjs/v3/query.d.ts +434 -1
  5. package/dist/commonjs/v3/query.js +115 -0
  6. package/dist/commonjs/v3/query.js.map +1 -1
  7. package/dist/commonjs/v3/webhooks.d.ts +19 -5
  8. package/dist/commonjs/v3/webhooks.js +19 -2
  9. package/dist/commonjs/v3/webhooks.js.map +1 -1
  10. package/dist/commonjs/version.js +1 -1
  11. package/dist/esm/v3/ai.d.ts +69 -2
  12. package/dist/esm/v3/ai.js +119 -29
  13. package/dist/esm/v3/ai.js.map +1 -1
  14. package/dist/esm/v3/query.d.ts +434 -1
  15. package/dist/esm/v3/query.js +115 -0
  16. package/dist/esm/v3/query.js.map +1 -1
  17. package/dist/esm/v3/webhooks.d.ts +19 -5
  18. package/dist/esm/v3/webhooks.js +19 -2
  19. package/dist/esm/v3/webhooks.js.map +1 -1
  20. package/dist/esm/version.js +1 -1
  21. package/docs/ai-chat/backend.mdx +12 -3
  22. package/docs/ai-chat/client-protocol.mdx +6 -3
  23. package/docs/ai-chat/patterns/redacting-telemetry.mdx +117 -0
  24. package/docs/ai-chat/reference.mdx +3 -0
  25. package/docs/ai-chat/transcript-storage.mdx +1 -1
  26. package/docs/apikeys.mdx +6 -4
  27. package/docs/cli-runs-commands.mdx +2 -2
  28. package/docs/cli-tasks-commands.mdx +95 -0
  29. package/docs/config/config-file.mdx +58 -0
  30. package/docs/config/extensions/prismaExtension.mdx +4 -4
  31. package/docs/deploy-environment-variables.mdx +23 -0
  32. package/docs/deployment/atomic-deployment.mdx +3 -3
  33. package/docs/deployment/overview.mdx +1 -1
  34. package/docs/deployment/preview-branches.mdx +1 -1
  35. package/docs/github-actions.mdx +3 -3
  36. package/docs/limits.mdx +6 -0
  37. package/docs/manual-setup.mdx +1 -1
  38. package/docs/mcp-tools.mdx +19 -3
  39. package/docs/observability/dashboards.mdx +62 -0
  40. package/docs/runs/max-duration.mdx +4 -0
  41. package/docs/self-hosting/env/supervisor.mdx +1 -0
  42. package/docs/webhooks/channels.mdx +31 -5
  43. package/docs/webhooks/connect.mdx +14 -3
  44. package/docs/webhooks/deliveries.mdx +8 -1
  45. package/docs/webhooks/filters.mdx +39 -2
  46. package/docs/webhooks/human-in-the-loop.mdx +11 -2
  47. package/docs/webhooks/linear.mdx +5 -4
  48. package/docs/webhooks/overview.mdx +16 -0
  49. package/docs/webhooks/session-routing.mdx +11 -2
  50. package/docs/webhooks/slack.mdx +51 -18
  51. package/docs/webhooks/sources.mdx +36 -3
  52. package/docs/webhooks/waiters.mdx +22 -2
  53. package/package.json +3 -2
@@ -205,13 +205,28 @@ export const webhookSources = {
205
205
  secretProvisioning: "provider",
206
206
  };
207
207
  },
208
+ /**
209
+ * Hookdeck relays deliveries from another provider, so `T` is the original provider's event. It
210
+ * verifies `x-hookdeck-signature` (and `x-hookdeck-signature-2` while a secret is being rolled)
211
+ * with the Hookdeck project's signing secret, and dedupes retries on `x-hookdeck-eventid`. Pass
212
+ * `headerPrefix` when the project's header prefix was changed from `x-hookdeck`.
213
+ */
214
+ hookdeck(options) {
215
+ const setupPrompt = webhookSetupPrompts.hookdeck;
216
+ return {
217
+ provider: "hookdeck",
218
+ verifier: { kind: "config", config: webhookProviderConfigs.hookdeck.config(options) },
219
+ secretProvisioning: webhookProviderConfigs.hookdeck.secretProvisioning,
220
+ ...(setupPrompt ? { setupPrompt } : {}),
221
+ };
222
+ },
208
223
  };
209
224
  function producerName(provider) {
210
225
  return provider.replace(/-([a-z0-9])/g, (_, c) => c.toUpperCase());
211
226
  }
212
227
  export const providerProducers = Object.fromEntries(Object.entries(webhookProviderConfigs)
213
228
  // Zoom needs a computed URL-validation response that the hosted ingress does not support yet.
214
- .filter(([provider]) => provider !== "slack" && provider !== "zoom")
229
+ .filter(([provider]) => provider !== "slack" && provider !== "zoom" && provider !== "hookdeck")
215
230
  .map(([provider, entry]) => [
216
231
  producerName(provider),
217
232
  () => {
@@ -250,11 +265,12 @@ export function defineWebhookEndpoint(options) {
250
265
  return { id, source: source.provider };
251
266
  }
252
267
  export function webhook(options) {
253
- const { id, endpoint, onEvent, filter } = options;
268
+ const { id, endpoint, onEvent, filter, ...taskOptions } = options;
254
269
  if (!endpoint?.id) {
255
270
  throw new Error(`webhook("${id}"): an endpoint is required. Declare one with webhooks.endpoint.define() and pass it as { endpoint }.`);
256
271
  }
257
272
  const task = createTask({
273
+ ...taskOptions,
258
274
  id,
259
275
  triggerSource: "webhook",
260
276
  run: async (payload, runOptions) => {
@@ -332,6 +348,7 @@ export const webhooks = {
332
348
  composio: webhookSources.composio,
333
349
  gitlab: webhookSources.gitlab,
334
350
  whatsapp: webhookSources.whatsapp,
351
+ hookdeck: webhookSources.hookdeck,
335
352
  endpoint: { define: defineWebhookEndpoint },
336
353
  waiter: { create: createWebhookWaiter, wait: waitForWebhookWaiter, cancel: cancelWebhookWaiter },
337
354
  };
@@ -1 +1 @@
1
- {"version":3,"file":"webhooks.js","sourceRoot":"","sources":["../../../src/v3/webhooks.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAoBhE,OAAO,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAChD,OAAO,EACL,mBAAmB,EACnB,mBAAmB,EACnB,oBAAoB,GACrB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,UAAU,EAAa,MAAM,aAAa,CAAC;AACpD,OAAO,EACL,qBAAqB,EACrB,oBAAoB,EACpB,oBAAoB,EACpB,8BAA8B,EAC9B,oBAAoB,EACpB,kBAAkB,EAClB,sBAAsB,EACtB,mBAAmB,GAEpB,MAAM,4BAA4B,CAAC;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,CAAC,CAAC;QAExE,kDAAkD;QAClD,OAAO,eAAe,CAAC,SAAS,EAAE,kBAAkB,CAAC,CAAC;IACxD,CAAC;IAAC,OAAO,MAAM,EAAE,CAAC;QAChB,MAAM,IAAI,YAAY,CAAC,+BAA+B,CAAC,CAAC;IAC1D,CAAC;AACH,CAAC;AAED,mDAAmD;AACnD,SAAS,eAAe,CAAC,CAAS,EAAE,CAAS;IAC3C,IAAI,CAAC,CAAC,MAAM,KAAK,CAAC,CAAC,MAAM,EAAE,CAAC;QAC1B,OAAO,KAAK,CAAC;IACf,CAAC;IAED,IAAI,MAAM,GAAG,CAAC,CAAC;IACf,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;QAClC,MAAM,IAAI,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC;IAC9C,CAAC;IACD,OAAO,MAAM,KAAK,CAAC,CAAC;AACtB,CAAC"}
@@ -1,2 +1,2 @@
1
- export const VERSION = "4.8.0-webhooks.20261015065339";
1
+ export const VERSION = "4.8.0";
2
2
  //# sourceMappingURL=version.js.map
@@ -272,7 +272,7 @@ export const myChat = chat.agent({
272
272
  });
273
273
  ```
274
274
 
275
- The managed `streamText` carries the stored prompt's `system`, `model` (resolved through the agent's `registry`), sampling config, and `experimental_telemetry`. Options you pass at the call site win, apart from `system`, which throws when the prompt already set one.
275
+ The managed `streamText` carries the stored prompt's `system`, `model` (resolved through the agent's `registry`), sampling config, and `experimental_telemetry`. AI SDK telemetry is on even without a stored prompt, so model steps and tool calls show in the run trace. Options you pass at the call site win, apart from `system`, which throws when the prompt already set one.
276
276
 
277
277
  `chat.toStreamTextOptions()` remains available for the same job, and is the only option in a [custom agent](#custom-agents), which has no `run` argument to take a bound `streamText` from. A `chat.headStart` route does get one, and there it also owns `messages`, `stopWhen` and `abortSignal`, since the handover depends on them. Pass `{ registry }` when a prompt names a provider-prefixed model, and `{ tools }` when you want HITL tool approvals, so the SDK knows which calls pause on `needsApproval`.
278
278
 
@@ -504,7 +504,7 @@ Two `chat.agent()` options wire an agent to verified inbound webhooks. `events`
504
504
  ```ts
505
505
  import { webhooks } from "@trigger.dev/sdk";
506
506
  import { chat } from "@trigger.dev/sdk/ai";
507
- import { slack, webhookSource } from "@trigger.dev/slack";
507
+ import { appMentions, slack, webhookSource } from "@trigger.dev/slack";
508
508
 
509
509
  const slackEvents = webhooks.endpoint.define({ id: "slack", source: webhookSource() });
510
510
  const stripe = webhooks.endpoint.define({ id: "stripe", source: webhooks.stripe() });
@@ -513,13 +513,22 @@ export const orderEvents = chat.event({
513
513
  id: "order-events",
514
514
  endpoint: stripe,
515
515
  key: "{event.data.object.customer}",
516
+ // invoices always carry a customer; events without one would have no session to go to
517
+ filter: "event.type startsWith 'invoice.'",
516
518
  type: "order.event",
517
519
  });
518
520
 
519
521
  export const myChat = chat.agent({
520
522
  id: "my-chat",
521
523
  events: [orderEvents],
522
- channels: [slack({ id: "support-slack", endpoint: slackEvents, token: process.env.SLACK_BOT_TOKEN! })],
524
+ channels: [
525
+ slack({
526
+ id: "support-slack",
527
+ endpoint: slackEvents,
528
+ token: process.env.SLACK_BOT_TOKEN!,
529
+ startOn: appMentions(),
530
+ }),
531
+ ],
523
532
  onAction: async ({ action }) => {
524
533
  // A verified order-events delivery arrives here as an action.
525
534
  },
@@ -318,12 +318,13 @@ If nothing arrives by the deadline, the server sends `data: [DONE]` and closes.
318
318
 
319
319
  ### Stream format (S2)
320
320
 
321
- The output stream uses [S2](https://s2.dev) under the hood and follows the standard SSE wire format ([WHATWG spec](https://html.spec.whatwg.org/multipage/server-sent-events.html#parsing-an-event-stream)). Three event types arrive on the wire:
321
+ The output stream uses [S2](https://s2.dev) under the hood and follows the standard SSE wire format ([WHATWG spec](https://html.spec.whatwg.org/multipage/server-sent-events.html#parsing-an-event-stream)). Four event types arrive on the wire:
322
322
 
323
323
  | Event | Meaning |
324
324
  | --- | --- |
325
325
  | `batch` | One or more records. The records you actually care about. |
326
326
  | `ping` | Keepalive (~every 5s on idle). Body is `{"timestamp": <ms>}`, and on backends that report it a `tail` (same `{seq_num, timestamp}` shape as a batch tail). The tail is what lets you tell you have caught up to the live edge; if you don't need caught-up detection, ignore the ping. |
327
+ | `error` | The read failed after the stream started, for example while the stream backend restarts. Body is a plain-text reason. The connection then closes **without** `[DONE]`. Treat it like a dropped connection and [resume](#resuming-a-stream) from the last `seq_num` you processed. |
327
328
  | _(no `event:`, just `data: [DONE]`)_ | Stream is closing — server sends this once before EOF. |
328
329
 
329
330
  A `batch` event in raw SSE format looks like this — note the `data` is a single line of JSON, no embedded newlines (per the SSE spec):
@@ -446,7 +447,7 @@ while (true) {
446
447
 
447
448
  ### Self-contained parser (for custom transports)
448
449
 
449
- If you're building a transport in another language or don't want the dependency, here's a complete reader. It handles the SSE framing, the comma-separated `id:` line, batch unwrapping, the inner `body` string, and `ping` / `[DONE]` events:
450
+ If you're building a transport in another language or don't want the dependency, here's a complete reader. It handles the SSE framing, the comma-separated `id:` line, batch unwrapping, the inner `body` string, and `ping` / `error` / `[DONE]` events:
450
451
 
451
452
  ```ts
452
453
  async function* readSessionOut(
@@ -489,6 +490,8 @@ async function* readSessionOut(
489
490
  if (!data) continue;
490
491
 
491
492
  if (eventType === "ping") continue;
493
+ // The read failed mid-stream. Reconnect from your last seq_num.
494
+ if (eventType === "error") throw new Error(`Stream read failed: ${data}`);
492
495
  if (data === "[DONE]") return;
493
496
 
494
497
  if (eventType === "batch") {
@@ -625,7 +628,7 @@ The built-in clients handle this transparently.
625
628
 
626
629
  ### Resuming a stream
627
630
 
628
- If the SSE connection drops, reconnect with the `Last-Event-ID` header set to the **last `record.seq_num` you successfully processed** (decoded from the batch body — not the SSE `id:` line, which is a comma-list internal to S2):
631
+ If the SSE connection drops, or the server sends an `error` event, reconnect with the `Last-Event-ID` header set to the **last `record.seq_num` you successfully processed** (decoded from the batch body, not the SSE `id:` line, which is a comma-list internal to S2):
629
632
 
630
633
  ```
631
634
  GET /realtime/v1/sessions/{sessionId}/out
@@ -0,0 +1,117 @@
1
+ ---
2
+ title: "Redact chat content from traces"
3
+ sidebarTitle: "Redact chat content"
4
+ description: "Stop a chat agent recording user messages and clientData on its spans, turn off AI SDK prompt and response recording, or redact span content with a span processor before it leaves the worker."
5
+ ---
6
+
7
+ A chat agent's run trace records conversation content by default: the user's message, the `clientData` your frontend sends, and, through AI SDK telemetry, the prompts and responses of each model call. This page covers the three controls that change that, and what they don't cover.
8
+
9
+ ## What the run trace records
10
+
11
+ | Span | Content | Control |
12
+ | --- | --- | --- |
13
+ | `chat turn N` | The last user message (`chat.user_message`) and its first 80 characters as the span preview | `telemetry.recordUserMessage` |
14
+ | `chat turn N` | The raw `clientData` (`chat.client_data`) | `telemetry.recordClientData` |
15
+ | `pending message injected` | Messages sent mid-turn (`pending.messages`) | `telemetry.recordUserMessage` |
16
+ | AI SDK model call spans (on by default with the `streamText` from `run`) | Prompt messages, response text, tool calls | `telemetry.recordUserMessage` for the default config, or `experimental_telemetry` on the model call |
17
+ | Any span | Everything above, plus your own attributes and span events | A span processor |
18
+
19
+ ## Stop recording chat content
20
+
21
+ Set `telemetry` on the agent to stop the chat runtime recording the user's message and `clientData` on its spans. Both default to `true`.
22
+
23
+ ```ts /trigger/support-agent.ts
24
+ import { chat } from "@trigger.dev/sdk/ai";
25
+ import { anthropic } from "@ai-sdk/anthropic";
26
+
27
+ export const supportAgent = chat.agent({
28
+ id: "support-agent",
29
+ telemetry: { recordUserMessage: false, recordClientData: false },
30
+ run: async ({ messages, signal, streamText }) =>
31
+ streamText({ model: anthropic("claude-sonnet-4-5"), messages, abortSignal: signal }),
32
+ });
33
+ ```
34
+
35
+ The spans still appear in the trace with their timings and token usage. The turn spans have no preview text. `recordUserMessage: false` also keeps prompts and responses out of the AI SDK spans that the `streamText` passed to `run()` turns on, with or without a prompt stored by `chat.prompt.set()`, and leaves a stored prompt's variables out of the span metadata, unless the call passes its own `experimental_telemetry`.
36
+
37
+ ## Stop the AI SDK recording prompts and responses
38
+
39
+ The `streamText` passed to `run()` turns AI SDK telemetry on, so each model call and tool call is a span in the run trace (pass `experimental_telemetry: { isEnabled: false }` to turn the spans off). If you call `streamText` from `ai` yourself, pass `experimental_telemetry` to get them. Those spans include prompts and responses unless you turn that off with `recordInputs` and `recordOutputs`:
40
+
41
+ ```ts /trigger/support-agent.ts
42
+ import { chat } from "@trigger.dev/sdk/ai";
43
+ import { anthropic } from "@ai-sdk/anthropic";
44
+
45
+ export const supportAgent = chat.agent({
46
+ id: "support-agent",
47
+ telemetry: { recordUserMessage: false, recordClientData: false },
48
+ run: async ({ messages, signal, streamText }) =>
49
+ streamText({
50
+ model: anthropic("claude-sonnet-4-5"),
51
+ messages,
52
+ abortSignal: signal,
53
+ // Replaces the default telemetry config (and chat.prompt.set()'s), so keep isEnabled on
54
+ experimental_telemetry: { isEnabled: true, recordInputs: false, recordOutputs: false },
55
+ }),
56
+ });
57
+ ```
58
+
59
+ If you use `chat.prompt.set()`, your `experimental_telemetry` replaces the one it adds, including the metadata that links each generation to its prompt version. To keep that link, redact with a span processor instead.
60
+
61
+ ## Redact instead of dropping
62
+
63
+ To keep the content but strip sensitive values from it, add a span processor in `trigger.config.ts`. It runs on every span before export, so one processor covers the chat runtime's spans, the AI SDK spans and your own.
64
+
65
+ ```ts trigger.config.ts
66
+ import { defineConfig } from "@trigger.dev/sdk";
67
+ import type { AttributeValue, Attributes } from "@opentelemetry/api";
68
+ import type { SpanProcessor } from "@opentelemetry/sdk-trace-base";
69
+
70
+ const EMAIL = /[\w.+-]+@[\w-]+\.[\w.]+/g;
71
+
72
+ function redact(value: AttributeValue | undefined): AttributeValue | undefined {
73
+ if (typeof value === "string") return value.replace(EMAIL, "[email]");
74
+ // Some attributes are string arrays, like the messages sent mid-turn
75
+ if (Array.isArray(value)) {
76
+ return value.map((item) =>
77
+ typeof item === "string" ? item.replace(EMAIL, "[email]") : item
78
+ ) as AttributeValue;
79
+ }
80
+ return value;
81
+ }
82
+
83
+ function scrub(attributes: Attributes) {
84
+ for (const key of Object.keys(attributes)) attributes[key] = redact(attributes[key]);
85
+ }
86
+
87
+ const redactEmails: SpanProcessor = {
88
+ onStart: () => {},
89
+ onEnding: (span) => {
90
+ scrub(span.attributes);
91
+ for (const event of span.events) scrub(event.attributes ?? {});
92
+ },
93
+ onEnd: () => {},
94
+ forceFlush: async () => {},
95
+ shutdown: async () => {},
96
+ };
97
+
98
+ export default defineConfig({
99
+ project: "<project ref>",
100
+ telemetry: { spanProcessors: [redactEmails] },
101
+ });
102
+ ```
103
+
104
+ Scrubbing every string value, rather than matching attribute names, also catches the turn preview text. See [Span processors](/config/config-file#span-processors) for when each hook runs and which attributes are kept.
105
+
106
+ ## What spans don't cover
107
+
108
+ These controls change the run trace only. Conversation content also reaches the platform in two other places:
109
+
110
+ - **Session streams.** Each message your frontend sends is written to the session's `session.in` stream, and the agent's output to `session.out`. They hold message content for their retention window, and the session view in the dashboard reads from them. See [transcript storage limits](/ai-chat/transcript-storage#guarantees-and-limits).
111
+ - **The run payload.** A chat agent run's payload includes `clientData` as `metadata`, and every `session.in` record carries it too. Send an id in `clientData` and look up the rest in `onPreload` or `run` instead of sending the values themselves.
112
+
113
+ To keep a value off the platform entirely, redact or tokenize it in your frontend or backend before it's sent. The model then sees the redacted value too, unless your tools resolve the tokens.
114
+
115
+ ## Verify it
116
+
117
+ Send a message containing a marker value (an email address, for example), then open the run in the dashboard. Select the `chat turn 1` span and check its properties: the marker is gone, or shows as `[email]` with the span processor above. The span list shows the same redacted preview.
@@ -73,6 +73,7 @@ Options for `chat.agent()`.
73
73
  | `onChatResume` | `(event: ChatResumeEvent) => Promise<void> \| void` | — | Fires right after the run resumes from suspension |
74
74
  | `exitAfterPreloadIdle` | `boolean` | `false` | Exit run after preload idle timeout instead of suspending. See [exitAfterPreloadIdle](/ai-chat/lifecycle-hooks#exitafterpreloadidle) |
75
75
  | `oomMachine` | `MachinePresetName` | — | Fallback machine when an attempt fails with OOM. Setting it enables a single OOM retry on the larger machine. See [OOM resilience](/ai-chat/patterns/oom-resilience) |
76
+ | `telemetry` | `{ recordUserMessage?: boolean; recordClientData?: boolean }` | both `true` | What the chat runtime records on its spans. `recordUserMessage: false` drops the user message and turn preview (`chat.user_message`, `pending.messages`); `recordClientData: false` drops `chat.client_data`. See [Redact chat content from traces](/ai-chat/patterns/redacting-telemetry) |
76
77
 
77
78
  Plus most standard [TaskOptions](/tasks/overview) — `queue`, `machine`, `maxDuration`, **`onWait`**, **`onResume`**, **`onComplete`**, and other lifecycle hooks. Generic `retry` is **not** exposed on `chat.agent`; use `oomMachine` for OOM recovery, or drop down to a raw [`task()`](/ai-chat/custom-agents) if you need richer retry semantics. Standard hooks use the same parameter shapes as on a normal `task()` (including `ctx`).
78
79
 
@@ -589,6 +590,8 @@ export const orderEvents = chat.event({
589
590
  id: "order-events",
590
591
  endpoint: stripe,
591
592
  key: "{event.data.object.customer}",
593
+ // invoices always carry a customer; events without one would have no session to go to
594
+ filter: "event.type startsWith 'invoice.'",
592
595
  type: "order.event",
593
596
  });
594
597
  ```
@@ -226,7 +226,7 @@ A few things to get right:
226
226
  ## Guarantees and limits
227
227
 
228
228
  - Crash recovery of a half-written answer is runtime-owned in every configuration. It comes from the durable session stream, which no application database can reconstruct. A storage holds settled turns; the runtime overlays the recovered tail and hands it to `save` like any other change.
229
- - Bringing your own database does not remove platform custody. Session streams still hold message content for their retention window.
229
+ - Bringing your own database does not remove platform custody. Session streams still hold message content for their retention window. To keep content out of the run trace, see [Redact chat content from traces](/ai-chat/patterns/redacting-telemetry).
230
230
  - The default storage rewrites the whole conversation each turn. A row-per-message storage writes only what changed. That is the reason to plug in your own.
231
231
 
232
232
  ## Migrating from hydrateMessages
package/docs/apikeys.mdx CHANGED
@@ -81,8 +81,10 @@ Access presets define what a key can do. On the Free and Hobby plans only the **
81
81
  | --- | --- |
82
82
  | **Trigger only** | Trigger runs and batches for all or selected tasks. Trigger responses include scoped public access tokens for the runs and batches they create |
83
83
  | **Task operator** | Trigger all or selected tasks and inspect or operate on their runs |
84
- | **Observer** | Read runs, tasks, batches, logs, traces, and queues |
85
- | **Operator** | Observe and operate on runs and queues, and trigger tasks |
84
+ | **Observer** | Read runs, tasks, batches, logs, traces, queues, errors, and webhooks |
85
+ | **Operator** | Observe and operate on runs, queues, errors, and webhooks, and trigger tasks |
86
+ | **Webhooks only** | Read and write [webhooks](/webhooks/overview). Replaying deliveries that trigger tasks and creating webhook waiters require task or waitpoint scopes |
87
+ | **Waitpoints only** | Create, list, and retrieve [waitpoint tokens](/wait-for-token). No task or run access |
86
88
  | **Deploy only** | Deploy versions, sync environment variables, and manage Preview branches |
87
89
  | **Variables only** | Read and write environment variables in this environment |
88
90
  | **No restrictions** | Full access to the environment |
@@ -96,11 +98,11 @@ Set a key in `TRIGGER_ACCESS_TOKEN` to authenticate `trigger deploy` without log
96
98
  <CodeGroup>
97
99
 
98
100
  ```bash npm
99
- TRIGGER_ACCESS_TOKEN="tr_prod_sk_…" npx trigger.dev@latest deploy
101
+ TRIGGER_ACCESS_TOKEN="tr_prod_sk_…" npx trigger.dev@latest deploy --env prod
100
102
  ```
101
103
  </CodeGroup>
102
104
 
103
- The key must belong to the target environment. Use a Production key for the default deployment, a Staging key with `--env staging`, or a key from the Preview environment with `--env preview`. A Preview deployment key can create and archive Preview branches and sync their environment variables.
105
+ The key must belong to the target environment. Use a Production key with `--env prod`, a Staging key with `--env staging`, or a key from the Preview environment with `--env preview`. If you leave out `--env`, the CLI deploys to the key's environment, and a `--env` that doesn't match the key is an error. A Preview deployment key can create and archive Preview branches and sync their environment variables.
104
106
 
105
107
  <Note>
106
108
  The deploy CLI reads environment API keys from `TRIGGER_ACCESS_TOKEN`, not
@@ -84,8 +84,8 @@ npx trigger.dev@latest runs cancel run_abc123
84
84
 
85
85
  <ConfigFileOptions />
86
86
  <ProjectRefOptions />
87
- <ParamField body="Preview branch" type="--branch | -b">
88
- Required when using `--env preview`. Specify the branch, e.g. `--branch my-branch` or `-b my-branch`.
87
+ <ParamField body="Branch" type="--branch | -b">
88
+ Required when using `--env preview`. Specify the branch, e.g. `--branch my-branch` or `-b my-branch`. With `--env dev`, it defaults to the same [dev branch](/deployment/dev-branches) as the dev command.
89
89
  </ParamField>
90
90
 
91
91
  ### Common options
@@ -0,0 +1,95 @@
1
+ ---
2
+ title: "CLI tasks commands"
3
+ sidebarTitle: "tasks"
4
+ description: "Use these commands to trigger tasks from your terminal."
5
+ ---
6
+
7
+ import CommonOptions from "/snippets/cli-options-common.mdx";
8
+ import ConfigFileOptions from "/snippets/cli-options-config-file.mdx";
9
+ import ProjectRefOptions from "/snippets/cli-options-project-ref.mdx";
10
+
11
+ ## tasks trigger
12
+
13
+ Triggers a task and prints the run ID and its dashboard URL. It runs in the `dev` environment unless you pass `--env`, so start the [dev command](/cli-dev-commands) first.
14
+
15
+ <CodeGroup>
16
+
17
+ ```bash npm
18
+ npx trigger.dev@latest tasks trigger hello-world --payload '{"name":"Ada"}'
19
+ ```
20
+
21
+ ```bash pnpm
22
+ pnpm dlx trigger.dev@latest tasks trigger hello-world --payload '{"name":"Ada"}'
23
+ ```
24
+
25
+ ```bash yarn
26
+ yarn dlx trigger.dev@latest tasks trigger hello-world --payload '{"name":"Ada"}'
27
+ ```
28
+
29
+ </CodeGroup>
30
+
31
+ Add `--wait` to wait for the run to finish. It prints the run's output, or its error and exits with code 1 if the run failed, which makes it useful in scripts and for coding agents testing a task:
32
+
33
+ ```bash
34
+ npx trigger.dev@latest tasks trigger hello-world --payload '{"name":"Ada"}' --wait
35
+ ```
36
+
37
+ The command fails without creating a run if the current version has no task with that ID. In `dev`, it warns you when the dev command isn't running, because the run waits in the queue until it starts.
38
+
39
+ <ParamField body="Payload" type="--payload">
40
+ The payload as JSON, e.g. `--payload '{"name":"Ada"}'`. Without it, the task gets no payload.
41
+ </ParamField>
42
+
43
+ <ParamField body="Payload file" type="--payload-file">
44
+ Read the payload from a JSON file instead.
45
+ </ParamField>
46
+
47
+ <ParamField body="Wait" type="--wait">
48
+ Wait for the run to finish, then print its output or error.
49
+ </ParamField>
50
+
51
+ <ParamField body="Timeout" type="--timeout">
52
+ With `--wait`, stop waiting after this many seconds and exit with code 1.
53
+ </ParamField>
54
+
55
+ <ParamField body="Tag" type="--tag">
56
+ A tag to add to the run. Repeat it to add more than one, e.g. `--tag cli --tag test`.
57
+ </ParamField>
58
+
59
+ <ParamField body="Idempotency key" type="--idempotency-key">
60
+ If a run with this key already exists, return it instead of creating a new one. See [idempotency](/idempotency).
61
+ </ParamField>
62
+
63
+ <ParamField body="Delay" type="--delay">
64
+ Wait before running, e.g. `30s`, `5m` or an ISO 8601 date.
65
+ </ParamField>
66
+
67
+ <ParamField body="TTL" type="--ttl">
68
+ Expire the run if it hasn't started within this time, e.g. `10m`.
69
+ </ParamField>
70
+
71
+ <ParamField body="Queue" type="--queue">
72
+ The queue to run in, instead of the queue set on the task.
73
+ </ParamField>
74
+
75
+ <ParamField body="Machine" type="--machine">
76
+ The machine to run on, e.g. `small-2x`. See [machines](/machines). Has no effect in `dev`.
77
+ </ParamField>
78
+
79
+ ## Options
80
+
81
+ <ParamField body="Environment" type="--env | -e">
82
+ The environment to use: `dev`, `prod`, `staging` or `preview`. Defaults to `dev`.
83
+ </ParamField>
84
+
85
+ <ConfigFileOptions />
86
+ <ProjectRefOptions />
87
+ <ParamField body="Branch" type="--branch | -b">
88
+ The branch to use. Required with `--env preview`. In `dev`, it defaults to the same [dev branch](/deployment/dev-branches) as the dev command.
89
+ </ParamField>
90
+
91
+ ### Common options
92
+
93
+ These options are available on most commands.
94
+
95
+ <CommonOptions />
@@ -267,6 +267,64 @@ export default defineConfig({
267
267
  });
268
268
  ```
269
269
 
270
+ ### Span processors
271
+
272
+ Span processors run on every span before it is exported, to Trigger.dev and to any `exporters` you configure. Use them to redact or drop span content before it reaches the run trace.
273
+
274
+ ```ts trigger.config.ts
275
+ import { defineConfig } from "@trigger.dev/sdk";
276
+ import type { AttributeValue, Attributes } from "@opentelemetry/api";
277
+ import type { SpanProcessor } from "@opentelemetry/sdk-trace-base";
278
+
279
+ const EMAIL = /[\w.+-]+@[\w-]+\.[\w.]+/g;
280
+
281
+ function redact(value: AttributeValue | undefined): AttributeValue | undefined {
282
+ if (typeof value === "string") return value.replace(EMAIL, "[email]");
283
+ // Some attributes are string arrays, like the messages sent mid-turn
284
+ if (Array.isArray(value)) {
285
+ return value.map((item) =>
286
+ typeof item === "string" ? item.replace(EMAIL, "[email]") : item
287
+ ) as AttributeValue;
288
+ }
289
+ return value;
290
+ }
291
+
292
+ function scrub(attributes: Attributes) {
293
+ for (const key of Object.keys(attributes)) attributes[key] = redact(attributes[key]);
294
+ }
295
+
296
+ const redactEmails: SpanProcessor = {
297
+ onStart: () => {},
298
+ // The span is complete here and still writable
299
+ onEnding: (span) => {
300
+ scrub(span.attributes);
301
+ for (const event of span.events) scrub(event.attributes ?? {});
302
+ },
303
+ onEnd: () => {},
304
+ forceFlush: async () => {},
305
+ shutdown: async () => {},
306
+ };
307
+
308
+ export default defineConfig({
309
+ project: "<project ref>",
310
+ telemetry: {
311
+ spanProcessors: [redactEmails],
312
+ },
313
+ });
314
+ ```
315
+
316
+ Your processors run ahead of ours, so they also see the in-progress copy of each span that the dashboard shows while a span is open. Redact in `onEnding`:
317
+
318
+ - `onStart` runs before we add the run context, so it sees only the attributes the span was started with.
319
+ - In `onEnd` the span is read-only and `setAttribute` does nothing. Writing to `span.attributes` directly still works.
320
+ - Content can also sit in span events (exceptions, for example). Events are on `span.events`.
321
+
322
+ After each call we restore the few attributes we use to link a span to its run, such as the run, task and attempt ids. Everything else can be redacted, including run tags and idempotency keys. If a processor throws, the error is reported and the span is still exported.
323
+
324
+ <Note>
325
+ Span processors only change span content. Run payloads and outputs, and the messages on a chat agent's session streams, are stored as sent. For chat agents, see [Redact chat content from traces](/ai-chat/patterns/redacting-telemetry).
326
+ </Note>
327
+
270
328
  ## Runtime
271
329
 
272
330
  If you don't set a `runtime`, your tasks run on the current Node.js LTS. Setting `runtime: "node"` does the same thing — see the Node.js versions section below to pin a specific version instead.
@@ -189,7 +189,7 @@ prismaExtension({
189
189
  "scripts": {
190
190
  "prebuild": "prisma generate",
191
191
  "dev": "trigger dev",
192
- "deploy": "trigger deploy"
192
+ "deploy": "trigger deploy --env prod"
193
193
  }
194
194
  }
195
195
  ```
@@ -331,7 +331,7 @@ steps:
331
331
  - name: Generate Prisma client
332
332
  run: npx prisma@6.19.0 generate
333
333
  - name: Deploy Trigger.dev
334
- run: npx trigger.dev@4.1.1 deploy
334
+ run: npx trigger.dev@4.1.1 deploy --env prod
335
335
  env:
336
336
  TRIGGER_ACCESS_TOKEN: ${{ secrets.TRIGGER_ACCESS_TOKEN }}
337
337
  ```
@@ -902,7 +902,7 @@ datasource db {
902
902
  "scripts": {
903
903
  "generate": "prisma generate",
904
904
  "dev": "pnpm generate && trigger dev",
905
- "deploy": "trigger deploy"
905
+ "deploy": "trigger deploy --env prod"
906
906
  }
907
907
  }
908
908
  ```
@@ -975,7 +975,7 @@ export default defineConfig({
975
975
  "scripts": {
976
976
  "generate": "prisma generate",
977
977
  "dev": "pnpm generate && trigger dev",
978
- "deploy": "trigger deploy"
978
+ "deploy": "trigger deploy --env prod"
979
979
  }
980
980
  }
981
981
  ```
@@ -3,6 +3,8 @@ title: "Environment Variables"
3
3
  description: "Any environment variables used in your tasks need to be added so the deployed code will run successfully."
4
4
  ---
5
5
 
6
+ import { RollingOut } from "/snippets/feature-status.jsx";
7
+
6
8
  An environment variable in Node.js is accessed in your code using `process.env.MY_ENV_VAR`.
7
9
 
8
10
  We deploy your tasks and scale them up and down when they are triggered. So any environment variables you use in your tasks need to accessible to us so your code will run successfully.
@@ -43,6 +45,8 @@ When creating an environment variable, you can mark it as a **Secret**. Secret v
43
45
 
44
46
  You can edit an environment variable's values. You cannot edit the key name, you must delete and create a new one.
45
47
 
48
+ <RollingOut flag="allowEmptyEnvironmentVariableValues" />
49
+
46
50
  <Note>
47
51
  An empty string is a valid value. Saving a variable with an empty value stores it as an empty
48
52
  string (your task sees the variable set to `""`), which is different from deleting the variable
@@ -188,6 +192,25 @@ The context object provides:
188
192
 
189
193
  For more information about the context object, see the [Context documentation](/context).
190
194
 
195
+ #### Linking to a run in the dashboard
196
+
197
+ Trigger.dev sets `TRIGGER_DASHBOARD_URL` on every run, in development and deployed environments. Its value is the dashboard's address without a trailing slash, so it also points at your own instance when you self-host. Append `/runs/<runId>` to link to a run:
198
+
199
+ ```ts
200
+ import { task } from "@trigger.dev/sdk";
201
+
202
+ export const reportTask = task({
203
+ id: "report-task",
204
+ run: async (payload, { ctx }) => {
205
+ const runUrl = `${process.env.TRIGGER_DASHBOARD_URL}/runs/${ctx.run.id}`;
206
+
207
+ console.log(`View this run: ${runUrl}`);
208
+ },
209
+ });
210
+ ```
211
+
212
+ The `/runs/<runId>` link checks that the viewer is a member of the run's organization, then redirects to the full run page. If you set your own `TRIGGER_DASHBOARD_URL` environment variable on the project, your value is used instead.
213
+
191
214
  ### Sync env vars from another service
192
215
 
193
216
  There are two ways to pull secrets from another service into Trigger.dev: a native **Secret Sync** (currently [Infisical](https://infisical.com)), or the `syncEnvVars` build extension for any other service.