Conditional inputs issue

Hello folks,

I am currently working on a project where I have data running through a function.

What I want is the function to not return any data unless a additional input condition is met.

So there two inputs - one is the flow of data, the other is the conditional 1 or 0.

When conditional is 1 , data flows,
When conditional is 0, data stops

Is this possible on the current set up? I get the impression you can`t send multiple inputs to a function at all?

Thank you

You can, just not at the same time.

There are a few ways so solve this and there are contrib nodes.

Here is a solution to permit data to flow through a function based on another input: Cancel inputs for a period of time - #6 by Steve-Mcl

1 Like

Or another alternative is to use node-red-contrib-simple-gate to block/allow messages through.

1 Like

Hi Colin,

So I used your approach but for some reason the gate doesnt seem to respond to open and close. I have attached my code for a review but as you can see , once closed the gate can`t be opened again - can you seen any issue here?

Best ,


flows (28).json (1.7 KB)

I don't have access to a computer at the moment. Add a debug node showing the open and close messages you are sending, and also a screenshot of the gate node config.

1 Like