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
Kevin Kho
04/17/2022, 1:19 AM
Hi @Blake, wouldn’t the subflow be able to pull it as well?
b
Blake
04/17/2022, 1:21 AM
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.
Blake
04/17/2022, 1:22 AM
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
Kevin Kho
04/17/2022, 1:23 AM
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
Blake
04/17/2022, 1:26 AM
Interesting! I guess that would work w/ Server too, as long as it was a secret type supported by the runtime environment. Thanks!
k
Kevin Kho
04/17/2022, 1:27 AM
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
Bring your towel and join one of the fastest growing data communities. Welcome to our second-generation open source orchestration platform, a completely rethought approach to dataflow automation.