Hey all, I am trying to get the parameter values o...
# ask-community
s
Hey all, I am trying to get the parameter values of a flow run inside my state handler, is there a way to fetch the parameter values ?
k
Hi @Saksham Dixit! Can you show me what you’re trying to do?
s
I am trying to send a message with parameter values of the flow run
Copy code
def send_file_handler(flow, old_state, new_state):
    if new_state.is_failed():
        print(flow.name)
        print(new_state.message)
        print(new_state.result)
        print(flow.parameters())
k
I understand. Let me take a look at some stuff.
s
if I do :
Copy code
print(prefect.context.get('parameters'))
I get parameters
k
Oh ok. Thanks for mentioning that! My best suggestion was just to log them in the task instead but you have a better solution of just adding that to your state handler.
s
Thanks Kevin !