QANode Logo

Email Inbox Node

The Email Inbox node connects to a mailbox via IMAP and waits for or searches for messages matching defined criteria. Ideal for validating email delivery, extracting OTPs, and capturing confirmation links in test flows.


Overview

PropertyValue
Typeemail-inbox
CategoryUtilities
Inputin
Outputout

Prerequisite: Email Credential

Before using this node, create an Email Credential in the Credentials section. It stores the IMAP connection and authentication securely.


Configuration Fields

General

FieldTypeDefaultDescription
CredentialselectEmail credential to use
OperationselectExtract EmailWhat to do when an email is found
FoldertextINBOXIMAP folder to monitor
Only UnreadbooleantrueSearch only unread messages
Mark As ReadbooleanfalseMark found messages as read

Available Operations

ValueDescription
Extract EmailWait for and return the full email
Extract OTPExtract a numeric code from the email body
Extract LinkExtract a URL from the email body

Search Filters

All filters are optional. When filled, the value must be contained in the email for it to match.

FieldDescriptionExample
From ContainsFilter by sendernoreply@gmail.com
To ContainsFilter by recipientmyemail@
Subject ContainsFilter by subjectVerification code
Body ContainsFilter by body textyour code is

Date Filter

FieldOptionsDescription
Received After ModeStep Start / Absolute Date/Time / No Date FilterDate filter mode
Received AfterISO 8601Used only when mode = Absolute Date/Time

Step Start (recommended): the node uses the UID of the next email at the moment execution begins, reliably ignoring previous messages regardless of timezone.

Polling and Limits

FieldTypeDefaultDescription
Timeout (ms)number120000Maximum wait time (0 = no wait, checks once)
Poll Interval (ms)number3000Interval between checks
Max Scannumber30Maximum emails to scan per cycle
Max Matchesnumber1Maximum emails to return

OTP Extraction (when operation = Extract OTP)

FieldTypeDefaultDescription
OTP Regex (optional)regexautomaticCustom expression to capture the code
OTP Min Lengthnumber6Minimum code length
OTP Max Lengthnumber6Maximum code length

When no regex is provided, the node automatically searches for numeric sequences of the configured length.

Link Extraction (when operation = Extract Link)

FieldTypeDescription
Link Domain ContainstextFilter links by domain (e.g. accounts.google.com)
Link Regex (optional)regexCustom expression to capture the URL

Outputs

OutputTypeDescription
foundbooleanWhether any email was found
matchCountnumberNumber of emails that matched
attemptsnumberNumber of checks performed
emailobjectFirst email found (full object)
emailsarrayAll emails found (up to maxMatches)
linksarrayURLs found in the first email
otpstringExtracted code (only in extractOtp)
linkstringExtracted URL (only in extractLink)

email Object Structure

{
  "uid": 12345,
  "messageId": "<abc@gmail.com>",
  "subject": "Your verification code",
  "from": "Company <noreply@company.com>",
  "to": "user@gmail.com",
  "date": "2026-03-08T12:00:00.000Z",
  "text": "Your code is 482910. Valid for 10 minutes.",
  "html": "<p>Your code is <strong>482910</strong>...</p>",
  "links": ["https://company.com/confirm?token=xyz"]
}

Practical Examples

Wait for sign-up confirmation email

[Click "Create account" in the browser]
    │
    ▼
[Email Inbox]
  Operation: Extract Email
  Subject Contains: "Confirm your email"
  From Contains: noreply@service.com
  Timeout: 60000ms
    │
    ▼
[HTTP Request: GET {{ steps.emailInbox.outputs.links[0] }}]

Extract 6-digit OTP

[Click "Send code" in the app]
    │
    ▼
[Email Inbox]
  Operation: Extract OTP
  Subject Contains: "verification code"
  OTP Min Length: 6
  OTP Max Length: 6
  Timeout: 30000ms
    │
    ▼
[Type in OTP field: {{ steps.emailInbox.outputs.otp }}]

Extract password reset link

[Click "Forgot password"]
    │
    ▼
[Email Inbox]
  Operation: Extract Link
  Subject Contains: "reset password"
  Link Domain Contains: accounts.company.com
  Timeout: 30000ms
    │
    ▼
[Navigate: {{ steps.emailInbox.outputs.link }}]

Provider Configuration

Gmail

ModeRequired Setup
Password / App PasswordEnable "Less secure app access" or generate an App Password
OAuth2Create an app in the Google Cloud Console with the credential's callback URI

For Gmail with OAuth2, click Connect OAuth (Browser) in the credential screen. Google requires that the callback URI registered in the Console exactly matches the OAuth Callback URI field shown in the credential form.

Outlook / Microsoft 365

ModeRequired Setup
Password / App PasswordWorks for accounts without MFA, or with app passwords
OAuth2Register the app in Azure Active Directory with IMAP.AccessAsUser.All permission

Custom IMAP

Manually configure host, port, and security mode (SSL/TLS).


Tips

  • Always use Received After Mode = Step Start — avoids capturing emails that arrived before the test
  • Combine filters — the more specific (from + subject), the more reliable the detection
  • Mark as read — useful to avoid the same email being captured in consecutive runs
  • Timeout 0 — runs a single check without waiting; useful for assertions on already-received emails
  • Custom OTP Regex — use when the code has a non-numeric format or appears in ambiguous context (e.g. code: ([A-Z0-9]{8}))