so far i have only tried an automated water delivery rail, but it should be applicable to magma (should probably use metal carts thou)
the tricky bit is the loading station,
you dig a chanel 6squares long (i use 10, but i think 6 or 7 is the minimum) on (z0)
remove all but the first and last square of the chanel (z-1)
carve (or construct) tracks on z-1 and make a circular track to where you want the water/magma to be dumped
build a roller in the chanel [extend it over the ramps) (i use minimum power cos water doesnt fill if the cart passes too quickly)
provide power to the roller (everything should probably be magma safe)
you have allready chosen the direction of the track when placing the roller, so now you must construct a wall on the entry side of the chanel over the second square, so when a cart aproaches its pushed down on the ramp (else it will skip on the surface (z0)
edit: flood the filling chamber (z-1) with the liquid of your choice (i use a pressurized system with a diagonal tunnel to the filling chanel)
if your track goes up z levels you should probably provide rollers for it, my advice is to put control doors on levers on the track so you can stop a runaway cart rebouncing from a wall to a roller and back..
the unloading station is a single stop element build on the track beside the water/magma cistern
it should be set to lowest friction and the dump direction should be set
STARTING AN AUTOMATED TRACK
place a single track NEXT TO a sharp turn so a dwarf could push an empty cart on the not conected circular track
make a new route, set the only stop on this one piece of track, set stop options to push the cart when its empty always and assign a cart to make it run
dwarves should bring the cart and push it in the chosen direction, the cart skips on to the circular track and from here on must rely on rollers to get it all the way around.
As of 34.09 dwarves will not chase moving minecarts
other tricks:
it is possible to turn arround a moving cart by making a track that ends with 1 sharp turn and 3 counter turns, making the cart drive in a small circle, skiping back on its original track, still retaining some speed, just dont forget to put a stop max friction element on your loading station, and set route to one stop only, on the loading station/stop element, set to dwarves push cart when its full of desired stuff
it is also posible to make a bidirectional single lane automated set, using rollers on both ends of the track and a starter element just beyond one of the rollers, dwarves pushing a cart from the route stop square directly on to the roller
(can be used for water/magma or gauntlets/defences/FUN)
dwarves ignore roller efect when guiding a cart, so if rollers are a problem, you can set up a slower carting system using the dwarves guide carts setting