Descrizione
Avvia il workflow quando una richiesta HTTP arriva all'URL del webhook. URL pubblico generato automaticamente (path = workflow_id + token random) e mostrato nel pannello "Webhook URL" del nodo. Path custom opzionale via customPath per URL leggibili (es. /webhooks/c/stripe/event invece di /webhooks/<uuid>). Differenza con i sibling: trigger_webhook = endpoint always-on, request-response. Per sospensione mid-workflow con resume su callback vedi logic_wait_signal. Per ingest email usa trigger_imap. Per polling DB usa trigger_db_change. Per scheduled jobs usa trigger_cron. Auth modes: none (pubblico, signed token nel URL), header-token (Authorization: Bearer <token>), hmac-signature (HMAC-SHA256 del body con secret condiviso — pattern Stripe/PayPal/Slack), basic-auth (RFC 7617), jwt (verifica issuer/audience/exp). HMAC e\` raccomandato per integrazioni B2B production — il token nel URL e\` log-leak vulnerable mentre la firma HMAC valida ogni request anche se URL e\` intercettata. Response modes (responseMode): (a) immediate = 202 Accepted subito + workflow async (raccomandato per webhook esterni ad alta frequenza Stripe/SDI), (b) wait-for-workflow = aspetta il workflow e ritorna {runId, status} JSON, (c) use-respond-node = aspetta il workflow E un nodo action_webhook_respond finale decide status+body+headers (API REST custom). Features production-grade: raw body capture (per HMAC verify byte-perfect senza JSON re-serialization che spaccherebbe la firma), CORS configurabile per integrazioni browser (origin allowlist, preflight handled), anti-replay dedup su firma HMAC (cache LRU per nodeId+signature, TTL 10min — una request HMAC gia\` vista viene rifiutata, AUDIT WE-4), dedup via header Idempotency-Key (pattern Stripe: un retro del client con lo stesso Idempotency-Key entro 24h ritorna 200 {duplicate:true} senza rieseguire il workflow), rate-limit per-webhook configurabile (rateLimitPerMin, fixed-window per nodeId+IP → 429 + Retry-After oltre la soglia; 0 = disabilitato), audit on-hit (ogni hit autorizzato loggato con ip + method + SHA-256 del body, mai il payload in chiaro). Use case: (1) callback Stripe/PayPal/SDI post-pagamento con HMAC verify e branching su event type, (2) endpoint API REST custom per integrazioni vendor B2B con header-token, (3) submit form landing page (response HTML redirect post-success), (4) inbound webhook firmato HMAC con anti-replay automatico. Safety budget: token URL confrontato in modo timing-safe, anti-replay HMAC (TTL 10min, cap 10k), dedup Idempotency-Key (TTL 24h), rate-limit per-webhook (429 + Retry-After), CORS allowlist. La verifica firma/JWT e\` byte-perfect sul raw body.
