Calling native javascript from flows is coming soon
https://community.wappler.io/t/call-external-javascript-in-flow/18775/5
In your case:
<script is="dmx-flow" id="flow1" type="text/dmx-flow">
{
runJS: { function: "navigate", args: "{{ [form1.data.userdetails[0].role == 'admin' ? 'admin.html' : 'user.html'] }}" }
}
</script>
<script>
function navigate(path) {
app.router.navigate(path);
}
</script>