Hey I am having a problem, when I pass a parameter...
# ask-community
n
Hey I am having a problem, when I pass a parameter to a flow that does not fit the pydantic model, the on_failure function does not trigger. Anyone faced such thing?
n
hi @Nir Kopp - if your flow never starts, it makes sense to me that your
on_failure
hook would not trigger. we validate parameters before we create the flow run in the API, so orchestration logic like state hooks never runs
n
There is any way to run a callback to a validation error like that?
n
depending on what you need a callback for, you may want to put a
field_validator
/
model_validator
on your model
n
Thanks!