Well lets think as roll20 DND 5E.

Besides combat of course, combat still should award XP. DMs since old circa D&D are incentivized to reward roleplay in the Dungeon Master Manual, exploration and intelligent solutions during sessions, now the constraint we have is due to this being a video game, so you have a set of limited options thought by the designer. One way to break the mold for example is allowing to have multiple "right choices" as if it fits the character roleplay. So I can parlay my way, bribe, intimidate, attack the person and receive the XP for that encounter, you will give all matters of gameplay satisfaction.

But giving multiple solutions have a caveat so for the sake of discussion I will present the weakness of giving xp to multiple solutions, but as a opportunity to show what I at least believe is a solution, of course a experienced game designer can have 10000x better ideas on how to solve this and still keeping up with the Project Manager schedule due to their experience.

What happens when dialogue gives XP right away because we are still talking about a game, people will definitely want to improve this xp for maximum power gains. So they will do the dialogue and grab their knives and stab whoever they just decided to solve with peace talks for extra XP and items. This might limit Good Aligned locked classes, but there is still a wide array of exploitation to be dealt with. The famous True Neutral (but not so neutral, Im just a villain in disguise because my DM didnt allow me to roll that blackguard) and the Evil aligned players, so to avoid having this incentive to be a murder hobo, you reward XP by encounter and maybe even like people mentioned by the end of the quest the game can have a hidden XP calculator by the player deeds during this mission and reward accordingly so you remove the MMO mindset of I need to grind those mofos for xp!
The player could still think that is optimal to murder everyone since I will get the XP+Item rewards, so you usually balance in session by giving an exclusive reward pool and extra XP by solving this quest in X way that fits the description of intelligent solution or fitting the roleplay of your character. But an important observation not every quest needs to be a well thought solution sometimes the tragedy of conflict is bound to happen even if the player wants to avoid it at all cost.