This simple subflow can be used to cycle actions such as choosing a new scene or radio station for each new payload received. Suitable to be used in conjunction with a change node. Double click the subflow to set the numbr of scenes/actiona and set AutoReset to true if you want the counter to reset after 3 seconds (great if you want an easy way to default to your favourite scene).
Subflow
Example flow 1
Example flow 2
Copy the subflow below to your clipboard and then import into Node-RED using the Import From > Clipboard (Ctrl-I) menu option