There’s actually another dimension to this that I didn’t mention, and that’s how the “sequence” (i.e., script or automation action) is “called.” That can either be blocking or background.
Automations will always call their action sequence non-blocking (i.e., “background.”) So in that case, if you configure the action sequence to be parallel, then yes, all runs, from all trigger firing events, will run in parallel, so there could be many, many runs happening concurrently, each with its own unique trigger
variable.
For scripts, you will be able to control how it calls other scripts via a new parameter to the script.turn_on
service. The new parameter will be background
, and its default will be false
(which also applies if you call the script directly by its name, such as script.abc
instead of via the script.turn_on
service.) So, by default, when one script calls another, it will wait for it to finish before moving on to the next step. So, even if the called script is configured in parallel mode, it won’t actually run “in parallel” if called twice from another script using the default blocking (i.e., background false) call mode. But, if one script calls another script with “background: true
”, then it is possible for one script to call another script multiple times where the called script will run multiple times concurrently. Or it’s also possible for a script to get called from multiple places, and that, too, can lead to multiple parallel runs.
So, in summary, there are two dimensions.
The first is, when one script calls another script, you can decide whether it should do that call in a blocking fashion, or if the called script should be run in the background (and hence the calling script will almost immediately go onto its next step without waiting for the called script to finish.) And for automations, there is only background call mode for its action
sequence.
The second is the sequence’s mode, which controls what it should do if invoked when a previous invocation is still running. As I mentioned before there will be several options. The complete list will be: ignore
, error
, restart
, parallel
, queue
, oh, and legacy
to mimic the current behavior.