Abort function without any output

Hello
Is it possible to abort a flow during the run in a function with a certain If Then condition so that no payloads or other things are output? The function should then behave absolutely calmly as if nothing had happened.
I have only found the possibility that the function has 2 outputs and I let the second output run into nothing with the If Then condition.

If you are in a Function node then return null will not send a message. A common pattern that I use is

if (some condition) {
  msg = null
} else {
  do normal stuff
}
return msg
1 Like

THX
that makes live easy

If you are not already in a function node then you can use a Switch node that checks the state and only passes good messages through. So for example is you only wanted messages where the payload is 1 then configure it like

image

Any other messages will be dropped.

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