Hi asked similar question on another channel, but ...
# ask-community
r
Hi asked similar question on another channel, but thought this channel might be better. I am playing around with Prefect 2 and I ran into 3 questions about running deployments: 1. is it possible to retrieve a flows result when ran with prefect.deployments.run_deployment? 2. when you persist data from a flow/task, is there a way to get the file name? or set up the location to be determined by a function so the file can otherwise be found? 3. Is it possible to manually read the data from a PersistedResult file? questions 2 and 3 are admittedly related to each-other. Any help that can be provided on the above will be appreciated
a
1. I think this is possible by awaiting
(FlowRun.state.result()).get()
I saw this same type of thing in this recipe
The results of the worker flows are persisted and gathered within the orchestrator flow by awaiting
(FlowRun.state.result()).get()
.
https://github.com/PrefectHQ/prefect-recipes/tree/main/flows-advanced/parent-orchestrator
r
Thank you Aaron, for question 1 that was exactly what I needed! worked like a charm. Now all I need to do is work on questions 2&3 haha
a
I think 2 has a default location
r
so I am able to set up a directory for the results to be stored (currently using LocalFileSystem) however the results are named using a random hash and it does not appear to easily be read manually
good news, managed to answer question 3 myself. If you are using LocalFileSystem the data can be read by using some navigation. if you open the file, load the json, and convert the data to utf-8 bytes then the serialize objects ".loads()" method can be used to deserialize the data. now I just need to figure out if you can name/organise the presisted data files in any way