I prefer gladitorial combat for condemned goblins (fully armed, freedom with victory - my dwarves are an honorable sort). The easiest way is probably letting the militia chop them up one by one, but captured greenskins can be used for many purposes:
- Population control. It can be pretty funny to trap someone in their room with six goblins.
- FB/Megabeast baiting. Be sure to injure the prisoner beyond a means of escape, with a fall or a trap or something.
- Caravan raiding. Put a dozen goblins by the Depot, seal it off, and let them loose when the caravan gets there. It won't be your fault.
- Feeding pet dragons/spiders and such: Just disarm and drop.
- Goblin prison communities. You can dig out a great oubliette for the enemy hordes and leave them in there forever.*
- Bone source. Drop the goblins from a staggering height so they explode into pieces, and dwarves will use them in the craft.
- Controlled traumatization. Have your soldiers slaughter the prisoners en masse so as to desensitize them to horror.
- Biological danger rooms. Drop a well-fitted dwarf into a 1x1 cell filled with unarmed goblins and they will emerge a hero.
There are many more uses you might consider before executing your enemies. A life is a precious thing and shouldn't be wasted.
* This doubles as a safe and entertaining way to generate ghosts from unwanted civilians.