Sudharshan B

03/03/2022, 4:38 AM
Is there a way to get the status of the flow which is already created and scheduled ( if the flow is already running or not running ) without using run_id in python3 ? (use like flow name instead) we use prefect cloud and using the python script in prefect agent.

Anna Geller

03/03/2022, 10:15 AM
Interesting, can you explain a bit more of what do you specifically try to do? The status of all flows and flow runs can be inspected even directly from the CLI:
prefect get flows
prefect get flow-runs
To get more info about a specific flow run from python code (but as you noticed, you need the flow run ID but you can also get it from
from prefect.backend import FlowRunView

flow_run = FlowRunView.from_flow_run_id("4c0101af-c6bb-4b96-8661-63a5bbfb5596")

Dekel R

03/17/2022, 3:49 PM
Hey, sorry for “hijacking” this thread - but I have the same problem. I have a flow that is triggering a set of other flows - the last flow is training an ML model for a couple of hours. So if the training is in progress (I think this case is a good example) I want to wait and not invoke the full pipeline until this specific flow (that I know only by name) will change state from running to finished. Any idea of how to do this by name? @Anna Geller tagging you to make sure you see the sub comment, Thanks.