@trigger.dev/sdk 4.5.0-rc.6 → 4.5.0-rc.7

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 (191) hide show
  1. package/dist/commonjs/v3/ai.d.ts +171 -5
  2. package/dist/commonjs/v3/ai.js +309 -22
  3. package/dist/commonjs/v3/ai.js.map +1 -1
  4. package/dist/commonjs/v3/chat-server.d.ts +8 -0
  5. package/dist/commonjs/v3/chat-server.js +32 -10
  6. package/dist/commonjs/v3/chat-server.js.map +1 -1
  7. package/dist/commonjs/v3/chat-server.test.js +51 -0
  8. package/dist/commonjs/v3/chat-server.test.js.map +1 -1
  9. package/dist/commonjs/v3/createStartSessionAction.test.js +30 -0
  10. package/dist/commonjs/v3/createStartSessionAction.test.js.map +1 -1
  11. package/dist/commonjs/v3/sessions.d.ts +3 -2
  12. package/dist/commonjs/v3/sessions.js +3 -2
  13. package/dist/commonjs/v3/sessions.js.map +1 -1
  14. package/dist/commonjs/version.js +1 -1
  15. package/dist/esm/v3/ai.d.ts +171 -5
  16. package/dist/esm/v3/ai.js +309 -22
  17. package/dist/esm/v3/ai.js.map +1 -1
  18. package/dist/esm/v3/chat-server.d.ts +8 -0
  19. package/dist/esm/v3/chat-server.js +32 -10
  20. package/dist/esm/v3/chat-server.js.map +1 -1
  21. package/dist/esm/v3/chat-server.test.js +51 -0
  22. package/dist/esm/v3/chat-server.test.js.map +1 -1
  23. package/dist/esm/v3/createStartSessionAction.test.js +30 -0
  24. package/dist/esm/v3/createStartSessionAction.test.js.map +1 -1
  25. package/dist/esm/v3/sessions.d.ts +3 -2
  26. package/dist/esm/v3/sessions.js +3 -2
  27. package/dist/esm/v3/sessions.js.map +1 -1
  28. package/dist/esm/version.js +1 -1
  29. package/docs/ai/prompts.mdx +430 -0
  30. package/docs/ai-chat/actions.mdx +115 -0
  31. package/docs/ai-chat/anatomy.mdx +71 -0
  32. package/docs/ai-chat/backend.mdx +817 -0
  33. package/docs/ai-chat/background-injection.mdx +221 -0
  34. package/docs/ai-chat/changelog.mdx +850 -0
  35. package/docs/ai-chat/chat-local.mdx +174 -0
  36. package/docs/ai-chat/client-protocol.mdx +1081 -0
  37. package/docs/ai-chat/compaction.mdx +411 -0
  38. package/docs/ai-chat/custom-agents.mdx +364 -0
  39. package/docs/ai-chat/error-handling.mdx +415 -0
  40. package/docs/ai-chat/fast-starts.mdx +672 -0
  41. package/docs/ai-chat/frontend.mdx +580 -0
  42. package/docs/ai-chat/how-it-works.mdx +230 -0
  43. package/docs/ai-chat/lifecycle-hooks.mdx +530 -0
  44. package/docs/ai-chat/mcp.mdx +101 -0
  45. package/docs/ai-chat/overview.mdx +90 -0
  46. package/docs/ai-chat/patterns/branching-conversations.mdx +284 -0
  47. package/docs/ai-chat/patterns/code-sandbox.mdx +126 -0
  48. package/docs/ai-chat/patterns/database-persistence.mdx +414 -0
  49. package/docs/ai-chat/patterns/human-in-the-loop.mdx +275 -0
  50. package/docs/ai-chat/patterns/large-payloads.mdx +169 -0
  51. package/docs/ai-chat/patterns/oom-resilience.mdx +120 -0
  52. package/docs/ai-chat/patterns/persistence-and-replay.mdx +211 -0
  53. package/docs/ai-chat/patterns/recovery-boot.mdx +230 -0
  54. package/docs/ai-chat/patterns/skills.mdx +221 -0
  55. package/docs/ai-chat/patterns/sub-agents.mdx +383 -0
  56. package/docs/ai-chat/patterns/tool-result-auditing.mdx +148 -0
  57. package/docs/ai-chat/patterns/trusted-edge-signals.mdx +337 -0
  58. package/docs/ai-chat/patterns/version-upgrades.mdx +172 -0
  59. package/docs/ai-chat/pending-messages.mdx +343 -0
  60. package/docs/ai-chat/prompt-caching.mdx +206 -0
  61. package/docs/ai-chat/quick-start.mdx +161 -0
  62. package/docs/ai-chat/reference.mdx +909 -0
  63. package/docs/ai-chat/server-chat.mdx +263 -0
  64. package/docs/ai-chat/sessions.mdx +333 -0
  65. package/docs/ai-chat/testing.mdx +682 -0
  66. package/docs/ai-chat/tools.mdx +191 -0
  67. package/docs/ai-chat/types.mdx +242 -0
  68. package/docs/ai-chat/upgrade-guide.mdx +515 -0
  69. package/docs/apikeys.mdx +54 -0
  70. package/docs/building-with-ai.mdx +261 -0
  71. package/docs/bulk-actions.mdx +49 -0
  72. package/docs/changelog.mdx +6 -0
  73. package/docs/cli-deploy-commands.mdx +9 -0
  74. package/docs/cli-dev-commands.mdx +9 -0
  75. package/docs/cli-dev.mdx +8 -0
  76. package/docs/cli-init-commands.mdx +58 -0
  77. package/docs/cli-introduction.mdx +25 -0
  78. package/docs/cli-list-profiles-commands.mdx +42 -0
  79. package/docs/cli-login-commands.mdx +33 -0
  80. package/docs/cli-logout-commands.mdx +33 -0
  81. package/docs/cli-preview-archive.mdx +59 -0
  82. package/docs/cli-promote-commands.mdx +9 -0
  83. package/docs/cli-switch.mdx +43 -0
  84. package/docs/cli-update-commands.mdx +42 -0
  85. package/docs/cli-whoami-commands.mdx +33 -0
  86. package/docs/community.mdx +6 -0
  87. package/docs/config/config-file.mdx +602 -0
  88. package/docs/config/extensions/additionalFiles.mdx +38 -0
  89. package/docs/config/extensions/additionalPackages.mdx +40 -0
  90. package/docs/config/extensions/aptGet.mdx +34 -0
  91. package/docs/config/extensions/audioWaveform.mdx +20 -0
  92. package/docs/config/extensions/custom.mdx +380 -0
  93. package/docs/config/extensions/emitDecoratorMetadata.mdx +29 -0
  94. package/docs/config/extensions/esbuildPlugin.mdx +31 -0
  95. package/docs/config/extensions/ffmpeg.mdx +45 -0
  96. package/docs/config/extensions/lightpanda.mdx +56 -0
  97. package/docs/config/extensions/overview.mdx +67 -0
  98. package/docs/config/extensions/playwright.mdx +195 -0
  99. package/docs/config/extensions/prismaExtension.mdx +1014 -0
  100. package/docs/config/extensions/puppeteer.mdx +30 -0
  101. package/docs/config/extensions/pythonExtension.mdx +182 -0
  102. package/docs/config/extensions/syncEnvVars.mdx +291 -0
  103. package/docs/context.mdx +235 -0
  104. package/docs/database-connections.mdx +213 -0
  105. package/docs/deploy-environment-variables.mdx +435 -0
  106. package/docs/deployment/atomic-deployment.mdx +172 -0
  107. package/docs/deployment/overview.mdx +257 -0
  108. package/docs/deployment/preview-branches.mdx +224 -0
  109. package/docs/errors-retrying.mdx +379 -0
  110. package/docs/github-actions.mdx +222 -0
  111. package/docs/github-integration.mdx +136 -0
  112. package/docs/github-repo.mdx +8 -0
  113. package/docs/help-email.mdx +6 -0
  114. package/docs/help-slack.mdx +11 -0
  115. package/docs/hidden-tasks.mdx +56 -0
  116. package/docs/how-it-works.mdx +454 -0
  117. package/docs/how-to-reduce-your-spend.mdx +217 -0
  118. package/docs/idempotency.mdx +504 -0
  119. package/docs/introduction.mdx +223 -0
  120. package/docs/limits.mdx +241 -0
  121. package/docs/logging.mdx +195 -0
  122. package/docs/machines.mdx +952 -0
  123. package/docs/manual-setup.mdx +632 -0
  124. package/docs/mcp-agent-rules.mdx +41 -0
  125. package/docs/mcp-introduction.mdx +385 -0
  126. package/docs/mcp-tools.mdx +273 -0
  127. package/docs/migrating-from-v3.mdx +334 -0
  128. package/docs/observability/dashboards.mdx +102 -0
  129. package/docs/observability/query.mdx +585 -0
  130. package/docs/open-source-contributing.mdx +16 -0
  131. package/docs/open-source-self-hosting.mdx +541 -0
  132. package/docs/private-networking/aws-console-setup.mdx +304 -0
  133. package/docs/private-networking/overview.mdx +144 -0
  134. package/docs/private-networking/troubleshooting.mdx +78 -0
  135. package/docs/queue-concurrency.mdx +354 -0
  136. package/docs/quick-start.mdx +97 -0
  137. package/docs/realtime/auth.mdx +208 -0
  138. package/docs/realtime/backend/overview.mdx +45 -0
  139. package/docs/realtime/backend/streams.mdx +418 -0
  140. package/docs/realtime/backend/subscribe.mdx +225 -0
  141. package/docs/realtime/how-it-works.mdx +94 -0
  142. package/docs/realtime/overview.mdx +63 -0
  143. package/docs/realtime/react-hooks/overview.mdx +73 -0
  144. package/docs/realtime/react-hooks/streams.mdx +449 -0
  145. package/docs/realtime/react-hooks/subscribe.mdx +674 -0
  146. package/docs/realtime/react-hooks/swr.mdx +87 -0
  147. package/docs/realtime/react-hooks/triggering.mdx +194 -0
  148. package/docs/realtime/react-hooks/use-wait-token.mdx +34 -0
  149. package/docs/realtime/run-object.mdx +174 -0
  150. package/docs/replaying.mdx +72 -0
  151. package/docs/request-feature.mdx +6 -0
  152. package/docs/roadmap.mdx +6 -0
  153. package/docs/run-tests.mdx +20 -0
  154. package/docs/run-usage.mdx +113 -0
  155. package/docs/runs/heartbeats.mdx +38 -0
  156. package/docs/runs/max-duration.mdx +139 -0
  157. package/docs/runs/metadata.mdx +734 -0
  158. package/docs/runs/priority.mdx +31 -0
  159. package/docs/runs.mdx +396 -0
  160. package/docs/self-hosting/docker.mdx +458 -0
  161. package/docs/self-hosting/env/supervisor.mdx +74 -0
  162. package/docs/self-hosting/env/webapp.mdx +276 -0
  163. package/docs/self-hosting/kubernetes.mdx +601 -0
  164. package/docs/self-hosting/overview.mdx +108 -0
  165. package/docs/skills.mdx +85 -0
  166. package/docs/tags.mdx +120 -0
  167. package/docs/tasks/overview.mdx +697 -0
  168. package/docs/tasks/scheduled.mdx +382 -0
  169. package/docs/tasks/schemaTask.mdx +413 -0
  170. package/docs/tasks/streams.mdx +884 -0
  171. package/docs/triggering.mdx +1320 -0
  172. package/docs/troubleshooting-alerts.mdx +385 -0
  173. package/docs/troubleshooting-debugging-in-vscode.mdx +8 -0
  174. package/docs/troubleshooting-github-issues.mdx +6 -0
  175. package/docs/troubleshooting-uptime-status.mdx +6 -0
  176. package/docs/troubleshooting.mdx +398 -0
  177. package/docs/upgrading-packages.mdx +80 -0
  178. package/docs/vercel-integration.mdx +207 -0
  179. package/docs/versioning.mdx +56 -0
  180. package/docs/video-walkthrough.mdx +23 -0
  181. package/docs/wait-for-token.mdx +540 -0
  182. package/docs/wait-for.mdx +42 -0
  183. package/docs/wait-until.mdx +53 -0
  184. package/docs/wait.mdx +18 -0
  185. package/docs/writing-tasks-introduction.mdx +33 -0
  186. package/package.json +8 -5
  187. package/skills/trigger-authoring-chat-agent/SKILL.md +296 -0
  188. package/skills/trigger-authoring-tasks/SKILL.md +254 -0
  189. package/skills/trigger-chat-agent-advanced/SKILL.md +368 -0
  190. package/skills/trigger-cost-savings/SKILL.md +116 -0
  191. package/skills/trigger-realtime-and-frontend/SKILL.md +276 -0
@@ -0,0 +1,304 @@
1
+ ---
2
+ title: "Setting up PrivateLink in the AWS Console"
3
+ sidebarTitle: "AWS Console setup"
4
+ description: "Step-by-step guide for exposing a resource from your AWS account to Trigger.dev via PrivateLink."
5
+ ---
6
+
7
+ This guide walks through setting up the AWS side of a private connection: a Network Load Balancer (NLB), a target group pointing at the resource you want to expose, and a VPC Endpoint Service that authorizes Trigger.dev to consume it.
8
+
9
+ <Info>
10
+ Prefer Terraform? Open the "Add connection" page in the Trigger.dev dashboard and use the
11
+ Terraform wizard to generate a ready-to-apply script. The wizard creates everything described
12
+ below and pre-fills our AWS account ID for you.
13
+ </Info>
14
+
15
+ ## Prerequisites
16
+
17
+ Before you start you'll need:
18
+
19
+ - An **AWS account** with permission to create VPC, EC2, and ELB resources
20
+ - A **resource** in a VPC subnet that you want to expose (RDS instance, ElastiCache cluster, internal API, etc.)
21
+ - The **Trigger.dev AWS account ID** — find this on the "Add connection" page in your Trigger.dev dashboard, in the "I have my details" or "Step-by-step guide" cards
22
+ - A **VPC** that contains the resource, with at least one private subnet per Availability Zone you want to serve from
23
+
24
+ <Note>
25
+ PrivateLink connections are zonal. If your resource lives in a single AZ, your connection will
26
+ only be available from that AZ. For higher availability, ensure target groups can route to
27
+ multiple AZs.
28
+ </Note>
29
+
30
+ ## Step 1: Create a target group pointing at your resource
31
+
32
+ The target group is how the NLB will know where to forward traffic. AWS requires a target group when creating a load balancer, so we'll set this up first.
33
+
34
+ <Steps>
35
+ <Step title="Open the target groups page">
36
+ Go to **EC2 → Target Groups → Create target group**.
37
+ </Step>
38
+ <Step title="Choose a target type">
39
+ - **IP addresses** for RDS, ElastiCache, or any resource you can reach by IP
40
+ - **Instances** for EC2 instances you own
41
+ - **Application Load Balancer** if your resource sits behind an ALB
42
+
43
+ For most database use cases, **IP addresses** is correct. NLBs don't support Lambda targets
44
+ directly — if you need to expose a Lambda, put it behind an ALB and use the ALB target type.
45
+
46
+ </Step>
47
+ <Step title="Configure the target group (first step of the AWS form)">
48
+ On the **Specify group details** page (the first of two steps in AWS's target-group form), set:
49
+
50
+ - **Name**: e.g. `trigger-postgres-tg`
51
+ - **Protocol**: TCP
52
+ - **Port**: the port your resource listens on (5432 for Postgres, 6379 for Redis, 3306 for MySQL, etc.)
53
+ - **VPC**: the VPC where your resource lives (this must match the VPC you'll use for the NLB)
54
+ - **Health check protocol**: TCP
55
+
56
+ Click **Next** to move to the second step (registering targets).
57
+
58
+ ![Target group first step — basic configuration](/images/priv-connections-target-group-first-step.png)
59
+
60
+ </Step>
61
+ <Step title="Register your targets (second step of the AWS form)">
62
+ On the **Register targets** page — the second step of the IP target-group flow — paste the
63
+ private IPs of your resource and set the port to the same value you picked above. Click
64
+ **Include as pending below**, then **Create target group**.
65
+
66
+ ![Register targets in the target group](/images/priv-connections-target-group-register-listeners.png)
67
+
68
+ <Expandable title="How to find the IP for an ElastiCache or RDS instance (no bastion needed)">
69
+ Both ElastiCache and RDS expose a DNS endpoint, not an IP, on their console pages. Find the
70
+ private IP behind the endpoint via the EC2 console:
71
+
72
+ 1. Open **EC2 → Network & Security → Network Interfaces**.
73
+ 2. In the search bar, filter by **Description** with `ElastiCache` (or `RDSNetworkInterface`
74
+ for RDS). Optionally narrow further by **VPC ID** if you have several clusters.
75
+ 3. Read the **Primary private IPv4 address** column — that's the IP to register here. For
76
+ multi-node clusters or read replicas, each node has its own ENI and IP.
77
+
78
+ You can also reach the same list from **VPC → Subnets → \<your-subnet\> → Network
79
+ Interfaces tab**, which scopes the list to a single subnet.
80
+ </Expandable>
81
+
82
+ <Warning>
83
+ RDS and ElastiCache endpoints' IP addresses can change after failover or maintenance. For long-lived
84
+ connections, consider running a small Lambda or sidecar that periodically resolves the DNS name and
85
+ updates the target group, or use a [DNS-resolved](https://aws.amazon.com/blogs/networking-and-content-delivery/hostname-as-target-for-network-load-balancers/)
86
+ target if your setup supports it.
87
+ </Warning>
88
+
89
+ </Step>
90
+ </Steps>
91
+
92
+ ## Step 2: Create an internal Network Load Balancer
93
+
94
+ The NLB is what PrivateLink exposes to Trigger.dev. It must be **internal** (not internet-facing).
95
+
96
+ <Steps>
97
+ <Step title="Open the EC2 console">
98
+ Go to **EC2 → Load Balancers → Create load balancer** and choose **Network Load Balancer**.
99
+ </Step>
100
+ <Step title="Configure the basics">
101
+ - **Name**: something descriptive, e.g. `trigger-postgres-nlb`
102
+ - **Scheme**: **Internal**
103
+ - **IP address type**: IPv4
104
+
105
+ ![Network Load Balancer basic configuration](/images/priv-connections-network-load-balancer-basic.png)
106
+
107
+ </Step>
108
+ <Step title="Choose VPC and subnets">
109
+ Pick the same VPC as your target group. Select one private subnet per AZ that should serve traffic.
110
+ Each subnet you select adds an availability zone to the endpoint.
111
+
112
+ ![Network Load Balancer VPC and Availability Zones](/images/priv-connections-network-load-balancer-vpc-az.png)
113
+
114
+ </Step>
115
+ <Step title="Add a TCP listener forwarding to your target group">
116
+ Under **Listeners and routing**, configure:
117
+
118
+ - **Protocol**: TCP
119
+ - **Port**: same as your target group port (5432 for Postgres, 6379 for Redis, etc.)
120
+ - **Default action**: forward to the target group you created in Step 1
121
+
122
+ ![Add the target group to the NLB listener](/images/priv-connections-network-load-balancer-add-target-group.png)
123
+
124
+ </Step>
125
+ <Step title="Create the load balancer and wait until it's Active">
126
+ Click **Create load balancer**. Provisioning takes 1–2 minutes — wait until the NLB's **State**
127
+ column shows **Active** before moving on. The endpoint service in the next step won't list the
128
+ NLB until it's fully active.
129
+ </Step>
130
+ <Step title="Disable PrivateLink inbound rules enforcement on the NLB">
131
+ Once the NLB is **Active**, open it and go to its **Security** tab, then click **Edit**. If a
132
+ security group is attached, AWS enables **Enforce inbound rules on PrivateLink traffic** by
133
+ default — leaving it on can cause traffic from the Trigger.dev VPC Endpoint to be silently
134
+ dropped before reaching your listener. Uncheck **Enforce inbound rules on PrivateLink traffic**
135
+ and save.
136
+
137
+ ![Uncheck Enforce inbound rules on PrivateLink traffic on the NLB](/images/priv-connections-nlb-disable-inbound-rules-options.png)
138
+
139
+ </Step>
140
+ </Steps>
141
+
142
+ <Tip>
143
+ Test connectivity from a bastion host or another instance in the same VPC before continuing —
144
+ e.g. `psql -h <nlb-dns-name> -p 5432 -U user -d db`. If the NLB can't reach your resource, the
145
+ PrivateLink connection won't either.
146
+ </Tip>
147
+
148
+ ## Step 3: Create a VPC Endpoint Service
149
+
150
+ This is the resource that PrivateLink consumers connect to.
151
+
152
+ <Note>
153
+ Confirm the NLB from Step 2 is in the **Active** state before starting this step. It won't appear
154
+ in the **Available load balancers** dropdown until it has finished provisioning.
155
+ </Note>
156
+
157
+ <Steps>
158
+ <Step title="Open the VPC console">
159
+ Go to **VPC → Endpoint services → Create endpoint service**.
160
+ </Step>
161
+ <Step title="Configure the endpoint service">
162
+ - **Name**: optional, but useful for identification, e.g. `trigger-postgres-endpoint`
163
+ - **Load balancer type**: Network
164
+ - **Available load balancers**: select the NLB you created
165
+ - **Require acceptance for endpoint**: **No** (recommended)
166
+
167
+ ![Create VPC Endpoint Service form](/images/priv-connections-create-endpoint-service.png)
168
+
169
+ <Note>
170
+ If you set "Require acceptance" to **Yes**, every connection request from Trigger.dev will
171
+ sit in a pending state until you manually approve it. Setting it to **No** lets connections
172
+ come up automatically once the principal is allow-listed.
173
+ </Note>
174
+
175
+ </Step>
176
+ <Step title="Skip private DNS">
177
+ Leave the "Private DNS name" option disabled. Trigger.dev tasks dial the endpoint by its
178
+ private IP, so private DNS isn't needed.
179
+ </Step>
180
+ <Step title="Configure cross-region access (optional)">
181
+ If your Trigger.dev tasks run in a **different AWS region** from your endpoint service, expand
182
+ the **Supported Regions** section and add the region(s) where Trigger.dev should be allowed to
183
+ create the VPC Endpoint from (for example, add `eu-central-1` if your service is in
184
+ `us-east-1` but tasks run in `eu-central-1`).
185
+
186
+ If your tasks and resource are in the same region, you can skip this — same-region access is
187
+ enabled by default.
188
+
189
+ <Note>
190
+ Cross-region PrivateLink adds AWS data-transfer cost and ~10–30ms of latency depending on the
191
+ region pair. Prefer same-region when possible.
192
+ </Note>
193
+
194
+ </Step>
195
+ <Step title="Create the endpoint service">
196
+ Click **Create**. The service is created immediately — you'll come back to copy its **Service
197
+ name** once you've authorized Trigger.dev in the next step.
198
+ </Step>
199
+ </Steps>
200
+
201
+ ## Step 4: Authorize the Trigger.dev AWS account
202
+
203
+ By default, no one can connect to your endpoint service. You need to explicitly allow Trigger.dev's AWS account.
204
+
205
+ <Steps>
206
+ <Step title="Open your endpoint service">
207
+ Go to **VPC → Endpoint services**, select the service you just created.
208
+ </Step>
209
+ <Step title="Open the Allow principals tab">
210
+ Click the **Allow principals** tab, then **Allow principals**.
211
+ </Step>
212
+ <Step title="Add Trigger.dev's account">
213
+ Paste the principal ARN in this format, replacing `<account-id>` with the Trigger.dev AWS
214
+ account ID shown in your dashboard:
215
+
216
+ ```text
217
+ arn:aws:iam::<account-id>:root
218
+ ```
219
+
220
+ ![Allow principal dialog](/images/priv-connections-allow-principal.png)
221
+
222
+ <Warning>
223
+ You will find the correct AWS account ID in the **Add connection** page of the Trigger.dev
224
+ dashboard. Do not assume an account ID — it differs between Trigger.dev environments.
225
+ </Warning>
226
+
227
+ </Step>
228
+ <Step title="Click Allow principals">
229
+ The principal is now authorized to create a VPC Endpoint targeting your service.
230
+ </Step>
231
+ <Step title="Copy the endpoint service name">
232
+ On the endpoint service detail page, copy the **Service name** value — it looks like
233
+ `com.amazonaws.vpce.us-east-1.vpce-svc-0123abcd...`. You'll paste this into the Trigger.dev
234
+ dashboard in the next step.
235
+
236
+ ![Copy the endpoint service name](/images/priv-connections-copy-endpoint-name.png)
237
+
238
+ </Step>
239
+ </Steps>
240
+
241
+ ## Step 5: Add the connection in Trigger.dev
242
+
243
+ <Steps>
244
+ <Step title="Open the dashboard">
245
+ In Trigger.dev, go to **Organization Settings → Private Connections** and click **Add
246
+ connection**.
247
+ </Step>
248
+ <Step title="Pick the I have my details card">
249
+ Then fill in:
250
+
251
+ - **Friendly name**: a short, human-readable label for this connection.
252
+ - **VPC Endpoint Service name**: paste the `com.amazonaws.vpce.<region>.vpce-svc-...` value from Step 4.
253
+ - **Target region**: the AWS region your endpoint service lives in.
254
+
255
+ </Step>
256
+ <Step title="Submit">
257
+ Submit the form. The connection's status moves through **Pending → Provisioning → Active**.
258
+ Provisioning typically takes 30–90 seconds.
259
+ </Step>
260
+ <Step title="Verify">
261
+ Once **Active**, the dashboard shows the assigned private IP. Plug it into the
262
+ connection-string environment variable your task already uses (for example, `DATABASE_URL` set
263
+ on the **Environment Variables** page) and your tasks will reach the resource over
264
+ PrivateLink.
265
+ </Step>
266
+ </Steps>
267
+
268
+ ## Troubleshooting
269
+
270
+ See the dedicated [Troubleshooting](/private-networking/troubleshooting) page for common problems
271
+ such as the "Private link not found" wizard error. A few quick checks specific to this setup flow:
272
+
273
+ <Expandable title="Status stays at Pending or Provisioning for several minutes">
274
+ - Confirm Trigger.dev's AWS account ID is in your endpoint service's **Allow principals** list.
275
+ - Confirm the endpoint service is **Available** in the AWS console.
276
+ - Confirm "Require acceptance" is set to **No** on the endpoint service. If it's set to **Yes**,
277
+ the request is sitting in your pending queue and you must approve it manually.
278
+ </Expandable>
279
+
280
+ <Expandable title="Status is Active but my task can't connect">
281
+ - Confirm the NLB has a target registered and the target's health check is passing.
282
+ - Confirm the listener port matches the port your task code is dialing.
283
+ - Confirm the security group on your resource allows inbound traffic from the NLB or the VPC's
284
+ private IP range.
285
+ - If the NLB itself has a security group attached, turn off **Enforce inbound rules on
286
+ PrivateLink traffic** on the load balancer. See [the troubleshooting
287
+ page](/private-networking/troubleshooting#connection-is-active-but-the-assigned-ip-is-not-reachable-from-tasks)
288
+ for details.
289
+ - Try connecting from inside the VPC first (e.g., a bastion host) to rule out resource-side
290
+ issues.
291
+ </Expandable>
292
+
293
+ <Expandable title="Connection works but is slow">
294
+ - Cross-region connections add ~10–30ms RTT depending on the regions involved. If your tasks run
295
+ in a different region than your resource, expect higher latency.
296
+ - The NLB and target group's health checks influence connection setup time. Tighter health check
297
+ intervals reduce failover time after a backend goes unhealthy.
298
+ </Expandable>
299
+
300
+ <Expandable title="I want to remove a connection">
301
+ Delete the connection from **Organization Settings → Private Connections** in the Trigger.dev
302
+ dashboard. We'll tear down our VPC Endpoint and remove the network policy automatically. You can
303
+ then delete your VPC Endpoint Service, NLB, and target group on the AWS side.
304
+ </Expandable>
@@ -0,0 +1,144 @@
1
+ ---
2
+ title: "Private networking"
3
+ sidebarTitle: "Overview"
4
+ description: "Connect your tasks to private resources in your AWS account using AWS PrivateLink."
5
+ ---
6
+
7
+ Private networking lets your Trigger.dev tasks reach databases, caches, and internal APIs that live inside your own AWS VPC, without exposing them to the public internet. Connectivity is established over [AWS PrivateLink](https://docs.aws.amazon.com/vpc/latest/privatelink/what-is-privatelink.html), so traffic stays on the AWS backbone.
8
+
9
+ <Info>
10
+ Private networking is a Pro and Enterprise feature. If you'd like access, [get in touch](/community).
11
+ </Info>
12
+
13
+ ## What is AWS PrivateLink
14
+
15
+ AWS PrivateLink is a managed service that creates a private, one-way connection between two AWS accounts without using the public internet, NAT gateways, internet gateways, or VPN tunnels.
16
+
17
+ It works by pairing two resources:
18
+
19
+ - A **VPC Endpoint Service** in the account that owns the resource (yours). This is fronted by a Network Load Balancer (NLB) and exposes whatever ports you choose.
20
+ - A **VPC Endpoint** in the account that wants to consume the resource (Trigger.dev's). The endpoint is an Elastic Network Interface (ENI) inside our VPC with a private IP that your task pods can dial directly.
21
+
22
+ The connection is unidirectional: only the endpoint side can initiate connections. Your VPC cannot reach into ours.
23
+
24
+ ## What you can use it for
25
+
26
+ Any TCP service running inside your VPC. Common use cases include:
27
+
28
+ - **Databases**: PostgreSQL (RDS, Aurora), MySQL, MongoDB, ClickHouse, Redshift
29
+ - **Caches**: ElastiCache Redis, Memcached
30
+ - **Internal APIs**: services on EKS, ECS, EC2, or Lambda exposed through an internal NLB
31
+ - **Message brokers**: self-hosted Kafka, RabbitMQ, NATS
32
+ - **Vector databases and ML services** running in private subnets
33
+
34
+ If your resource is reachable from a Network Load Balancer in the same VPC, it can be exposed to Trigger.dev via PrivateLink.
35
+
36
+ ## How it works with Trigger.dev
37
+
38
+ When you add a private connection in the dashboard, the following happens:
39
+
40
+ <Steps>
41
+ <Step title="You expose your resource">
42
+ You create an internal NLB in front of your resource and a VPC Endpoint Service that points to it. You add Trigger.dev's AWS account as an allowed principal so we're permitted to connect.
43
+ </Step>
44
+ <Step title="We provision a VPC Endpoint">
45
+ Once you submit the endpoint service name in the Trigger.dev dashboard, we provision a VPC Endpoint in our AWS account in the region you chose. The endpoint creates an ENI with a private IP that we wire up to reach your service.
46
+ </Step>
47
+ <Step title="Your tasks can reach the endpoint">
48
+ Once the connection is **Active**, the dashboard shows the assigned IP. Pods running your tasks are network-authorized to connect to it.
49
+ </Step>
50
+ </Steps>
51
+
52
+ ### Connecting from your task code
53
+
54
+ When the connection becomes **Active**, the dashboard shows the assigned endpoint IP. Plug it into the connection-string environment variable your task already reads (for example, `DATABASE_URL` set on the **Environment Variables** page):
55
+
56
+ <Note>
57
+ A private connection is scoped to your **organization**, not to a single environment. The same
58
+ assigned IP works from any deployed environment your tasks run in — Preview branches, Staging,
59
+ and Production — so you can set the connection-string env var per environment and point them
60
+ all at the same private resource. (Local **Development** runs on your own machine, so it can't
61
+ reach the endpoint IP — use a regular public connection there.)
62
+ </Note>
63
+
64
+
65
+ ```typescript
66
+ import { task } from "@trigger.dev/sdk";
67
+ import { Client } from "pg";
68
+
69
+ export const queryDatabase = task({
70
+ id: "query-database",
71
+ run: async () => {
72
+ // DATABASE_URL is set in the Trigger.dev dashboard to the connection's
73
+ // assigned IP shown in Private Connections.
74
+ const client = new Client({
75
+ connectionString: process.env.DATABASE_URL,
76
+ });
77
+
78
+ await client.connect();
79
+ const result = await client.query("SELECT NOW()");
80
+ await client.end();
81
+
82
+ return result.rows;
83
+ },
84
+ });
85
+ ```
86
+
87
+ ## Isolation between organizations
88
+
89
+ Private networking is set up so that each organization's connections are completely isolated from every other organization. Three layers enforce that:
90
+
91
+ ### 1. Dedicated AWS account
92
+
93
+ Customer VPC Endpoints are provisioned in a **dedicated AWS account** that is separate from the account that runs Trigger.dev's task workers. The dedicated account does nothing else — it only hosts customer endpoints. This limits the blast radius of any misconfiguration: even a misbehaving endpoint cannot reach worker infrastructure beyond the routes we explicitly define.
94
+
95
+ ### 2. Per-organization network policy
96
+
97
+ Inside the Kubernetes cluster that runs your tasks, the default network policy denies all traffic to private IP ranges. When your organization creates a connection, we generate a [CiliumNetworkPolicy](https://docs.cilium.io/en/stable/network/kubernetes/policy/) that:
98
+
99
+ - Targets **only pods labeled with your organization's ID**
100
+ - Allows egress **only to the specific endpoint IPs we provisioned for you**
101
+
102
+ A pod from another organization has neither the matching label nor a matching policy — its connection attempts to your endpoint IPs are dropped at the network layer before they ever reach an ENI.
103
+
104
+ ### 3. AWS-level authorization
105
+
106
+ PrivateLink itself enforces a second layer of authorization. Your VPC Endpoint Service has an explicit list of `allowed_principals` — only AWS accounts you list can even establish a connection. Trigger.dev provides each org with the same Trigger.dev AWS account ID, but the AWS account ID alone is useless without the matching CiliumNetworkPolicy on our side. To reach your endpoint, traffic must:
107
+
108
+ 1. Originate from a pod labeled with your org ID (enforced by us)
109
+ 2. Match an egress rule with your endpoint's IPs (enforced by us)
110
+ 3. Hit a VPC Endpoint Service that has authorized our account (enforced by you)
111
+
112
+ All three conditions must be true. No organization can route traffic to another organization's resources.
113
+
114
+ <Warning>
115
+ AWS account IDs are not secrets, but the VPC Endpoint Service name is also not enough on its own —
116
+ you must explicitly add Trigger.dev's account to your endpoint service's allowed principals before
117
+ any connection works. We'll never see your service unless you authorize us.
118
+ </Warning>
119
+
120
+ ## Limits
121
+
122
+ - **Two connections per organization.** This is a soft limit — get in touch if you need more.
123
+ - **All ports accepted.** Our security group allows all TCP ports from peered CIDRs. You control which ports are reachable through your NLB and target groups.
124
+ - **Same-region or cross-region.** Connections work within the same region as your tasks or across regions (cross-region adds AWS-level cost and ~10-30ms latency).
125
+
126
+ ## Next steps
127
+
128
+ <CardGroup>
129
+ <Card
130
+ title="Create a Private Link in the AWS Console"
131
+ icon="aws"
132
+ href="/private-networking/aws-console-setup"
133
+ >
134
+ Step-by-step instructions for creating the NLB, target group, and VPC Endpoint Service in your
135
+ AWS account.
136
+ </Card>
137
+ <Card
138
+ title="Troubleshooting"
139
+ icon="circle-question"
140
+ href="/private-networking/troubleshooting"
141
+ >
142
+ Common problems when setting up a private connection and how to resolve them.
143
+ </Card>
144
+ </CardGroup>
@@ -0,0 +1,78 @@
1
+ ---
2
+ title: "Troubleshooting private networking"
3
+ sidebarTitle: "Troubleshooting"
4
+ description: "Common problems when setting up an AWS PrivateLink connection to Trigger.dev, and how to resolve them."
5
+ ---
6
+
7
+ This page collects common issues when adding a private connection. If your problem isn't listed here, [get in touch](/community).
8
+
9
+ ## "Private link not found" in the setup wizard
10
+
11
+ If the setup wizard errors out with **Private link not found** when you submit the VPC Endpoint Service name, it almost always means your endpoint service has not been shared with Trigger.dev's AWS account.
12
+
13
+ Trigger.dev cannot provision a VPC Endpoint until your endpoint service explicitly authorizes our AWS account as a consumer. Until that happens, the service name is invisible to us — even though the name itself is correct.
14
+
15
+ ### How to fix it
16
+
17
+ <Steps>
18
+ <Step title="Open your endpoint service in the AWS console">
19
+ Go to **VPC → Endpoint services** in the AWS region where you created the service, and select
20
+ your service.
21
+ </Step>
22
+ <Step title="Open the Allow principals tab">
23
+ Click the **Allow principals** tab and check whether Trigger.dev's AWS account is listed.
24
+ </Step>
25
+ <Step title="Add Trigger.dev's account if it's missing">
26
+ Click **Allow principals** and add an entry in this format, replacing `<account-id>` with the
27
+ Trigger.dev AWS account ID shown on the **Add connection** page in your dashboard:
28
+
29
+ ```text
30
+ arn:aws:iam::<account-id>:root
31
+ ```
32
+
33
+ <Warning>
34
+ Always copy the account ID from your Trigger.dev dashboard. The correct value differs between
35
+ environments — don't reuse an ID from another source.
36
+ </Warning>
37
+
38
+ </Step>
39
+ <Step title="Retry in the Trigger.dev dashboard">
40
+ Once the principal is allow-listed, return to the **Add connection** page in Trigger.dev and
41
+ submit the form again. The wizard should now find your endpoint service and start provisioning.
42
+ </Step>
43
+ </Steps>
44
+
45
+ For full setup instructions including this step, see [Setting up PrivateLink in the AWS Console](/private-networking/aws-console-setup).
46
+
47
+ ## Connection is Active but the assigned IP is not reachable from tasks
48
+
49
+ If your private connection shows **Active** in the Trigger.dev dashboard and the NLB target group reports healthy targets, but tasks still cannot reach the assigned IP, the most common cause is that your Network Load Balancer is enforcing security group rules on PrivateLink traffic.
50
+
51
+ When a security group is attached to an NLB, AWS exposes a separate setting called **Enforce inbound rules on PrivateLink traffic**. When this is **on**, the NLB applies its security group's inbound rules to traffic arriving from VPC endpoints — and the source IP it evaluates is the **private IP of the consumer's VPC endpoint network interface**, not an IP in your own VPC. Because that IP belongs to Trigger.dev's VPC and isn't known ahead of time, the SG rule almost never matches, and traffic is silently dropped at the NLB.
52
+
53
+ ### How to fix it
54
+
55
+ <Steps>
56
+ <Step title="Open your Network Load Balancer in the AWS console">
57
+ Go to **EC2 → Load balancers** in the region where your NLB lives and select the load balancer
58
+ backing your endpoint service.
59
+ </Step>
60
+ <Step title="Edit the security group settings">
61
+ On the **Security** tab, click **Edit**.
62
+ </Step>
63
+ <Step title="Turn off PrivateLink enforcement">
64
+ Uncheck **Enforce inbound rules on PrivateLink traffic** and save.
65
+
66
+ <Note>
67
+ This only changes how the NLB itself filters traffic. Authorization is still enforced by the
68
+ endpoint service's **Allow principals** list, so only AWS accounts you've explicitly
69
+ allow-listed can connect.
70
+ </Note>
71
+
72
+ </Step>
73
+ <Step title="Retry from your task">
74
+ Re-run a task that dials the assigned private IP. The connection should now succeed.
75
+ </Step>
76
+ </Steps>
77
+
78
+ If you need to keep the enforcement on for compliance reasons, the alternative is to widen your NLB's security group inbound rule to `0.0.0.0/0` on the listener port. Allow-listing the consumer endpoint's CIDR is not practical because it lives in Trigger.dev's VPC and may change.