You could do something like this:
in a function node:
const states = []
function checkRelays(state) {
for (let i = 0; i < state.length; i++) {
const relayState = state[i] === '1' ? true : false;
states.push({payload:relayState})
}
}
const input = checkRelays(msg.payload)
return [...states]
example flow:
[{"id":"256efbf179ac9630","type":"inject","z":"c8d44844ba5acdbd","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"10010100","payloadType":"str","x":540,"y":3920,"wires":[["e1447b35ef93b036"]]},{"id":"4ef253c26a0aa929","type":"debug","z":"c8d44844ba5acdbd","name":"debug 670","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":990,"y":3800,"wires":[]},{"id":"e1447b35ef93b036","type":"function","z":"c8d44844ba5acdbd","name":"function 312","func":"const states = []\nfunction checkRelays(state) {\n \n for (let i = 0; i < state.length; i++) {\n const relayState = state[i] === '1' ? true : false;\n states.push({payload:relayState})\n }\n}\n\nconst input = checkRelays(msg.payload)\n\nreturn [...states]","outputs":8,"timeout":0,"noerr":0,"initialize":"","finalize":"","libs":[],"x":730,"y":3920,"wires":[["4ef253c26a0aa929"],["a5d8b089ba2a42ea"],["5a7e2b01179f6f96"],["ada2265851f99f40"],["161b03708cfe9666"],["20cb51b2f2bd0ace"],["1e9e1d8ae17ca8ef"],["34e2304bd12fd1a2"]]},{"id":"a5d8b089ba2a42ea","type":"debug","z":"c8d44844ba5acdbd","name":"debug 671","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":990,"y":3840,"wires":[]},{"id":"5a7e2b01179f6f96","type":"debug","z":"c8d44844ba5acdbd","name":"debug 672","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":990,"y":3880,"wires":[]},{"id":"ada2265851f99f40","type":"debug","z":"c8d44844ba5acdbd","name":"debug 673","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":990,"y":3920,"wires":[]},{"id":"161b03708cfe9666","type":"debug","z":"c8d44844ba5acdbd","name":"debug 674","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":990,"y":3960,"wires":[]},{"id":"20cb51b2f2bd0ace","type":"debug","z":"c8d44844ba5acdbd","name":"debug 675","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":990,"y":4000,"wires":[]},{"id":"1e9e1d8ae17ca8ef","type":"debug","z":"c8d44844ba5acdbd","name":"debug 676","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":990,"y":4040,"wires":[]},{"id":"34e2304bd12fd1a2","type":"debug","z":"c8d44844ba5acdbd","name":"debug 677","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":990,"y":4080,"wires":[]}]
