Hi guys. Any information on suspending flows? I’...
# ask-community
j
Hi guys. Any information on suspending flows? I’ve got a paused flow working and the documentation references suspend flows but no examples. I’ve tried importing the suspend flow and calling it as per the documentation but it errors
c
Could you share the traceback of the error you're seeing?
j
Cannot import name ‘suspend_flow_run’ from prefect
Then if I import paused_flow_run from prefect it says it can’t find suspend_flow_run. So where does suspend flow run come from?
c
try
from prefect.engine import suspend_flow_run
instead
j
Where is this in the documentation?
Sadly it’s the same error though
c
Can you confirm that you are using an up to date version of Prefect
j
2.11.5
c
suspend_flow_run
was not added until 2.14.10 so you'll need to upgrade to access that utility
j
I assume that’s the agent version? 2.11.5
c
if you're importing the utility within your flow, then your flow's runtime environment needs 2.14.10 installed
j
It’s a shame this isn’t documented
c
what do you mean? We version our docs so that you can see what information is relevant for the version you have installed.
suspend_flow_run
is not mentioned in the 2.11.5 docs
j
Is there any more details on the usage of the suspend flow?
j
Ahhh! We’re using the documentation that’s linked to prefect.io. I don’t see a place in the documentation that allows me to change the version.
c
there's a toggle on the upper left nav:
j
Oh man! I didn’t see that!!! Any chance of having the documentation updating to include an example of the suspended state usage?
c
it's possible - are you not sure what kwargs to pass or something? what is currently missing that's tripping you up?
j
The import process and passing in and persisting state. The suspension talks about rerunning the flow from the start, but we need to skip the start and resume where it suspended
c
The docs outline all of this -
from prefect import suspend_flow_run
, and flow functions are always executed top to bottom when rerun. Any tasks that were already completed will not be rerun.
j
Ah… I’m going to reread those documents again.
👍 1
Sorry about this
👍 1