The 2FA via email case is great. I recently had to build a browser automation workflow that required 2FA. I ended up using Zapier to monitor email inbox and then extract the code and send back to our API. It was a bit slow.
Yup plus webhooks are overkill for this. Need to set up a public HTTP server and pass messages to your agents. With websockets you can open connection right from your agent and close it in seconds once the 2FA code is delivered.
... you had to use Zapier to extract an email from an inbox?
Why didn't you just use something like Mailinator? They specialize in this exact thing. Gives you an API to grab links and everything. That's what I use.