Melt the butter, then sauté the onion over medium heat for about 5 minutes until it softens and appears translucent.
Add the garlic and sauté the mixture for another minute.
Mix the onion and garlic with the chicken, chiles, corn, salsa, cream cheese, shredded cheese, green chiles, chili powder, and cayenne, and cook for another 2 minutes.
Place a wire rack over a baking sheet lined with aluminum foil and brush it with the canola oil.
Spread 2 tablespoons of the chicken mixture in the middle of each tortilla.
Roll each tortilla tightly and place it seam-side down on the wire rack.
Bake the flautas for 20 minutes until they are browned.
Serve the flautas with toppings such as guacamole or pico de Gallo.