John Kang

08/01/2022, 7:14 PM
One note for those running remote deployments on Windows machines. It seems like whenever a flow is triggered on an agent the entire contents of the remote deployment is downloaded to the machine in userid/AppData/Local/Temp/somegibberishfoldernameprefect. FYI, because if you have large flows this could become large and you may want to trigger some sort of operation to clear out older prefect flow directories. Anyone have some best practices regarding triggering some sort of scheduled cleanup of folder directories on machines running Prefect flows?

Rob Freedy

08/02/2022, 1:13 AM
Hey John!! This is a great question and I will get with our team to see if there are any other best practices. Any python code can be executed within a flow, including any cleanup of local resources. Here is a discourse post that has a 2.0 example that could be useful for your problem:

John Kang

08/02/2022, 1:24 PM
@Rob Freedy Thanks for sharing! Not sure how to facilitate cleanup of local file resources while the flow is running (as that would clean out the flow that is executing). I might need to setup a separate job to do this.