If you do nothing and do not guide or prune your dragonfruit on the dragon fruit trellis it can rapidly become a huge tangled mass from which it will be very hard to harvest fruit and which can become so dense that it induces rot and disease. The ideal solution is to 'train' your dragonfruit cactus to grow on a trellis to keep it growing in a healthy and orderly state.
To grow your dragonfruit on a trellis and make fruit most accessible for picking, you want to keep your dragonfruit cactus to look like a short tree more than its natural form. Keep the dragonfruit cactus pruned to give it a single long stem or trunk, then when the stem or trunk reaches the height of the trellis allow it to branch and prune it to encourage branching. This will allow plenty of air circulation around the base of the dragonfruit cactus plant (helping to reduce rot and fungus and bacterial diseases), give you room to work when fertilizing the dragonfruit cactus, and make picking the dragonfruit fruits easy. The goal is to make your (or your workers) life easier and more productive during harvest of the dragon fruits, and to keep the dragon fruit plants free of disease both.
To induce branching to occur if it does not naturally occur when the dragonfruit trunk is near the height of the trellis, cut the tip to induce branching.
Note: The dragonfruit cactus is a relatively heavy plant (not like a kiwi plant, for example) so make sure your trellis is sufficiently strong to hold the mature dragonfruit cactus and dragonfruit fruits (also heavy).