.agents/features/event-destinations.md
Event Destinations streams platform and project activity events to external HTTPS webhook URLs in real time. Each destination subscribes to a configurable subset of the 19 ApplicationEventName events (flow CRUD, run lifecycle, user auth, connections, security, releases) and receives a structured JSON payload via a BullMQ-backed delivery queue. The feature is gated behind the auditLogEnabled plan flag and is only available in Enterprise/Cloud editions.
packages/server/api/src/app/event-destinations/ — controller, service, entitypackages/shared/src/lib/ee/event-destinations/dto.ts — request/response Zod schemaspackages/shared/src/lib/ee/event-destinations/index.ts — barrel exportpackages/shared/src/lib/ee/audit-events/ — ApplicationEventName enum (19 event types)packages/web/src/app/routes/platform/infra/event-destinations/index.tsx — EventDestinationsPagepackages/web/src/app/routes/platform/infra/event-destinations/lib/event-destinations-collection.ts — TanStack DB live collection + mutationspackages/web/src/app/routes/platform/infra/event-destinations/components/event-destination-dialog.tsx — create/edit dialogpackages/web/src/app/routes/platform/infra/event-destinations/components/event-destination-actions.tsx — per-row edit/delete/test actionsauditLogEnabled is set by the license key.auditLogEnabled. UI wrapped in LockedFeatureGuard keyed to eventStreamingEnabled.FLOW_RUN_FINISHED).ONE_TIME job that POSTs the event payload to the destination URL.FLOW_CREATED payload synchronously so the operator can verify connectivity.EventDestination: id, platformId, projectId (nullable — null for platform scope), scope (PLATFORM/PROJECT), events[] (ApplicationEventName array), url (HTTPS webhook endpoint). Relations: platform, project.
FLOW_RUN_FINISHED events for that projectEvents delivered via BullMQ job queue (WorkerJobType.EVENT_DESTINATION):
eventDestinationService.trigger() finds matching destinationsPOST /v1/event-destinations — create destination (validates URL is external — no localhost)POST /v1/event-destinations/:id — update URL or eventsGET /v1/event-destinations — list destinations (paginated)DELETE /v1/event-destinations/:id — delete destinationPOST /v1/event-destinations/test — sends mock FLOW_CREATED event to URLRejects: localhost, 127.0.0.1, ::1, [::1], and other loopback addresses.
Enterprise feature. Requires auditLogEnabled plan flag (event streaming shares the audit log gating). Module registered in EE section of app.ts. Frontend checks platform.plan.eventStreamingEnabled before firing queries.
The page uses a TanStack DB live collection (eventDestinationsCollection) rather than standard React Query. The collection holds an optimistic local mirror of all destinations. Mutations (onUpdate, onInsert, onDelete) call the REST API and then write back into the collection via writeInsert / update / delete helpers. useLiveQuery re-renders the list reactively on any collection change.
{
"id": "event_id",
"created": "ISO timestamp",
"platformId": "...",
"projectId": "...",
"data": {
"flow": { "id", "name", ... },
"project": { "displayName", ... }
}
}