Rules order doesn't seems to be working

I am migrating my users from one tenant to another on Login. There are two rules used in the process to add users to group and role(Authorization extension) and to update app_metadata with group and role. But it doesn’t run in order.
I have placed few console.logs to check the order. First logs in both the rules comes first. It seems both runs asynchronously.
And there is this third rule which adds groups and roles to id_token and access_token. Because these doesn’t run in order so I don’t get groups and source in id_token, which fails my application.
What can be the possible problem. I am not sure what’s causing the issue?

Hey there!

Sorry for such delay in response! We’re doing our best in providing the best developer support experience out there, but sometimes the number of incoming questions is just too big for our bandwidth. Sorry for such inconvenience!

Do you still require further assistance from us?

Hi Konrad,

I got it resolved long back. Thanks for the followup anyway.

Glad to hear that and once more sorry for such delay! We’re getting more people in the team and working on that!