Hello everyone, I'm trying to parallelize flows e...
# ask-community
m
Hello everyone, I'm trying to parallelize flows execution:
Copy code
@flow(log_prints=True, task_runner=ConcurrentTaskRunner)
def sample_flow(sample_index) -> None:
    ...

def samples_parallel_executer(sample_indices):
    for sample_index in sample_indices: #TODO: Add parallelism
        sample_flow(sample_index)
However, it wasn't obvious for me how to parallelize flows execution in Prefect. Any idea what are the best practices? Thanks in advance for your help!
i
Hey, I think that you can make your flows async and call asyncio.gather, or do sample_flow(return_state=True) and check the state of these flows
m
Can you clarify what do you mean by "do sample_flow(return_state=True) and check the state of these flows"?