scott
12/14/2022, 4:52 PMtrigger = all_finished
in prefect 1? This thread suggests that it’s using .submit()
https://discourse.prefect.io/t/how-can-i-trigger-downstream-tasks-based-on-upstream-task-s-state/106 on the task that you want to always run regardless of upstream task failures?Bianca Hoch
12/14/2022, 9:29 PMtrigger = all_finished
, it's handled pythonically now. You can use conditional statements within the flow run itself in 2.0, which previously wasn't available in 1.0 (which is why we had these triggers as a workaround). Within the example that Anna provided, she is using conditional logic to determine which tasks should run given upstream conditions. The `always_run`task in the example falls outside of the if/else statement, so it runs regardless of the states of the upstream tasks..submit()
, but that depends on what you want to do in your code. If you want to reference the contents of a PrefectFuture (state and result of a task) at some point in your code, you can use .submit()
. If not, and you want to base the code logic on something else, you don't need to reference .submit()
.scott
12/15/2022, 12:14 AM