What’s prefect’s replacement for airflow’s backfil...
# prefect-community
b
What’s prefect’s replacement for airflow’s backfill? With checkpointing enabled, am I able to run a job from a specific task and all downstream dependencies will execute?
z
Hi Bryan! Your suggestion should do the trick-- as long as you're using checkpointing and all your necessary task triggers have been met, your downstream dependencies will execute. As far as rerunning from a specific task, I don't think we support that outside of Cloud since it requires some knowledge of the state of the flow and task runs. It's not directly related to your question, but let me know if this link is helpful to you at all: https://docs.prefect.io/cloud/faq.html#does-prefect-support-backfills
b
Thanks for pointing that out! Is there a way to access the downstream tasks for a given task? Then i assume its as easy as looping those tasks and executing
task.run()
right?
z
Sure thing! Flows are defined as tasks connected by edges. Each edge has an
upstream_task
and a `downstream`task-- that should get you where you want to go. As for how to access these edges, they should be defined in the
edges
attribute of your flow: https://docs.prefect.io/api/unreleased/core/flow.html#flow-2
c
Following up on this, there are also two Flow helper methods for this sort of thing:
Copy code
flow.downstream_tasks(my_task)
flow.upstream_tasks(my_task)
which return the corresponding sets of tasks