.agents/features/webhooks.md
Ingests inbound HTTP requests from external services and routes them to flows for execution. The module normalizes request payloads (handling multipart, binary, JSON, and text), supports both synchronous (blocking, waits for flow response) and asynchronous (fire-and-forget) execution modes, manages handshake verification for external services that challenge webhook ownership, and enforces payload size limits. It is the primary entry point for event-driven flow execution from outside Activepieces.
packages/server/api/src/app/webhooks/webhook.service.ts — core routing, sync/async execution, flow resolutionpackages/server/api/src/app/webhooks/webhook-controller.ts — 5 route registrations (sync, async, draft sync, draft async, test)packages/server/api/src/app/webhooks/webhook-request-converter.ts — payload normalization and file uploadpackages/server/api/src/app/webhooks/webhook-handshake.ts — handshake verification logicpackages/server/api/src/app/webhooks/webhook-module.ts — module registrationpackages/shared/src/lib/automation/webhook/dto.ts — WebhookUrlParams schemapackages/shared/src/lib/automation/trigger/index.ts — WebhookHandshakeStrategy enum and WebhookHandshakeConfiguration schemapackages/web/src/app/builder/test-step/custom-test-step/test-webhook-dialog.tsx — dialog for sending a manual test request to the webhook URLpackages/web/src/app/builder/test-step/test-trigger-section/manual-webhook-test-button.tsx — button that opens the test webhook dialogpackages/web/src/app/builder/test-step/test-trigger-section/index.tsx — test trigger panel (includes webhook test entry point)packages/components/icons/webhook.tsx — webhook icon used across the UI/:flowId/sync) — blocks the HTTP connection until the flow completes and returns the flow's response payload/:flowId) — queues execution and returns 200 immediately with an x-webhook-id header/:flowId/test) — captures the request as sample data without executing the flowHEADER_PRESENT, QUERY_PRESENT, BODY_PARAM_PRESENT, NONEpublishedVersionId if set, falls back to latest draft| Route | Mode | Version | Purpose |
|---|---|---|---|
/:flowId/sync | SYNC | LOCKED_FALL_BACK_TO_LATEST | Production sync — blocks HTTP, returns flow response |
/:flowId | ASYNC | LOCKED_FALL_BACK_TO_LATEST | Production async — queues job, returns 200 immediately |
/:flowId/draft/sync | SYNC | LATEST | Testing sync — always uses draft version |
/:flowId/draft | ASYNC | LATEST | Testing async — draft version |
/:flowId/test | ASYNC | LATEST | Sample data only — no execution |
All routes accept GET, POST, PUT, DELETE, PATCH methods.
Async path:
AP_WEBHOOK_PAYLOAD_INLINE_THRESHOLD_KB (default 512KB)WorkerJobType.EXECUTE_WEBHOOK)x-webhook-id header immediatelySync path:
ProgressUpdateType.WEBHOOK_RESPONSEengineResponseWatcherAP_WEBHOOK_TIMEOUT_SECONDS, default 30)webhookRequestConverter.convertRequest() normalizes incoming data:
rawBody for signature verification (non-binary only)x-parent-run-id, x-fail-parent-on-failure (for subflows)External services verify webhook ownership before sending events:
AP_MAX_WEBHOOK_PAYLOAD_SIZE_MB (default 5MB). Returns 413 if exceeded.
flowExecutionCache for fast lookuppublishedVersionId if exists, else latest