And Here is a low code way to achieve similar.
[{"id":"3632a93e.af1496","type":"inject","z":"c791cbc0.84f648","name":"","props":[{"p":"payload"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"1","payloadType":"str","x":50,"y":700,"wires":[["8b5cd1d9.c24818"]]},{"id":"8b5cd1d9.c24818","type":"join","z":"c791cbc0.84f648","name":"60 sec","mode":"custom","build":"string","property":"payload","propertyType":"msg","key":"topic","joiner":"","joinerType":"str","accumulate":false,"timeout":"60","count":"","reduceRight":false,"reduceExp":"$A & $$.payload","reduceInit":"","reduceInitType":"str","reduceFixup":"$length($A)","x":180,"y":700,"wires":[["d585a8df.4eefc"]]},{"id":"d585a8df.4eefc","type":"change","z":"c791cbc0.84f648","name":"convert to number or if wish T/F","rules":[{"t":"set","p":"payload","pt":"msg","to":"$length($$.payload)","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":420,"y":700,"wires":[["e759132a.fac86"]]},{"id":"e759132a.fac86","type":"switch","z":"c791cbc0.84f648","name":"output based on number or T/F","property":"payload","propertyType":"msg","rules":[{"t":"lt","v":"5","vt":"num"},{"t":"gte","v":"5","vt":"num"}],"checkall":"false","repair":false,"outputs":2,"x":760,"y":700,"wires":[["02f1fafdc71e278d"],["35ce92ac.60e8ae"]]},{"id":"02f1fafdc71e278d","type":"debug","z":"c791cbc0.84f648","name":"less than","active":true,"tosidebar":true,"console":false,"tostatus":true,"complete":"payload","targetType":"msg","statusVal":"payload","statusType":"auto","x":630,"y":640,"wires":[]},{"id":"35ce92ac.60e8ae","type":"debug","z":"c791cbc0.84f648","name":"greater than","active":true,"tosidebar":true,"console":false,"tostatus":true,"complete":"payload","targetType":"msg","statusVal":"payload","statusType":"auto","x":640,"y":760,"wires":[]}]
You could package it in a Subflow with as many outs as you wish.