Problem
packages/jobs/src/session-scoring.ts line 139: await fireWebhook(...) is called synchronously. Internally deliverToEndpoint iterates endpoints in a for-loop with up to 10s timeout each. An org with N slow/timing-out webhook endpoints holds the scoring job open for up to N × 10s.
With Trigger.dev retry backoff < webhook timeout, retries pile up before the first completes.
Fix
Option A — run deliveries concurrently:
await Promise.all(endpoints.map(ep => deliverToEndpoint(ep, ...)));
Option B — move fireWebhook to a fire-and-forget child task:
await webhookDeliveryTask.trigger({ orgId, event, data });
// returns immediately; scoring is not blocked on delivery
Option B is preferred as it completely decouples scoring latency from delivery infrastructure.
Problem
packages/jobs/src/session-scoring.tsline 139:await fireWebhook(...)is called synchronously. InternallydeliverToEndpointiterates endpoints in a for-loop with up to 10s timeout each. An org with N slow/timing-out webhook endpoints holds the scoring job open for up toN × 10s.With Trigger.dev retry backoff < webhook timeout, retries pile up before the first completes.
Fix
Option A — run deliveries concurrently:
Option B — move
fireWebhookto a fire-and-forget child task:Option B is preferred as it completely decouples scoring latency from delivery infrastructure.