I used a state machine node to model this (there are probably better ways to do this but hey, I had some fun doing this).
[{"id":"9730b3e50d94bee3","type":"state-machine","z":"8b43de8505f17be7","name":"","triggerProperty":"payload","triggerPropertyType":"msg","stateProperty":"payload","statePropertyType":"msg","initialDelay":"0","persistOnReload":true,"outputStateChangeOnly":false,"throwException":false,"states":["start","L1 On","L2 On","L3 On","L1 Off","L2 Off","L3 Off"],"transitions":[{"name":"start","from":"start","to":"L1 On"},{"name":"1.1","from":"L1 On","to":"L2 On"},{"name":"1.2","from":"L2 On","to":"L3 On"},{"name":"1.3","from":"L3 On","to":"L3 Off"},{"name":"1.4","from":"L3 Off","to":"L2 Off"},{"name":"1.5","from":"L2 Off","to":"L1 Off"},{"name":"2.1","from":"L1 Off","to":"L2 On"},{"name":"2.2","from":"L2 On","to":"L3 On"},{"name":"2.3","from":"L3 On","to":"L1 On"},{"name":"2.4","from":"L1 On","to":"L1 Off"},{"name":"2.5","from":"L1 Off","to":"L3 Off"},{"name":"2.6","from":"L3 Off","to":"L2 Off"},{"name":"3.1","from":"L2 Off","to":"L3 On"},{"name":"3.2","from":"L3 On","to":"L1 On"},{"name":"3.3","from":"L1 On","to":"L2 On"},{"name":"3.4","from":"L2 On","to":"L2 Off"},{"name":"3.5","from":"L2 Off","to":"L1 Off"},{"name":"3.6","from":"L1 Off","to":"L3 Off"}],"x":980,"y":440,"wires":[["f7e88da829ecdf77"]]},{"id":"f57841bb9389b766","type":"inject","z":"8b43de8505f17be7","name":"","props":[{"p":"payload"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"1.1","payloadType":"str","x":770,"y":440,"wires":[["9730b3e50d94bee3"]]},{"id":"f7e88da829ecdf77","type":"debug","z":"8b43de8505f17be7","name":"debug 8","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":1180,"y":440,"wires":[]},{"id":"14d389c3f887a367","type":"inject","z":"8b43de8505f17be7","name":"","props":[{"p":"payload"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"start","payloadType":"str","x":770,"y":380,"wires":[["9730b3e50d94bee3"]]},{"id":"f84e39080b188201","type":"inject","z":"8b43de8505f17be7","name":"","props":[{"p":"payload"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"1.2","payloadType":"str","x":770,"y":500,"wires":[["9730b3e50d94bee3"]]},{"id":"2bf9f488b1b9506f","type":"inject","z":"8b43de8505f17be7","name":"","props":[{"p":"payload"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"1.3","payloadType":"str","x":770,"y":560,"wires":[["9730b3e50d94bee3"]]},{"id":"2cb6b8b4074daba5","type":"inject","z":"8b43de8505f17be7","name":"","props":[{"p":"payload"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"1.4","payloadType":"str","x":770,"y":620,"wires":[["9730b3e50d94bee3"]]},{"id":"e7c2bad8f40e0d90","type":"inject","z":"8b43de8505f17be7","name":"","props":[{"p":"payload"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"1.5","payloadType":"str","x":770,"y":680,"wires":[["9730b3e50d94bee3"]]}]
Or you could use a node-red context to keep track of your “helper value”
https://nodered.org/docs/user-guide/context