Turn Instant Pot to saute. Add oil. Once hot, add onion. Cook for 2 minutes, stirring occasionally.
Add garlic and stir. Cook for another minute. Add artichoke hearts and cook an additional minute.
Add uncooked pasta and 4 cups (one box) of broth. Mix well and make sure that most of the pasta is covered with liquid.
Close Instant Pot with pressure valve closed to sealed. Cook on pressure cook for 4 minutes and then quick release.
Once the pressure has released, open the Instant Pot and stir the pasta. Water may need to be added if there isn't any liquid remaining.
Gently fold the spinach into the pasta. It's easier to do this handfuls at a time while the spinach wilts.
Add cream cheese, mozzarella, and Parmesan. Add red pepper flakes and stir until the cheeses are melted and mixed evenly.