Bringing the gods onstage seems to have two major pitfalls. One is that they can swamp the main characters. The other is that they don't come across as convincingly godlike.
Making the main characters divine, or semi-divine, is one way to get around the first problem, but it brings in the second one in spades. Gods that act like spoiled three-year-olds are not convincingly divine. It's not much of a defense to say that the original myths show them this way. For one thing, modern fantasy writers tend to go far beyond the myths in the stupidity of the gods. For another, the gods are the Powers That Be of your universe. The stupider they look, the stupider the world looks. Not to mention that generally, the characters -- and the writer! -- do not come across as that much better than the gods. (Set the bar a little higher than "better than a spoiled three-year-old" please.)
Some writers manage to pull it off. John C. Wright's Chronicles of Chaos. Rick Riordian's Percy Jackson and the Olympians is a little more mixed. Sometimes they are fully divine, sometimes they are convincingly toned-down either for rest or for dealings with mortals (even when they are being arbitrary, nasty, and capricious), but sometimes they are just too thin.
But if the main characters are merely mortal humans, even though the gods have to be offstage much of the time to avoid the first problem, they still have to be divine when they appear. Convincingly awe-inspiring.
One trick to avoid is to have them avoid lecturing the characters on moral principles. Trust me on this one: no writer has come up with the plain and obvious solution to any moral conundrum that people have broken their heads and hearts over for millennia. And even when the writer is not trying to be novel, most of the time, what they reveal is their total unfamiliarity with what has been said and thought over the millennia -- and the depths of their shallowness. Marcus Aurelius is a minor philosopher, lent undue prominence by his position, but most such lectures could be improved the writer's having bought Meditations and ripped it off shamelessly.
Also, it seldom advances the plot. Which can't, to be sure, be said for the far more common technique of having them appear to push the characters around. Leaving aside that the technique frequently does not make them convincingly divine -- a plot device is not divine -- it also railroads the characters. Bringing us to the other problem, of swamping the characters. Not that it is not a common problem when the hero is the Chosen One, or Destiny Says that something must happen. Obscure and oblique statements from the gods, though, may merely raise the question why they weren't clearer, or didn't provide more help or what have you.
Gene Wolfe's Soldier In the Mists and Soldier of Arete seem to me to handle this, but by a technique that has limited applicability: the gods, in spite of having cursed Latro to lose his memory every night, don't care much about him. He sees them, he talks to them, and they aren't trying to shoehorn him into something. And gloriously numinous gods, at that.
Humm. Come to think of it, the most convincingly numinous gods are also those whose mysterious messages are the most satisfying. They actually convey that the god is aware of more than the character and has considerations that the character can not fathom.
Or, the god can actually only leave signs. This can be tricky. But even when another character can plausibly argue that something was chance, a character can take something as a sign. Which also be helpful in lending depth to the world-building