Cascade (chain) events on devices of a particular group

Hello world,

How can it be possible to create a cascade of events in home assistant for all the entities of a group and trigger them with a push button ?

Here is an example:
I want a push button to start sprinklers in the garden, one sprinkler after another. Each sprinkler is timed autonomously (sonoff mini swithces using tasmota and PulseTime), and they all belong to a group “sprinklers” . I want to start sprinkler-01, but when sprinkler-01 has finished, I want sprinkler-02 to start, and so on until sprinkler-n .

This is probably not the best idea but I would create n-automation to do this.
First automation to start sprinkler-01, second automation to run sprinkler-02 when sprinkler-01 has change state from “on” to “off” and so on with rest of the sprinklers/automations.

@pniewiadowski , yes, this would be the most naïve approach, and would work.
I wanted something more dynamic, so I can also apply it to other automations.

Then I would go for some python_script. Here is an idea how to use it:

And one more example:

I think we can put the while loop to check if current item is still on, if not then go to the next item from the group.

One more idea. https://opensprinkler.com/

It allows to queue the sprinklers.

Sprinklers were just an example. But, actually, there many other usages and scenario.
Python script for this is clearly overkill.