Zach
04/29/2020, 10:39 PMifelse
flow conditional but it doesn't really make sense how I would use it when I have multiple "true_tasks" and they have output that feed into eachothernicholas
upstream_tasks=
) for your 3 subequent tasks. If that task doesn't run because of the conditional, the subsequent tasks will be skipped.nicholas
if
task, let me test that real quicklynicholas
import prefect
from prefect import Flow, task
from prefect.tasks.control_flow.conditional import ifelse
@task
def proceed():
# Will proceed on true
return False
@task
def spawn_branches():
return "Now THIS is podracing!"
@task
def branch1(x):
print(x)
@task
def branch2(x):
print(x)
@task
def branch3(x):
print(x)
with Flow("Ifelse Flow") as flow:
ifelse(proceed, spawn_branches, None)
branch1(spawn_branches)
branch2(spawn_branches)
branch3(spawn_branches)
flow.run()