how to stop the async task runs in flow context? I...
# ask-community
t
how to stop the async task runs in flow context? I need to execute a loop in the flow context but I don’t want it to execute the next loop before the first loop is finished. I see the tasks are executed asynchrously. For example:
Copy code
with Flow(
    name="ETL",
) as flow:
    page = 0
    max_page = 999999
    while page <= max_page:
        page += 1
        dummy_task()
I read this in the prefect 2 doc but it seems it’s not available in 1:
Sequential execution
task runner:
Copy code
from prefect.task_runners import SequentialTaskRunner
m
Hey @Tony Yun in 1.0 this would be the LocalExecutor
Copy code
from prefect.executors import LocalExecutor

flow.executor = LocalExecutor()
from this article https://discourse.prefect.io/t/what-is-the-default-taskrunner-executor/63