Just to add to what has been said (and I'm sure the wiki has such details, possibly some I don't know or misunderstand), the smelter/kiln/glassworks workshops all have their magma-bit in the top-central tile of the 3x3 grid. The magma forge has one on each side of the central horizontal.
I'm sure it used to be that it didn't need magma
at that spot, just on any of the eight non-central tiles covered by the forge, but that it was useful to build the spot over the hole you're using as a barrier against magma creatures that tried to climb out. Not sure if that was true, or indeed true any more, but I've always tended to cut'n'cover according to this plan anyway. You don't need to expose both magma-forge hot-spots to magma, if indeed you have to directly expose either.
Because of pressure issues (i.e. there are none, or at least fewer than with water), the way I deal with this is carve out appropriate workplaces on the Z I want a particular lot of workshops (can be as high as the Z immediately above the top 7/7ths of magma, but I usually go one or two down from there). Bear in mind that you'll be digging a magma-duct on the Z-1, so don't mine out this area for storage/minerals, at least if you do so bear in mind that you're going to have to put walls back up again (of anything, even ice!). But I tend not to mine it at all.
Knowing where, which and how many magma workshops you're wanting, designate a channel in the given spot you're wanting in each of the future-workshops' footprints. These days, this gives you a ramp (in the old days, you'd need to engineer your own access method, possibly with doors to be closed or places to be walled up again later), down which the diggers can be sent to extend these holes into the full magmaduct. I make it into a single-width tunnel, with as few kinks as possible, to reach all the down-holes (dug-as-ramps or yet to be dug into, in which case further ramps won't appear if channelling into existing magmaduct), but don't breach the magmapipe. Keep one tile away, and I tend to engineer it so that one of the tiles (usually up to three, adjacent to the end) is either at a diagonal to the magmaduct, or has itself diagonal access to the pipe.
If you want any raw jewels or ores embedded in the walls of the magmaduct, quickly dig them out and replace this lost wall with constructed wall. I smooth the entire tunnel wall and floor, but that wastes time. You
do, under my plan, want to smooth that chosen "last tile" separating the duct from the pipe. I also remove all ramps but the one that (assuming I don't have another exit, ready to seal up) I intend my break-through dwarf to escape from. Before I'm anywhere near the magma being sent through, I can build over every channel (ramped or not)
except the one that I want to escape from.
If you've dug more channels for forges that you now realise you haven't got enough anvils to build for, putting a bridge over the gap might well prevent anything nasty (any fire creature except for fire-vermin, which are unstoppable but generally little more than a nuisance) that gets into the duct from getting out at that point, but I've never seen that happen under my scheme so that may be somewhat more of a precaution than a necessity.
Anyway, with one enterable/exitable ramp into the magmaduct (or another entrance, if you're walling somewhere else up, sufficiently far from the intended break-in point), send down an engraver to carve Fortifications in that specially pre-smoothed separating tile. The magma will slop in, but (at least how I do it) slowly. The engraver, and anyone else (especially pets) that wandered down there should now get out of their own accord, but its always possible that someone goes to sleep or finds themselves in the segment beyond your ramp-escape. Planning for this, or aborting the engraver's Fortification action if it looks like this might be imminent, is really the only solution. Assigning elsewhere-burrows to everyone except the engraver might be one way of ensuring safety during this segment of the operation, but keep an eye on things anyway. Once the breach has occurred and the engraver looks to be out of the way (and not in danger of stopping for a snooze, and you
did remember to no longer restrict them to the magma-pipe burrow that you'd forced them into, didn't you?
), you can build the final workshop.
Wait. The magma will slowly advance. Perhaps because of my cautious plan,
very slowly. But it should eventually reach 1/7th at the other end of your duct (hopefully without having trapped anybody or their pets) so that the 'ripples' just bounce back and forth, instead of extending the /7th flooded area, and after it reaches 2/7ths everywhere, you're no longer subject to any evaporation, so it should fill up quicker. By now, the workshops near the pipe end of the duct should already be 'powered'.
A powered workshop has (I think, though it differs slightly between forges and the other magma-workshops) a red glow to the 'magma-tapping point' that is brighter (or redder) than an unpowered one (I think it needs to be 4/7ths or more, for this, but check the wiki). While the magma is still flowing, a forge/whatever could be momentarily powered, but the vaguaries of the rippling and moving magma-flow below might make it inactive a moment later. When a magma workshop is powered, you can start to give it orders, but if the flow dissipates it will auto-cancel these. If you have Job Manager jobs you might get spammed as auto-added jobs get auto-cancelled and re-auto-added multiple times in succession, but that'll also depend on config settings. Magma kilns and glassworks can't even hold collect clay/sand jobs when unpowered, I'm pretty sure, and can't be given them until they are.
An unpowered magma forge may mean that a moody metalcrafter (or other smith) might sit around doing nothing even if you've built a non-magma version, from what I've heard and experienced. As soon as your magma-forge is powered, he'll stop moping around his room (if he has one) and take it over. The sloshing of magma-levels might or might not make him pause or reverse in his trek there, but if you've done it right he'll eventually be moaning about no metal bars/etc, or getting on with the business of moodcrafting if you have all the wished-for items.
I've not known of any magma creatures to get through the fortifications (although as far as I can tell, none have ever wandered up to them, and certainly with a pressurised liquid flow through fortifications large creatures can be forced through regardless... not sure if this would happen in this case) and if you've capped each channelling spot with either workshop or bridge you should be additionally safe (although I hear that building destroyers now have the ability to target such 'covering' structures of such upward ramps or stairways). Would be wise to keep an eye on, regardless, I suppose.
Anyway, now you have a working set of magma workshops. Use them as you will, and can.