When you create a new RPA unattended or attended bot you want to test it directly from the Studio. To do that, you can use the common action 'ImpersonateAsRobot'. So if you want to test your Robot out of your Studio it will impersonate the robot, but if you start the Robot from ServiceNow, we don't need the impersonate anymore. So we will check with the action 'isRunningFromStudio' from where the bot has started.
After that you can have a decision with 'isTrue' where you set the true path to the impersonate and the false path to the next action. Following screenshot shows the hole sequence: