Hiya! Quick question on best practices in Prefect ...
# prefect-community
b
Hiya! Quick question on best practices in Prefect 1. With a flow-of-flows, is there an ideal way to pass values down to child flows? In particular, secrets? Parameters seem fine for everything else.
k
Hi @Blake, wouldn’t the subflow be able to pull it as well?
b
Yeah, we could have secret references in the subflows as well - but was wondering if there's a way to pass "secure" parameters from parent to child.
The concern is that it could get messy with cases where there are multiple secrets, and we were hoping to make the subflows more generic and control them from the parent flow.
k
you could store it in Cloud and pass the Secret name as a Parameter to pull. Maybe like:
Copy code
with Flow()
    secret_name = Parameter("secret_name")
    PrefectSecret()(secret_name)
Just note to pass it to the run method
b
Interesting! I guess that would work w/ Server too, as long as it was a secret type supported by the runtime environment. Thanks!
k
Yes it should. If you pass the secret_name to the init like
Copy code
PrefectSecret(secret_name)
I don’t think that will work. it really needs to be run time because the init will be evaluated during registration time
👀 1