Knowing what plant it was eating is often the key to ID'ing a caterpillar. Different caterpillars eat different plants, some turn into desirable butterflies, so I always like to know the ID before deciding on a course of action that includes something besides just leaving it alone.
If you know what it was eating, search "____ (name of plant) host plant" Like: "Passiflora host plant." If you know what plant it was, but not sure of the plants' name, showing a pic of the plant on Plant ID forum would help fill in this missing link in your investigation.
When I find a butterfly caterpillar, I definitely leave it alone since I'm gardening for butterflies and hummingbirds, purposely adding plants that attract these visitors. Caterpillars eating some plants at some times is part of butterfly gardening, since adults will lay eggs while visiting plants for nectar (if you have plants that can serve as host for their caterpillars.) The plants are rarely permanently damaged unless the number of caterpillars is just overwhelming. That's why certain plants exist.
Yours looks like it could be black swallowtail, silvery checkerspot, white peacock, tiger eye moth - or it could be some nondescript moth that you or I wouldn't welcome to munch on a plant.
If you determine it's unwelcome, you may want to pick them off plants and throw them in the grass for birds to eat. Some caterpillars can sting, so be careful handling unknown ones.
This search may help you investigate further, though knowing what it was eating usually solves the mystery within a couple minutes, by comparing to butterfly caterpillars known to eat that plant. If it's not one of those, which are very well documented, you can be confident it's not one of the critters you've attempted to attract to the garden:
https://www.google.com/search?...