Aggregator Node

The Aggregator node batches multiple events together before forwarding them as a single payload. Events are collected until a batch size threshold is reached and optionally grouped by a payload field — ideal for reducing API calls and building summary notifications.

Overview

The Aggregator node collects incoming events and groups them into batches. When the batch reaches batchSize, the aggregator flushes and emits a single event containing all collected payloads. Optionally, events can be grouped by a specific payload field (groupByField) so that events with different key values produce separate batches.

This dramatically reduces the number of downstream API calls and enables summary-style processing — for example, batching 50 individual order events into a single batch payload for bulk processing.


Configuration

FieldTypeDefaultDescription
namestringFriendly label for the aggregator
batchSizenumber10Flush when N events have been accumulated
windowSecondsnumber60Flush after N seconds even if batch is not full
groupByFieldstring""Dot-notation payload field to group events by (empty = all grouped together)
outputFormat'array' | 'keyed'array'array' (flat list) or 'keyed' (grouped by key values)
inputNodes{ nodeType, nodeId }[][]Upstream nodes that feed this one. nodeType is the node kind (webhook, scheduledWorkflow, filter, …)
inputNodes{ nodeType, nodeId }[][]Upstream nodes that feed this one. nodeType is the node kind (webhook, scheduledWorkflow, filter, …)
inputNodesstring[][]Generic node IDs that feed events into this aggregator
outputWebhookIdsstring[][]Webhook IDs to forward batched events to
outputTransformIdsstring[][]Transform node IDs to forward batched events to
outputNodesstring[][]Generic node IDs to forward batched events to
filtersPayloadFilter[][]Optional payload filters applied before aggregation
filterMode'and' | 'or'andHow multiple filters combine — all must match (and) or any (or)
isActivebooleantrueWhether the aggregator is enabled
When groupByField is set, events with different key values are batched separately. For example, grouping by data.customerId produces one batch per customer. When empty, all events are batched together regardless of content.

Create an Aggregator

bashCreate Aggregator
curl -X POST /api/aggregator-nodes \
  -H "Authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Order Batch for Inventory",
    "batchSize": 10,
    "windowSeconds": 60,
    "groupByField": "data.customerId",
    "outputFormat": "array",
    "isActive": true
  }'

Response

json201 Created
{
  "_id": "6655f2a3b4c5d6e7f8a9b0c1",
  "name": "Order Batch for Inventory",
  "batchSize": 10,
  "windowSeconds": 60,
  "groupByField": "data.customerId",
  "outputFormat": "array",
  "inputNodes": [],
  "inputNodes": [],
  "inputNodes": [],
  "outputWebhookIds": [],
  "outputTransformIds": [],
  "outputNodes": [],
  "filters": [],
  "filterMode": "and",
  "isActive": true,
  "createdAt": "2025-05-01T12:00:00.000Z",
  "updatedAt": "2025-05-01T12:00:00.000Z"
}

Update an Aggregator

bashUpdate Aggregator
curl -X PATCH /api/aggregator-nodes/6655f2a3b4c5d6e7f8a9b0c1 \
  -H "Authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d '{
    "batchSize": 100,
    "outputFormat": "keyed"
  }'

Canvas Integration

The Aggregator is available as a canvas node. Connect webhooks or scheduled webhooks as inputs, and webhooks or transforms as outputs. Events are buffered in the aggregator until the batch threshold is reached, then forwarded as a single aggregated payload.


Payload Examples

Individual events entering the aggregator

jsonEvent 1
{
  "type": "order.created",
  "data": { "orderId": "ORD-001", "customerId": "cus_abc", "amount": 5000 }
}
jsonEvent 2
{
  "type": "order.created",
  "data": { "orderId": "ORD-002", "customerId": "cus_abc", "amount": 3000 }
}
jsonEvent 3
{
  "type": "order.created",
  "data": { "orderId": "ORD-003", "customerId": "cus_xyz", "amount": 7500 }
}

Batched output (keyed format, grouped by customerId)

When the batch flushes, the aggregator emits a single payload with all collected events:

jsonAggregated payload
{
  "type": "aggregated_batch",
  "groupByField": "data.customerId",
  "count": 3,
  "groups": {
    "cus_abc": [
      { "type": "order.created", "data": { "orderId": "ORD-001", "customerId": "cus_abc", "amount": 5000 } },
      { "type": "order.created", "data": { "orderId": "ORD-002", "customerId": "cus_abc", "amount": 3000 } }
    ],
    "cus_xyz": [
      { "type": "order.created", "data": { "orderId": "ORD-003", "customerId": "cus_xyz", "amount": 7500 } }
    ]
  }
}

Batched output (array format)

jsonAggregated payload (array)
{
  "type": "aggregated_batch",
  "count": 3,
  "items": [
    { "type": "order.created", "data": { "orderId": "ORD-001", "customerId": "cus_abc", "amount": 5000 } },
    { "type": "order.created", "data": { "orderId": "ORD-002", "customerId": "cus_abc", "amount": 3000 } },
    { "type": "order.created", "data": { "orderId": "ORD-003", "customerId": "cus_xyz", "amount": 7500 } }
  ]
}

Use Cases

  • Inventory bulk updates — Aggregate 10 order events then send a single bulk update to your inventory system instead of 10 individual API calls.
  • Bulk API calls — Batch individual webhook events into a single API call for services that support bulk operations (e.g., batch database inserts).
  • Digest notifications — Collect events and send a single summary notification instead of one per event.
  • Analytics aggregation — Group events by customer or product and forward batched analytics data to your data warehouse.
  • Cost optimization — Reduce the number of outbound API calls to paid services by batching events.
  • Report generation — Collect all events within a batch and generate a batch report for downstream processing.

API Reference

MethodWebhookDescription
GET/api/aggregator-nodesList all aggregator nodes
POST/api/aggregator-nodesCreate a new aggregator
GET/api/aggregator-nodes/:idGet a specific aggregator
PATCH/api/aggregator-nodes/:idUpdate an aggregator
DELETE/api/aggregator-nodes/:idDelete an aggregator