fix(trigger): keep each worker's egress gateway address out of the env sync

Merged
WA
2d ago
+21-1

Summary

  • The Trigger.dev env sync (#9632) copies every app key except a Trigger-owned list. OUTBOUND_GATEWAYS wasn't on it, so each deploy overwrote the worker's gateway URL with the app's VPC load-balancer URL.
  • Workers can't reach that address, so any gateway-routed request in a background run (scheduled, webhook, async API, knowledge connector sync) fails with GATEWAY_UNAVAILABLE after two connect timeouts. App-side requests are unaffected.
  • OUTBOUND_GATEWAYS is now Trigger-owned, like REDIS_URL. OUTBOUND_GATEWAY_CREDENTIALS and OUTBOUND_ROUTING_SOURCE are identical for app and worker and keep syncing.

Verification

  • Reproduced on staging with an organization routed through the staging gateway: app runs exited from the gateway IPs, while every async run failed with UND_ERR_CONNECT_TIMEOUT on both CONNECT attempts.
  • After restoring the worker value by hand, all eight app and async cases completed through the gateway. Until this merges, the next staging deploy reverts that value.
  • New test in trigger-env.test.ts fails on the old key list and passes with the fix.

Follow-up after merge

The worker value has to be restored once in each Trigger.dev environment that syncs (staging, prod). The sync now leaves it alone.