Check workflow validation

How can I call specific function before workflow start working?

Custom scripting only…check below…

http://frappe.github.io/erpnext/user/manual/en/customize-erpnext/custom-scripts/custom-script-examples/