Hi, I have a slightly different proposal using the m-queue node.

Fairly simple and if you trigger peek (can be done periodically) you get an array at the end that has all states in one object.
[{"id":"720f7dd99f962075","type":"m-queue","z":"f0296260535ccbc8","name":"","queueSelect":"topic","controlFlag":"control","defaultQueue":"default","allQueues":"all","triggerCmd":"trigger","statusCmd":"status","pauseCmd":"pause","resumeCmd":"resume","flushCmd":"flush","resetCmd":"reset","peekCmd":"peek","dropCmd":"drop","maximumCmd":"maximum","newestCmd":"newest","protectCmd":"protect","deleteCmd":"delete","paused":false,"protect":false,"keepNewestDefault":true,"maxSizeDefault":"1","protectDefault":false,"persist":false,"newValue":"value","storeName":"memoryOnly","statusOutput":true,"outputs":2,"x":920,"y":140,"wires":[["027d529eda18e2a0"],["d7772691142da56a"]]},{"id":"d7772691142da56a","type":"debug","z":"f0296260535ccbc8","name":"","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":1090,"y":240,"wires":[]},{"id":"6cfb2d6280d7881e","type":"inject","z":"f0296260535ccbc8","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"},{"p":"control","v":"true","vt":"bool"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"all","payload":"reset","payloadType":"str","x":750,"y":360,"wires":[["720f7dd99f962075"]]},{"id":"027d529eda18e2a0","type":"join","z":"f0296260535ccbc8","name":"","mode":"custom","build":"object","property":"payload","propertyType":"msg","key":"topic","joiner":"\\n","joinerType":"str","accumulate":false,"timeout":"1","count":"","reduceRight":false,"reduceExp":"","reduceInit":"","reduceInitType":"","reduceFixup":"","x":1090,"y":140,"wires":[["91e550e29b099f9b"]]},{"id":"2d222a55e9dcd068","type":"inject","z":"f0296260535ccbc8","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"machine1","payload":"1","payloadType":"num","x":630,"y":120,"wires":[["c75a6353e5e8d105"]]},{"id":"2255342a5bd95ecc","type":"inject","z":"f0296260535ccbc8","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"machine2","payload":"2","payloadType":"num","x":630,"y":180,"wires":[["c75a6353e5e8d105"]]},{"id":"e8c75a221e5f6175","type":"inject","z":"f0296260535ccbc8","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"machine3","payload":"2","payloadType":"num","x":630,"y":240,"wires":[["c75a6353e5e8d105"]]},{"id":"91e550e29b099f9b","type":"debug","z":"f0296260535ccbc8","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":1250,"y":140,"wires":[]},{"id":"edcf661ebe964dc1","type":"inject","z":"f0296260535ccbc8","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"},{"p":"control","v":"true","vt":"bool"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"all","payload":"peek","payloadType":"str","x":750,"y":320,"wires":[["720f7dd99f962075"]]},{"id":"49ca7fa8bc88eb96","type":"comment","z":"f0296260535ccbc8","name":"https://discourse.nodered.org/t/how-to-determine-total-amount-of-running-machines/78330","info":"https://discourse.nodered.org/t/how-to-determine-total-amount-of-running-machines/78330","x":1000,"y":60,"wires":[]},{"id":"c75a6353e5e8d105","type":"junction","z":"f0296260535ccbc8","x":800,"y":140,"wires":[["720f7dd99f962075"]]}]