This is another place where the writers just sorta screwed up, imo. Bran says earlier he can't be lord of anything, yet when asked if he will be king, he made it clear that he knew that was going to happen and that that was why he was here.
Those words certainly imply that he knew what was going to happen. In addition, there's no explanation as to how or why the northern army (which I didn't think there really was much of one at this point since they largely joined forces with Dany, but then again, we keep getting all those extra Dothraki and Unsullied, so I guess the North has to keep up
) showed up at the gates of Kings Landing. Who is left in King's Landing to call all of the lords together, let alone tell Sansa that the whole army is required to stalemate the re-spawning forces from across the sea? Dany's army holds what's left of King's Landing, and despite being on a rape and murder spree they quietly lock up the confessed killer of their messiah/queen. So Jon didn't do it. Tyrion is also locked up, so he didn't do it. Varys is dead, so I guess Davos must have taken it upon himself to write a letter to Sansa and tell her to bring the forces of the north to bear on King's Landing so Jon doesn't go down for regicide?
Add these things together, and it sure points to Bran knowing exactly what was going to go down, just like he knew exactly where to sit so Arya could reach him in order to kill the Night King (he was never needed as 'bait' since it was already stated that the NK knew where he was). The more I thought about it, the more Bran comes across like a manipulative evil little bastard who let all this stuff happen just so he could get the throne.
Now, it could be that he also knows that, in doing so, peace will be brought about by his 1000 year reign, but in the meantime, there's a lot of murdered people and one queen who didn't have to go insane if only he had reminded her to look for Euron's fleet, or warned her that Missandei could be plucked out of the sea in the midst of a pitched battle and held for ransom. Basically, there were a lot of ways he could have easily stopped Dany from travelling down the mad queen path, but chose not to so that things would be set up for him to take the throne.