Spray foam is applied after the windows, doors and roof, after the framing, plumbing, and electrical inspections are complete, and after any other systems located behind drywall is installed. Foam is the last installation to take place before drywall.