npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

n8n-nodes-aggregate-by-field

v1.0.2

Published

n8n community node to aggregate/group input items by a specified field value

Readme

n8n-nodes-aggregate-by-field

npm version License: MIT

An n8n community node that aggregates and groups input items by a specified field value.

The Aggregate By Field node collects items that share the same value in a specified field and groups them together. This is useful for organizing data by categories, processing items in batches by type, or creating summary reports.

Aggregate By Field Node

Installation

Via n8n Community Nodes (Recommended)

  1. Go to SettingsCommunity Nodes
  2. Click Install
  3. Enter n8n-nodes-aggregate-by-field
  4. Click Install

Via npm (Manual)

cd ~/.n8n/nodes
npm install n8n-nodes-aggregate-by-field

Then restart n8n.

Features

  • ✅ Group items by any field value
  • ✅ Support for nested fields using dot notation (e.g., user.address.city)
  • ✅ Configurable output field names
  • ✅ Multiple options for handling missing values
  • ✅ Optional sorting of groups (A-Z or Z-A)
  • ✅ Optional item count per group

Parameters

| Parameter | Type | Required | Default | Description | |-----------|------|----------|---------|-------------| | Field To Group By | string | Yes | - | The field name to group items by. Supports dot notation for nested fields. | | Output Field Name | string | No | items | The field name for the array of grouped items in the output. | | Include Group Key In Output | boolean | No | true | Whether to include the grouping field and its value in each output item. |

Options

| Option | Type | Default | Description | |--------|------|---------|-------------| | Handle Missing Values | select | Skip Item | How to handle items where the grouping field is missing or undefined. | | Sort Groups | select | No Sorting | Sort output groups alphabetically (Ascending/Descending) or keep original order. | | Include Item Count | boolean | false | Add a count of items in each group. | | Item Count Field Name | string | itemCount | Field name for the item count (when enabled). |

Usage Examples

Basic Grouping

Input:

[
  { "name": "Apple", "category": "Fruit", "price": 1.50 },
  { "name": "Banana", "category": "Fruit", "price": 0.75 },
  { "name": "Carrot", "category": "Vegetable", "price": 0.50 },
  { "name": "Broccoli", "category": "Vegetable", "price": 1.25 },
  { "name": "Orange", "category": "Fruit", "price": 1.00 }
]

Configuration:

  • Field To Group By: category
  • Output Field Name: products

Output:

[
  {
    "category": "Fruit",
    "products": [
      { "name": "Apple", "category": "Fruit", "price": 1.50 },
      { "name": "Banana", "category": "Fruit", "price": 0.75 },
      { "name": "Orange", "category": "Fruit", "price": 1.00 }
    ]
  },
  {
    "category": "Vegetable",
    "products": [
      { "name": "Carrot", "category": "Vegetable", "price": 0.50 },
      { "name": "Broccoli", "category": "Vegetable", "price": 1.25 }
    ]
  }
]

Nested Field Grouping

Input:

[
  { "id": 1, "user": { "country": "USA" }, "order": "A001" },
  { "id": 2, "user": { "country": "UK" }, "order": "A002" },
  { "id": 3, "user": { "country": "USA" }, "order": "A003" },
  { "id": 4, "user": { "country": "Germany" }, "order": "A004" }
]

Configuration:

  • Field To Group By: user.country

Output:

[
  { "country": "USA", "items": [{ "id": 1, ... }, { "id": 3, ... }] },
  { "country": "UK", "items": [{ "id": 2, ... }] },
  { "country": "Germany", "items": [{ "id": 4, ... }] }
]

With Item Count

Configuration:

  • Field To Group By: category
  • Options → Include Item Count: true

Output:

[
  { "category": "Fruit", "items": [...], "itemCount": 3 },
  { "category": "Vegetable", "items": [...], "itemCount": 2 }
]

Use Cases

| Use Case | Description | |----------|-------------| | E-commerce | Group orders by customer, status, or shipping method | | Data Processing | Organize records by date, region, or type | | Reporting | Aggregate data for summary statistics | | ETL Workflows | Batch items before bulk database operations | | API Integration | Group API responses for parallel processing | | Email Campaigns | Group contacts by segment or preference |

Compatibility

| Requirement | Version | |-------------|---------| | n8n | 1.0+ | | Node.js | 18.10+ |

Development

# Clone the repository
git clone https://github.com/YOUR-USERNAME/n8n-nodes-aggregate-by-field.git
cd n8n-nodes-aggregate-by-field

# Install dependencies
npm install

# Build the node
npm run build

# Run in development mode (with hot reload)
npm run dev

# Lint code
npm run lint

License

This project is licensed under the MIT License.

Author

  • GitHub: @zohar
  • Website: https://ovadia.rocks

Made with ❤️ for the n8n community