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-random

v0.1.2

Published

An n8n community node for random selection. Pick one or more random items from any list in your n8n workflow.

Readme

n8n-nodes-random

An n8n community node for random selection. Pick one or more random items from any list inside an n8n workflow.

npm version License: MIT


What is n8n-nodes-random?

n8n-nodes-random adds a Random node to your n8n instance. Use it any time your n8n workflow needs to pick a random item, sample a random subset, shuffle a list, or split items randomly between two paths.

Common n8n random selection use cases:

  • Pick a random winner from a list of entries
  • Randomly assign a support agent from a team list
  • Sample 5 random rows from a dataset in n8n
  • Randomly rotate content (quotes, images, messages) in a scheduled n8n workflow
  • A/B split items randomly across two branches
  • Pick a random product, country, template, or prompt from an array

Installation

In your n8n instance go to Settings > Community Nodes > Install and enter:

n8n-nodes-random

Or via CLI on a self-hosted n8n instance:

npm install n8n-nodes-random

How it works

The Random node has two modes.

Mode 1: Input Items (default)

All n8n items flowing into the node form the pool. The node randomly picks N of them and routes them to the Picked output. Everything else goes to Remaining.

Use this when the things you want to pick from are n8n items, for example rows from a database query, spreadsheet rows, API results, or webhook payloads.

Example: pick 1 random winner from a list of contest entries

HTTP Request (get entries) -> Random (Pick Count: 1) -> Send winner email
                                      |
                                   Remaining -> (ignore or archive)

Example: randomly assign 3 support tickets to an agent

Postgres (get open tickets) -> Random (Pick Count: 3) -> Assign to agent A
                                        |
                                    Remaining -> back to queue

Mode 2: List Field

Each n8n item has a field containing an array. The node picks N values from that array and writes the result into a new field on the same item. All items exit via Picked. Items where the array field is empty or missing exit via Remaining.

Use this when the array you want to pick from lives inside a field on each item, for example a tags field, an options field, or any JSON array field.

Example: pick a random tag from each article

Input item:

{ "title": "My Article", "tags": ["n8n", "automation", "random", "workflow"] }

Configure the node:

  • Source: List Field
  • List Field: tags (or drag and drop the field from the n8n data panel)
  • Output Field: randomTag
  • Pick Count: 1

Output item:

{
  "title": "My Article",
  "tags": ["n8n", "automation", "random", "workflow"],
  "randomTag": "automation",
  "_pick": { "poolSize": 4, "pickCount": 1, "allowDuplicates": false, "seeded": false }
}

Example: pick 2 random options from a survey response

Input item:

{ "respondent": "Alice", "choices": ["Option A", "Option B", "Option C", "Option D"] }

Configure the node:

  • Source: List Field
  • List Field: choices
  • Output Field: selected
  • Pick Count: 2
  • Always Output an Array: on

Output item:

{
  "respondent": "Alice",
  "choices": ["Option A", "Option B", "Option C", "Option D"],
  "selected": ["Option C", "Option A"]
}

Parameters

| Parameter | Default | Description | |---|---|---| | Source | Input Items | Input Items picks from n8n items. List Field picks from an array inside each item. | | List Field | | Name of the field containing the array. Supports dot-notation for nested fields (e.g. data.options). Drag and drop from the n8n data panel. | | Output Field | picked | Name of the field to write the random result into (List Field mode only) | | Pick Count | 1 | How many random items to pick. Defaults to 1. | | Allow Duplicates | false | When on, the same item can be picked more than once. When off, Pick Count is capped at pool size. | | Always Output an Array | false | When on, result is always an array even if Pick Count is 1. Useful when downstream nodes expect a consistent array shape. | | Random Seed | | Optional integer. When set, the same seed always produces the same random picks for the same pool. Leave blank for true randomness. |


Outputs

| Output pin | What comes out | |---|---| | Picked | The randomly selected n8n items or values | | Remaining | Items not selected (Input Items mode) or items where the array field was empty or missing (List Field mode) |


Pick metadata

Every item that exits via Picked includes a _pick field with context about the random selection:

{
  "_pick": {
    "poolSize": 20,
    "pickCount": 3,
    "allowDuplicates": false,
    "seeded": false
  }
}

Use _pick.poolSize and _pick.pickCount downstream in your n8n workflow if you need to know how many items were in the pool or how many were picked.


Reproducible random picks with a seed

Set Random Seed to any integer to make picks reproducible. The same seed with the same pool always produces the same random result. Useful for:

  • Testing n8n workflows where you need predictable output
  • Deterministic sampling where the same input should always yield the same random subset

Leave the seed blank for true randomness on every execution.


Drag and drop support

In List Field mode, open the n8n data panel on the left side of the canvas, find the array field you want to pick from, and drag it directly into the List Field input. The node accepts both plain field names and n8n expressions like {{ $json.options }}.


License

MIT (c) Victor Folorunso