Running dynamic number of child coroutines in parallel with cancellation

Let’s say I have following code:

interface Process {
    suspend fun run()

class ParallelProcess(initialChildren: List<Process>): Process {
    val children = mutableListOf(initialChildren)
    override suspend fun run() {
        if(!isActive()) throw IllegalStateException()
        // Run all the children here and wait for them
        // including the one that may have been added 
        // while this is running.
    fun addChild(child: Process) {
        // Add the child and start running it.
    fun cancel() {
        // Cancel all the children and this process as well.

So the idea is the class ParalleProcess will run all the child processes in parallel
and more children can be added while it is still running.

The child process are independent and does not affect each other so if one fails the others and parent are not effected. I think here SuprevisorJob may fit for use but I am not sure how to use in this case.

Cancelling the parent process should cancel all the children as well.

What is the best way achieve the above functionality?