.agents/features/event-destinations.md
Event Destinations streams platform and project activity events to webhook URLs in real time. Internal Activepieces flow webhooks are valid targets, so operators can route events into a flow and fan them out to Slack, Gmail, Teams, or any HTTP endpoint without leaving the platform. Each destination subscribes to a configurable subset of the 27 ApplicationEventName events (flow CRUD, flow lifecycle, 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 schemas (test endpoint accepts optional event)packages/shared/src/lib/ee/event-destinations/index.ts — barrel exportpackages/shared/src/lib/ee/audit-events/ — ApplicationEventName enum (27 event types)packages/shared/src/lib/ee/audit-events/mock-event-builder.ts — buildMockEvent() shared helper that returns a typed ApplicationEvent mock for any event namepackages/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 + mutations (incl. useImportHandlerFlow)packages/web/src/app/routes/platform/infra/event-destinations/lib/handler-flow-builder.ts — generates a Template for a one-click webhook-triggered handler flow with per-event router branchespackages/web/src/app/routes/platform/infra/event-destinations/lib/parse-flow-id-from-url.ts — extracts an internal flow ID from a webhook URLpackages/web/src/app/routes/platform/infra/event-destinations/lib/use-event-labels.ts — human-readable labels for every ApplicationEventNamepackages/web/src/app/routes/platform/infra/event-destinations/components/event-destination-dialog.tsx — create/edit dialog with Generate handler flow button and per-event Test webhook dropdownpackages/web/src/app/routes/platform/infra/event-destinations/components/event-destination-row.tsx — per-destination rowpackages/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) synchronously so the operator can verify connectivity. Backed by buildMockEvent().handler-flow-builder.ts that consumes the webhook and routes each event to its own branch (Slack/Gmail/Teams/HTTP).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 destinationPOST /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 a mock event to the URL. Body accepts an optional event: ApplicationEventName field; defaults to FLOW_CREATED. The payload is built via buildMockEvent().Internal flow webhook URLs are accepted as destination URLs — outbound webhook delivery is still routed through safeHttp (SSRF-protected). The previous assertUrlIsExternal check has been removed to support the internal handler-flow pattern; recursion is prevented by a server-side cycle guard that drops events whose payload originated from the same destination chain.
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 sidebar entry now lives under the new Observability group (moved from Infrastructure).
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", ... }
}
}