A sustainable synthetic procedure to convert furfural hydrazones into functionalised phthalimides in ionic liquids was developed.