They were probably yellow jackets, which are wasps.
They are nasty. I had a hive of them in an open area of an addition onto the house. Sprayed the heck out of them. Killed a ton that way, but there were more left. When the colder weather arrived, I plugged the area with that foam spray. Problem solved.