How to Stop a function node from execution its following code?

Heya,

I want to stop a function node from executing its code if a payload is f.e. not a number.
Is there anything like "node.stop" or "node.break"?

I can't filter this in a node beforehand because there are more messages from other MQTT devices are going into.

Thank you in advance.

Look for Q-gate in the library!
Opera Snapshot_2021-01-09_094629_discourse.nodered.org

@ghayne thank you, but I think for just this "small feature" I don't wanna add a new package/plugin.

If nothing is available for just "stopping" a function node from executing its code I will return a message with just "null". Thougth there would be an "recommended" way then doing this

Returning null does exactly that. Nothing is passed on. That is the recommended method.

if ( isNaN(msg.payload)) { return null; }
2 Likes

haha, thank you :smiley:

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.