Kapacitor Tasks execution

How does Kapacitor tasks are executed?
Say we have 10 Tasks defined,are the tasks executed in sequence, if so, how is the sequence defined?
is it possible to execute the Tasks similar to a CASE statement? say if we have 500 different tasks and one of the tasks is relevant to the actual data being processed (the where condition on the from() node is valid), can a “global” flag be raised to indicate all the other tasks to not even try to execute?

Kapacitor tasks will execute in parallel not in serial. There is no way to define a case like structure within kapacitor to define task execution. But depending on the type of task it will only execute when it is required based on if it is a stream and receives data or a batch and is told to run. The rest of the time it is basically just listening and waiting.