Is there a way to globally configure result persis...
# prefect-aws
m
Is there a way to globally configure result persistence to S3 for all flows & tasks in a workspace? I know how to persist results to S3 on an individual flow, but I was hoping to find a way to avoid duplicating this configuration across our deployed flows.
1
r
You could decorate the flow decorator and persist in a common fashion across all your flows - we do this for logging/dataadog and a few other things
🙌 1
m
Ooo I like that idea
Thank you!
👍 1
n
just another idea: I made a small util for something like this that could be customized, here i just mapped: workspace -> result storage block name
r
@Nate how does that work?
n
you could say
result_storage=result_storage_from_env()
in your flow decorator (like this) and it would select a result storage based on which workspace the client finds itself in
r
ah neat, and it auto syncs it
not seen that pattern before, it works as you inherit from block
c# dev here
n
yeah i just made it bc I was testing a deployment in one workspace and eventually wanted to deploy in another and yeah, a neat little tidbit about blocks is that you can load a block instance of any Block subclass via
Block.load("block-type-name/block-document-name")
r
was never certain decorating the flow decorator was a good idea, ramifications futher down the line