Were the Federalist Papers written before the Constitutional Convention happened?

No, the Federalist Papers were written in 1787-1788, after the Framers signed the Constitution, but before enough states had ratified the Constitution so it could replace the Articles of Confederation.