10 Reasons for Migrating to Prefect 2

From Prefect 1 or another orchestration framework

Anna Geller
6 min readNov 28, 2022

At Prefect, we have an ambassador program called Club42. One of our club members recently asked: why should I migrate to Prefect 2? If you are using Prefect 1 or another orchestrator, here is a list of reasons you should consider migrating to Prefect 2.

#1 Just Python

Prefect 2 embraces the philosophy that your code is already the best representation of your workflow. You shouldn’t have to learn new logic to implement branching and conditional flow. Loops shouldn’t be forbidden. Therefore, in Prefect 2, DAGs are optional. Your workflow graph doesn’t have to be directed or acyclic. You simply write native Python with function calls, if/else statements, or for/while loops and you can optionally add tasks to your @flow if you want to add more visibility, caching, parallelism, concurrency, and other features that @task provides. Dataflow in Prefect is quite literally as easy as .py.

#2 Ephemeral API

Remember when you had to first deploy or register your workflow DAG before you could see your workflow execution in the UI? That’s no longer the case in Prefect 2. You write a Python function and run it like any Python script.

from prefect import flow…

--

--