Hi, I'm new to Prefect and trying out some basic s...
# prefect-community
s
Hi, I'm new to Prefect and trying out some basic stuff, and got a doubt. I have three tasks
a()
b()
c()
each of which waits for 2 secs and prints the current time. Next, I created the following flows:
Copy code
with Flow("flow-a") as flow_a:
        a()
        b()

    with Flow("parent-flow") as flow:
        c()
        flow_a.run(executor=LocalDaskExecutor())
    
    flow.run(executor=LocalDaskExecutor())
Here, to my surprise, task
a
and
b
run first, then after 2 seconds task
c
runs. Example o/p:
Copy code
b: 23:04:32
a: 23:04:32
c: 23:04:34
I want all 3 to run parallelly, what am I doing wrong? (Sorry, if this is not the right forum to ask these questions.)
k
Hi @Sumant Agnihotri, this is the right place to ask. 1.0 does not support subflows like this, but Prefect 2.0 does. For 1.0, you need to register the subflow on Prefect Cloud, and then invoke it with the
create_flow_run
task. Maybe 2.0 will suit your needs more? You can try it there. The default task runner is the
ConcurrentTaskRunner
👍 1