Help with subflows and node-status.... Looking for ideas

Sorry folks, something has got my curiosity going and it is kind of annoying.

:wink:

I got STUNG today re-writing code from 8 years ago (or there about).

I was using a function node as a gate, but with a bit more complicated.
(Maybe I can have a look at the mechanics of that and do it differently.... But anyway.)

What I would like to get is a changing status on a subflow so it blinks.

I'll explain better. BLINK - maybe a bad choice of words.

The subflow receives a message and does it's magic.
There is considerable time between the arrival of the message and the sending of the message.

When it receives a message, I want to set the status to even just a dot.
Then when it sends the message, it wipes itself clean.
This way I can see messages are arriving and being sent.

I could cheat and put a couple of function nodes that do a node.status{()} at the in and one on the output to wipe it.

But I've read/heard that is a LOT of overhead for such a simple thing.

I don't know.

Is there an alternative?

I could post the subflow, but I don't think that would really achieve much.

Thanks in advance.

Unless I have misread, just use the status box inside the subflow?

[{"id":"9550e72362306bcd","type":"subflow","name":"Subflow 1","info":"","in":[{"x":180,"y":165,"wires":[{"id":"1d07da94e5eea09d"},{"id":"fc5858972fe27307"}]}],"out":[{"x":940,"y":170,"wires":[{"id":"fc5858972fe27307","port":0}]}],"status":{"x":940,"y":300,"wires":[{"id":"2029f6053930dbe4","port":0},{"id":"e1f1ed1612dad46e","port":0}]}},{"id":"2029f6053930dbe4","type":"change","z":"9550e72362306bcd","name":"Set Busy","rules":[{"t":"set","p":"payload","pt":"msg","to":"{     \"fill\": \"red\",     \"shape\": \"dot\",     \"text\": \"Busy....\" }","tot":"json"}],"action":"","property":"","from":"","to":"","reg":false,"x":770,"y":300,"wires":[[]]},{"id":"fc5858972fe27307","type":"delay","z":"9550e72362306bcd","name":"Do Slow Stuff","pauseType":"delay","timeout":"3","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"allowrate":false,"outputs":1,"x":470,"y":170,"wires":[["e1f1ed1612dad46e"]]},{"id":"e1f1ed1612dad46e","type":"change","z":"9550e72362306bcd","name":"Clear Status","rules":[{"t":"set","p":"payload","pt":"msg","to":"{}","tot":"json"}],"action":"","property":"","from":"","to":"","reg":false,"x":780,"y":255,"wires":[[]]},{"id":"1d07da94e5eea09d","type":"junction","z":"9550e72362306bcd","x":430,"y":300,"wires":[["2029f6053930dbe4"]]},{"id":"ddb16088ef2c6977","type":"subflow:9550e72362306bcd","z":"2d7bf6e3.84c97a","name":"","x":395,"y":740,"wires":[["fd612c16dcf105fb"]]},{"id":"9518032fc4b9dd2c","type":"inject","z":"2d7bf6e3.84c97a","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":200,"y":740,"wires":[["ddb16088ef2c6977"]]},{"id":"fd612c16dcf105fb","type":"debug","z":"2d7bf6e3.84c97a","name":"debug 2","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":600,"y":740,"wires":[]}]

May-24-2025 10-33-35

Try to avoid using a function node, just to set the status.
Line up a few change nodes, and trigger them at your desired points in the operation.

2 Likes

HOW DID I MISS THAT?

Thanks.

As normal, I over thought it.

Thanks.

1 Like