That's exactly what I asked for, thank you.
I've now got the Charge current flow working as it should. It tries to turn on one relay or turn off one relay depending on charge current thresholds, which operates through the sequential node.
I've also got the SoC flow working so that a "set flow state" node counts the number of relays "allowed".
I need to get the "context based routing" node to then allow or block messages from the Charge Amps switch node depending on how the number of relays "on" compares to the number "allowed".
[{"id":"397d01c92ab99c26","type":"switch","z":"427b38e8dd718872","name":"Charge Amps","property":"payload","propertyType":"msg","rules":[{"t":"gte","v":"20","vt":"num"},{"t":"lt","v":"2","vt":"num"}],"checkall":"true","repair":false,"outputs":2,"x":215.39614868164062,"y":504.66521072387695,"wires":[["d6d5b8096fd7fdfd"],["23fe357e2cdb1793"]]},{"id":"d6d5b8096fd7fdfd","type":"change","z":"427b38e8dd718872","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"1","tot":"num"}],"action":"","property":"","from":"","to":"","reg":false,"x":414.3961486816406,"y":432.51140213012695,"wires":[["a4e09f3d94470dc7"]]},{"id":"23fe357e2cdb1793","type":"change","z":"427b38e8dd718872","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"0","tot":"num"}],"action":"","property":"","from":"","to":"","reg":false,"x":414.40380859375,"y":579.5038328170776,"wires":[["b5344c3eb792e316"]]},{"id":"9b9a565329868d48","type":"function","z":"427b38e8dd718872","name":"Sequentially","func":"// On Start\nlet msg1 = {}\nlet msg2 = {}\nlet msg3 = {}\nlet msg4 = {}\n\nlet aArray = context.get('aArray')\nlet aCount = context.get('aCount')\nlet pFront = context.get('pFront')\nlet pBack = context.get('pBack')\n\nconst invar = msg.payload\n\nswitch (invar) {\n case 1:\n if(aCount === 3) {\n // \n } else {\n aCount += 1\n pFront = (pFront += 1)% 3\n aArray[pFront] = 1\n } \n break\n case 0:\n if (aCount === 0) {\n //\n } else {\n aCount -= 1\n pBack = (pBack += 1)% 3\n aArray[pBack] = 0\n }\n break\n}\n\nnode.status('Input ' + invar + ' Count ' + aCount)\n\ncontext.set('aArray', aArray)\ncontext.set('aCount', aCount)\ncontext.set('pFront', pFront)\ncontext.set('pBack', pBack)\nmsg1.payload = aArray[0]\nmsg2.payload = aArray[1]\nmsg3.payload = aArray[2]\nmsg4.payload = aCount\n\nreturn [msg1, msg2, msg3,msg4]\n","outputs":4,"noerr":0,"initialize":"// Code added here will be run once\n// whenever the node is started.\n\ncontext.set('aArray', [0,0,0])\ncontext.set('aCount', 0)\ncontext.set('pFront', -1)\ncontext.set('pBack', -1)\n\nlet msg1 = {payload: 0}\nlet msg2 = {payload: 0}\nlet msg3 = {payload: 0}\nlet msg4 = {payload: 0}\nnode.send([msg1, msg2, msg3, msg4])\nnode.status('Input ' + 0 + ' Count ' + 0)\n\n","finalize":"","libs":[],"x":654.2653160095215,"y":579.0000019073486,"wires":[["445c021019c3b8f3"],["4a4383b3bee043ee"],["2cdbea9e4a1f5cd0"],["531126a1be7b95e7"]]},{"id":"445c021019c3b8f3","type":"debug","z":"427b38e8dd718872","name":"debug 267","active":true,"tosidebar":false,"console":false,"tostatus":true,"complete":"payload","targetType":"msg","statusVal":"payload","statusType":"auto","x":869.2653121948242,"y":508.99999618530273,"wires":[]},{"id":"4a4383b3bee043ee","type":"debug","z":"427b38e8dd718872","name":"debug 268","active":true,"tosidebar":false,"console":false,"tostatus":true,"complete":"payload","targetType":"msg","statusVal":"payload","statusType":"auto","x":869.2653121948242,"y":570.9999961853027,"wires":[]},{"id":"2cdbea9e4a1f5cd0","type":"debug","z":"427b38e8dd718872","name":"debug 269","active":true,"tosidebar":false,"console":false,"tostatus":true,"complete":"payload","targetType":"msg","statusVal":"payload","statusType":"auto","x":871.2653121948242,"y":629.9999656677246,"wires":[]},{"id":"531126a1be7b95e7","type":"debug","z":"427b38e8dd718872","name":"Count","active":false,"tosidebar":true,"console":false,"tostatus":true,"complete":"payload","targetType":"msg","statusVal":"payload","statusType":"auto","x":863.2653121948242,"y":701.9999952316284,"wires":[]},{"id":"a4e09f3d94470dc7","type":"switch","z":"427b38e8dd718872","name":"Context based routing","property":"state","propertyType":"flow","rules":[{"t":"eq","v":"1","vt":"num"},{"t":"eq","v":"2","vt":"num"},{"t":"eq","v":"3","vt":"num"}],"checkall":"true","repair":false,"outputs":3,"x":628.2653427124023,"y":433.1345558166504,"wires":[[],[],["b5344c3eb792e316"]]},{"id":"67ade33ae95ace29","type":"inject","z":"427b38e8dd718872","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"21","payloadType":"num","x":68,"y":454.9154243469238,"wires":[["397d01c92ab99c26"]]},{"id":"b1f41935c86bae0f","type":"inject","z":"427b38e8dd718872","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"1","payloadType":"num","x":68.40383911132812,"y":560.9153928756714,"wires":[["397d01c92ab99c26"]]},{"id":"b5344c3eb792e316","type":"junction","z":"427b38e8dd718872","x":552.3887345716357,"y":579.398544549942,"wires":[["9b9a565329868d48"]]}]
Or am I barking up the wrong tree?