# Scaling Out

Prefect 2

With general availability of Prefect 2, we recommend new users start with Prefect 2.

Follow along in the Terminal

cd examples/tutorial
python 06_parallel_execution.py

Let's adjust our Flow to distribute its Tasks onto a Dask Cluster, parallelizing its execution. This may sound involved, but will actually be our simplest adjustment yet:



from prefect.executors import DaskExecutor

# ...task definitions...

# ...flow definition...
if __name__=="__main__":

This will spin up a Local Dask Cluster on your system to parallelize the tasks. If you already have a Dask Cluster deployed elsewhere, you can leverage that cluster by specifying the address in the DaskExecutor constructor:



Furthermore, you can implement your own Executor for use with any Prefect Flow, as long as the object provided satisfies the Executor interface (i.e. appropriate submit, map, and wait functions, similar to Python's concurrent.futures.Executor interface). In this way, the sky is the limit!

Up Next!

What else can Prefect do?...