I am hoping to have a task be blocked by an upstr...
# ask-community
j
I am hoping to have a task be blocked by an upstream task whose execution depends on a parameter, and that does not necessarily provide any input to the downstream task. With my current flow structure the downstream task is only executed when my parameter is set to
false
. How can i get it to execute in both cases where the parameter is
true
or
false
? Sample code in thread
Here is some sample code
Copy code
with Flow(name="Example Flow") as example_flow:
    boolean_parameter = Parameter("strict_transfer", True)

    with case(boolean_parameter, True):
        my_task_function = some_function(some_option=True)

    with case(boolean_parameter, False):
        my_task_function = some_function(some_option=False)

    some_other_task_function(upstream_tasks=[my_task_function])
Notably, i do not need to store any output from
some_function()
, but my understanding was that I need to assign it to a variable to feed it to the
upstream_tasks
parameter
k
Maybe use a trigger with
always_run
? Docs
I think the trigger will help. I tried your code and it looks like
some_other_task_function
gets a SKIPPED state, so you can also do
skip_on_upstream_skip=False
in the
@task
definition
j
thanks!