Hello. in Prefect1, I have a task in a flow, and I...
# prefect-community
m
Hello. in Prefect1, I have a task in a flow, and I want to reuse this task in another flow 2 times with different parameters, with the second run being dependent on the fist one. Something like this:
Copy code
../flow_1.py
    @task(my_task)
    def my_task(param)
.................................
from flow_1.py import my_task
../flow_2.py
    @Flow(some_flow):
        my_task(param_1)

        my_task(param_2, upstream_tasks=[my_task])
Since the 2 tasks in my Flow in flow_2 have the same name, would
upstream_tasks
work? Is there a better way to do this? Thank you
1
I think I simply need to change the tasks to this
Copy code
from flow_1.py import my_task
../flow_2.py
    @Flow(some_flow):
        task_1 = my_task(param_1)

        task_2 = my_task(param_2, upstream_tasks=[task_1])
facepalm
1
🚀 1
b
Hello Mansour! Looks like you've arrived at the right answer.
👍 1