If a malicious or improper flow is preventing you from accessing your device, so you can’t manually stop it. Then the only way to recover, is to reboot your device into “safe mode”, disable Automate as an device administrator and uninstall the app. Note that all flows will be lost by uninstalling the app, it may suffice to only uninstall the permission add-ons to stop the problem flow.
This may only be needed if you’ve enabled Run on system startup option in Automate settings, otherwise a reboot will suffice to regain device access.
Long-press the power button until the power options menu appears, then long-press the power off option. You should be asked if you want to reboot your phone into safe mode.
If you can’t access the power menu, or the safe mode question won’t appear, restart your device, or remove the battery. Then hold down both the volume up and volume down buttons while the device is starting up.
When the device has started, the words “safe mode” should appear on the bottom of your screen. Disable Automate as an Device administrator then go into the device Apps settings and uninstall the app or permission add-ons. Restart your device again to return to regular, non-safe mode.