How to customize the Split node in Node-Red in a way not to send all msgs at once?

I am trying to customize the Split node in Node-Red in a way to send the next message only when the first arrives to the Join node; as I am doing some processing in between, and would like to process each msg separately before joining them.

So I have cloned the Split node from Node-Red project, and at the part where the splitting of an array happens; I register listeners to events (random IDs generated by the original Split node).

else if (Array.isArray(msg.payload)) { // then split array into messages = 'array';
     var count = msg.payload.length / node.arraySplt;
     if (Math.floor(count) !== count) {
         count = Math.ceil(count);
     } = count;
     var pos = 0;
     var data = msg.payload; = node.arraySplt;
     for (let i = 0; i < count; i++) {
         msg.payload = data.slice(pos, pos + node.arraySplt);
         if (node.arraySplt === 1) {
             msg.payload = msg.payload[0];
         } = i;
         pos += node.arraySplt;
         if (i === 0) {
         let eventName = + '-' + i;
         addHandler(eventName, send, msg);

My handler function

function addHandler(eventName, send, msg) {, () => {

And at the Join node (which is in the same js file)

// commented below is the original code of the join function
// if ((tcnt > 0 && group.currentCount > tcnt) || msg.hasOwnProperty('complete')) {
//     completeSend(partId);
//     return;
// } else
if ( <= ( - 2)) {
    let eventName = + '-' + (parseInt( + 1);;
} else if ( >= ( - 1)) {

However, this would send the first msg (as I directly send it, and not through an event), and the last msg only; it would skip whatever in between.

How to customize the Split node in Node-Red in a way not to send all msgs at once?


Thank you for visiting the Q&A section on Magenaut. Please note that all the answers may not help you solve the issue immediately. So please treat them as advisements. If you found the post helpful (or not), leave a comment & I’ll get back to you as soon as possible.

Method 1

Modifying the split node is the wrong way to do this.

There are rate limiting nodes that will do this for you. e.g.

Or you can use the delay node with it’s release function

All methods was sourced from or, is licensed under cc by-sa 2.5, cc by-sa 3.0 and cc by-sa 4.0

0 0 votes
Article Rating
Notify of

Inline Feedbacks
View all comments
Would love your thoughts, please comment.x