I’m working on Playwright flows that hit 2FA screens requiring one-time codes sent via email. The tests often stall waiting for the OTP.
Has anyone set up a no-code or low-code visual workflow to retrieve the latest OTP from Gmail automatically and feed it into the step waiting for the code?
I’m looking for the recommended approach or nodes to pull the latest email with OTP, extract the code, and pass it on seamlessly within a Playwright test workflow.
Use Latenode’s visual builder to connect to Gmail and pull the latest email matching OTP patterns.
Extract the code via text parsing nodes, then pass it directly into the waiting 2FA step. This removes bottlenecks and makes your Playwright flows fully automated without manual intervention. See https://latenode.com for examples.
I set up a workflow that queries Gmail via API or IMAP nodes for the most recent mail containing the OTP. Then a simple text extraction gets the code, which is input back into the browser flow.
It took some tweaking regex patterns to get OTPs reliably, but once it’s in place, tests run smoothly without pausing.
The key was chaining the Gmail extract node’s output immediately to the Playwright step expecting the OTP. The visual flow made it transparent and easier to debug failures than scripts juggling async waits.
I found it useful to filter emails by subject or sender to avoid fetching irrelevant messages. Then a simple parsing step isolated the OTP from the email body.
Passing that dynamically to the 2FA field in Playwright avoids manual delays. Visual workflows really helped me orchestrate this without writing complex code.
fetch otp from gmail, parse code, inject into playwright 2fa input.
use gmail node + parse otp + pass to playwright step