Workflow state change script [Urgent]

Hey,

I want to execute a custom script on workflow state change. Like if admin approves I want to add data in another doctype. What is the solution for this?

Thanks.