Here is a low code example if true is received 3 or more times within 120 seconds the message is passed
[{"id":"9e8b475e121dbc44","type":"inject","z":"b9860b4b9de8c8da","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"true","payloadType":"bool","x":170,"y":1220,"wires":[["273f7fa9926adcd2"]]},{"id":"273f7fa9926adcd2","type":"join","z":"b9860b4b9de8c8da","name":"","mode":"custom","build":"array","property":"payload","propertyType":"msg","key":"topic","joiner":"\\n","joinerType":"str","accumulate":false,"timeout":"120","count":"3","reduceRight":false,"reduceExp":"","reduceInit":"","reduceInitType":"","reduceFixup":"","x":330,"y":1220,"wires":[["f3112e493a231754"]]},{"id":"f3112e493a231754","type":"switch","z":"b9860b4b9de8c8da","name":"","property":"$count($$.payload)","propertyType":"jsonata","rules":[{"t":"gte","v":"3","vt":"num"}],"checkall":"true","repair":false,"outputs":1,"x":470,"y":1220,"wires":[["315ace8e8c6cecae"]]},{"id":"315ace8e8c6cecae","type":"debug","z":"b9860b4b9de8c8da","name":"debug 288","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":650,"y":1220,"wires":[]}]
How to import a flow