Hi, new here and apologies if this has been asked....
# prefect-community
v
Hi, new here and apologies if this has been asked. I have tried searching this slack and online for answers and the closest thing I could find that was an answer was the Flow-of-flows post. The scenario that I'm trying to deal with is the following: 1. There are two flows (A and B). I maintain B and another project team maintains A. 2. I cannot run the flow A as this flow generates data for the company at large for multiple projects to use. 3. I need my flow to run after the latest successful flow run of A (this happens on a roughly weekly basis but can sometimes be delayed) with updated parameters. Given the above, what is the best pattern to implement in Prefect? I have written a function that queries the GraphQL API and can return the result from the final state of the latest successful flow run of flow A. Is using this result the best way to proceed? The other team is willing to change the way their flows are run and what data/metadata their flows generate. I just cannot set it up as a flow-of-flows because they do not want other teams running their flows.
1
k
You basically have two options. 1. Ask Flow A to trigger Flow B upon completion and pass the necessary information. This couples the two flows together. 2. Run Flow B as is and poll for the completion of Flow A So yes I think you are on the right track
v
Thanks for the response. I will implement 2 as we do not want other teams to be able to kick off flows in our project. Given that, is there an example somewhere of putting the polling task in a while loop?
k
You have two options. First is like normal Python
Copy code
@task
def abc():
    cond_not_met = True
    while cond_not_met:
       ...
second is on the task. Put a high
max_retries
and
retry_delay
and then
raise FAIL
if the condition is not met
v
Got it. So obvious...I was just stuck thinking in some other mode. Thanks!
👍 2