Bug report: trigger node not passing the correct msg object

Hi, I'm not sure where is best to post this.

The trigger node set to send the latest msg object is not passing the latest msg object, but the first msg object with only the payload value replaced.

Here's what it looks like:

The trigger node settings:

I am expecting the debug Passed message to be equal to Message 2.
Instead, it is a mix of Message 1 and Message 2 msg-object contents.

The code to reproduce (Node-RED 1.0.3: Maintenance Release):

[{"id":"42c29b08.2b2784","type":"trigger","z":"d8fc40a5.f4ce2","op1":"","op2":"","op1type":"nul","op2type":"payl","duration":"5","extend":false,"units":"s","reset":"","bytopic":"all","name":"","x":520,"y":180,"wires":[["a954ede4.92d5c"]]},{"id":"a954ede4.92d5c","type":"debug","z":"d8fc40a5.f4ce2","name":"Passed message","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","x":710,"y":180,"wires":[]},{"id":"d04c3e77.e42ea","type":"debug","z":"d8fc40a5.f4ce2","name":"Message 1","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","x":530,"y":100,"wires":[]},{"id":"52a161c1.2c784","type":"inject","z":"d8fc40a5.f4ce2","name":"","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":180,"y":140,"wires":[["6d25d2f1.25824c","73970088.564fb"]]},{"id":"73970088.564fb","type":"change","z":"d8fc40a5.f4ce2","name":"Set 1","rules":[{"t":"set","p":"payload","pt":"msg","to":"Payload of message 1","tot":"str"},{"t":"set","p":"key1","pt":"msg","to":"Value from message 1","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":350,"y":140,"wires":[["42c29b08.2b2784","d04c3e77.e42ea"]]},{"id":"173de41.89eb21c","type":"change","z":"d8fc40a5.f4ce2","name":"Set 2","rules":[{"t":"set","p":"payload","pt":"msg","to":"Payload of message 2","tot":"str"},{"t":"set","p":"key2","pt":"msg","to":"Value from message 2","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":350,"y":220,"wires":[["42c29b08.2b2784","7116a57.075b05c"]]},{"id":"6d25d2f1.25824c","type":"delay","z":"d8fc40a5.f4ce2","name":"","pauseType":"delay","timeout":"2","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":200,"y":220,"wires":[["173de41.89eb21c"]]},{"id":"7116a57.075b05c","type":"debug","z":"d8fc40a5.f4ce2","name":"Message 2","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","x":530,"y":260,"wires":[]}]

This looks as a bug to me. Am I wrong?

1 Like

Confirming that I see the same symptom.
Node-RED version: v1.0.3
Node.js version: v12.16.1

I too shall concur.

NR 1.0.3
node 10.18.1


It's nice to see I am not the only one who plays around the limits of the program.

Don't be afraid to ask if you don't understand something.
It is only when you try these sorts of things do you find problems/bugs/etc.

@dceejay is this a bug?

Indeed - please raise an issue...

Sorry, but I'm fairly new to Node-RED and did not figure out yet how it is maintained.

Which repo includes built-in (?) nodes?

The core nodes are in the main repo https://github.com/node-red/node-red/issues

ONLY for the sake of curiosity, where on the local machine is the code for the node?

Is it like the other nodes or is it in a bigger package?

I've tried finding it but to no avail.

find / -name 89-trigger.js 2>/dev/null

on my system:

1 Like

I didn't know it was actually called 89-trigger.


The filenames are in the repository

Yeah, ok.

But that is unexplored land for me. I'll have a butcher's hook at the code when I get time.

I'm not good with the github repository.

It is surely valuable time spend, if you click the history button for that file, you can see that @dceejay already made changes to the code


I am not trying to shame anyone. I am just curious to see the code with the problem and see if I can nut it out myself.

Though I will update the node to the newer version all the same.

Small hint: while browsing the GitHub repo, you can press t on your keyboard and enter a filename (or a part of) -- it will show you matching files.

What is the meaning of the numbers preceeding the nodes' names?

Is it some kind of prioritization?

it's ancient history

Not so much ancient history, rather a key way we are able to control what order the nodes appear in the palette.

1 Like

Ok, next dumb question from me.

Ok. But when I go to the palette manager there is no update to the trigger node.

Sorry if I am even dumber than I usually am. There are a few things going on which are really not helping me.