I found dozens of these in my flowering plants. What should I do?
It's most likely a tobacco budworm, not a caterpillar. The easiest thing to do is just manually pick them off and kill them. Do not use a systemic insecticide or you will kill the pollinators that are drawn to the petunia flowers. The site I linked to has information on biological and chemical controls if you'd rather go either of those routes. My guess is that the budworm eggs were on the plants when you purchased them.