You can now create Random A/B and Random Number attributes directly in the Userflow UI. Once set up in your account, Userflow will automatically assign either A or B (or a random number) to each user.
Simply add your random attribute under Settings → Attributes:
Then use it in your flows like any other attribute:
No coding necessary!