Webbu Docs

Buffer n8n Webhooks

Batch webhook events before they trigger n8n workflows.

Overview

Every webhook that triggers an n8n workflow starts an execution. With Webbu in front, each execution receives a batch of events instead of one, which:

  • On n8n Cloud reduces the number of executions you use
  • On self-hosted n8n protects your instance from webhook floods

Setup

1. Create the n8n workflow

  1. Add a Webhook node, HTTP method POST, path e.g. batch-processor
  2. Activate the workflow and copy the production URL (e.g. https://your-n8n.example.com/webhook/batch-processor)

2. Create a Webbu buffer

curl -X POST https://webbu.dev/api/v1/admin/buffers \
  -H "Content-Type: application/json" \
  -H "X-API-Key: $WEBBU_API_KEY" \
  -d '{
    "bufferId": "b_n8n",
    "projectId": "p_automation",
    "name": "n8n batch",
    "groupKey": { "mode": "jsonpath", "path": "$.userId" },
    "batch": { "maxItems": 25, "maxBytes": 262144, "idleTimeoutMs": 5000, "maxWaitFromFirstMs": 30000 },
    "delivery": { "url": "https://your-n8n.example.com/webhook/batch-processor" }
  }'

$.userId groups events by user; adjust it to your payload ($.customerId, $.tenantId, $.conversationId, …).

3. Point your webhook source to Webbu

Before: https://your-n8n.example.com/webhook/processor

After: https://webbu.dev/api/v1/ingest/p_automation/b_n8n

4. Process the batch

The Webhook node outputs the request body:

{
  "webbu": { "bufferId": "b_n8n", "groupKey": "user_123", "segment": 0, "…": "…" },
  "window": { "firstItemAt": 1767225600000, "lastActivityAt": 1767225604000, "itemsCount": 3 },
  "items": [
    { "messageId": "…", "receivedAt": 1767225600000, "payload": { "userId": "user_123", "action": "page_view", "page": "/dashboard" } },
    { "messageId": "…", "receivedAt": 1767225602000, "payload": { "userId": "user_123", "action": "button_click", "button": "export" } },
    { "messageId": "…", "receivedAt": 1767225604000, "payload": { "userId": "user_123", "action": "page_view", "page": "/settings" } }
  ]
}

Add a Split Out node on body.items to get one n8n item per event, or handle the batch in a Code node.

Benefits

  • Fewer workflow executions
  • Protection against webhook floods
  • Related events processed together
  • Retries and a dead letter queue when n8n is down

On this page