Question: has worked or had worked?
Answer: The 'before' clause in your sentence is such a past time, so it can't be used with the perfect. Simple past 'worked' is the natural choice, though you can also say 'had worked'.