Is it possible to know at runtime whether a Parame...
# ask-community
m
Is it possible to know at runtime whether a Parameter has taken its default value or been overridden?
g
You can get this from context at runtime. https://docs.prefect.io/api/latest/utilities/context.html
m
Thanks for the response Greg! I’m not sure I follow though; I can’t see a context variable that would do this?
g
Ah yeah I guess using context only solves half the problem (this gives you the parameter values for the current run, but not the default parameter values for the flow). I think you would be able to get the flow's default values with a GraphQL query to Server/Cloud. Alternatively you could restructure your flow a bit so that the default parameter values are stored in a variable which is then passed to the relevant task
k
Hey @Michael, I don’t think this can be done, unless you explicitly query the GraphQL API like Greg mentioned, and then compare it with the value during runtime.
m
Thanks both! I think this would have been hacky anyway, so probably a good thing I was forced to reshuffle some things