<@ULVA73B9P> is there a drop-in replacement for Se...
# ask-marvin
m
@Marvin is there a drop-in replacement for SequentialTaskRunner? We have a bunch of workflows where we want to run tasks in order, with the next one not starting until the previous one has finished. We're looking to upgrade to newer versions of prefect (we're currently running on older versions of the on-premises library) with the minimal amount of code changes
m
So, you're looking for a simple way to keep running tasks sequentially while upgrading Prefect versions. Let's make sure I get you the right details. Could you please tell me which version of Prefect you're looking to upgrade to? Versions 2.x and 3.x can have significant differences, and I'd like to provide the most accurate advice.
n
tldr, you don't need a task runner if you were using sequential task runner before if you had
Copy code
future = some_task.submit()
downstream_task.submit(wait_for=[future])
etc, then this is functionally the same thing as
Copy code
result = some_task()
downstream_task(wait_for=[result])
m
@Nate thanks for the quick reply! Would the same hold true if we weren't explicitly using .submit() on the tasks, or using wait_for? Ex: a lot of the workflows look like this, and are currently run using the SequentialTaskRunner, and behave as expected (dbt_snapshot runs to completion before dbt_model starts, etc.):
n
even better for you! you shouldnt have to change anything, except removing
task_runner=SequentialTaskRunner
from your
@flow
this is a common gotcha, but if you weren't using submit / map, then you weren't using the task runner
🎉 1
m
Thanks again!
catjam 1