node-red-contrib-collector 0.0.1

Collect topic/payload pairs and output all values as an object

npm install node-red-contrib-collector

A Node-RED node that collects topic/payload pairs and outputs all values as an object, for every message received. This can be useful if you want to perform a condition or calculation on more than one message value at once.

It can also be used to only pass a message through if the value has changed since last time the message was received.


Run the following command in the root directory of your Node-RED install

npm install node-red-contrib-collector


The node collects message payloads and stores them against topic names. Upon recieving a message it will output all previously received msg.topic/msg.payload pairs as an object.

If "Only return message if value changed?" is set, then a message will only be output, if the payload has changed since the last message with the same topic was received.

If if a message is received with a msg.topic but no msg.payload, then that topic will be deleted from the collector.


Illustrating what this node does may be easier with this example flow: screenshot

After pressing the a, b and c inject buttons, the following XML is output in the debug tab:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
  <a>Value A</a>
  <b>Value B</b>
  <c>Value C</c>

Pressing the no b button causes the <b>Value B</b> element to be removed again.

The flow can be downloaded from the Node-Red Flow Library here:

Node Info

Version: 0.0.1
Updated 3 years, 9 months ago
License: Apache


3 in the last day
64 in the last week
167 in the last month


  • collector


  • state
  • node-red


  • njh