Hi! is there a way to access to the params given t...
# ask-community
f
Hi! is there a way to access to the params given to a task on a run, when the state is pending->running, when the next state is running
i.e
Copy code
def state_handler_test(self, obj, old_state, new_state):
	if new_state.is_running():
            # do something with attr 

class Test(Task):
	def __init__(self):
		self.attr = None
		
	def run(attr):
		self.attr = attr
and the
state_handler_test
is already set
k
Hey @fabian wolfmann, by parameters you don't mean Prefect
Parameters
right? You mean values that went into the Task?
I don't think you would have access to that at the state handler. What is your use case? Do you want the behavior of the state handler to change?
If we're talking about Prefect
Parameters
though, you might be able to get them through the context
f
no we are not using Parameters, i will give it a try