https://prefect.io logo
#prefect-community
Title
# prefect-community
m

Mansour Zayer

07/05/2022, 7:30 PM
Can someone point me to the right direction please? I'm using Prefect 1.2.2 I have a flow (flow_A) that makes an API call, then flow_B will Transform some of that data, and I want these 2 flow to remain independent while running flow_B as close to flow_A as possible. What is the correct way to ensure that flow_B only starts after flow_A is finished? (I don't want any of these flows to trigger each other, I just want flow_B to wait on flow_A). I tried using
wait_for_flow_run
, but I get asked for a
flow_run_id
, while I don't have a
flow_run_id
, I only have a
flow_id
for the parent flow flow_A
1
k

Kevin Kho

07/05/2022, 7:35 PM
You can have a parent flow that calls both of these so that you have the
flow_run_id
. Otherwise you can get the latest flow run id like this and then insert it to
wait_for_flow_run
m

Mansour Zayer

07/05/2022, 7:56 PM
@Kevin Kho Thanks. I think I'll go with a flow of flows. There are tasks that are repeated in multiple flows, sometime with minor differences that can be managed by introducing input arguments. What is the best practice regarding that, if we want to reuse a task in different flows? Or should we keep copying tasks?
k

Kevin Kho

07/05/2022, 7:56 PM
You can import it? Just make sure the agent as access to it
1
4 Views