and
let lastTopic = context.get("lastTopic") ?? msg.setting
// topic unchanged => send to output 1
let messages = [msg, null]
if (msg.setting !== lastTopic) {
// topic changed => send to output 2
messages = [null, msg]
}
context.set("lastTopic", msg.setting)
return messages;
So where would you place the queue then?
Here it is after the start_all function which I changed as per your suggestion to output all 10 possible msg.setting
payloads in a row.
The problem is that the msg.setting payload does not create multiple messages until after the split nodes which are located towards the end of the sub-flows.
flows.json (287 Bytes)