Gmail
Search Email
Search for emails in Gmail using various criteria.
Search Email
This node allows you to search for emails in Gmail. You can filter by sender, recipient, subject, content, and date. It supports fetching full thread details and marking messages as read upon retrieval.
Inputs
| Variable | Type | Required | Description |
|---|---|---|---|
credentialId | Credential | Yes | The Gmail credential to use for the search. |
from | string | No | Filter by the sender's email address. |
to | string | No | Filter by the recipient's email address. |
subject | string | No | Filter by email subject. |
contentQuery | string | No | Search for text within the email content. |
dateRange | string | No | Filter emails by date range. Options: "all" (any time), "1d" (past 24 hours), "7d" (past week), "1m" (past month), "1y" (past year), or "custom" (specify custom date range). |
customDateFrom | string | No | Start date for custom date range (YYYY-MM-DD format). Only used when dateRange is "custom". |
customDateTo | string | No | End date for custom date range (YYYY-MM-DD format). Only used when dateRange is "custom". |
maxResults | number | No | The maximum number of results to return. Default: 10. |
includeRead | boolean | No | Whether to include messages that have already been read. |
markAsRead | boolean | No | Automatically mark found messages as read. |
getFullThread | boolean | No | Fetch the full conversation thread for each message. |
Date Range Examples
Preset Ranges
Use preset date ranges for common time periods:
- Past 24 hours: Set
dateRangeto"1d" - Past week: Set
dateRangeto"7d" - Past month: Set
dateRangeto"1m" - Past year: Set
dateRangeto"1y" - Any time: Set
dateRangeto"all"or leave it unset
Custom Date Ranges
For more precise date filtering, use custom date ranges:
-
Specific date range (e.g., January 1-15, 2024):
- Set
dateRangeto"custom" - Set
customDateFromto"2024-01-01" - Set
customDateToto"2024-01-15"
- Set
-
All emails after a specific date (e.g., after March 1, 2024):
- Set
dateRangeto"custom" - Set
customDateFromto"2024-03-01" - Leave
customDateToempty
- Set
-
All emails before a specific date (e.g., before December 31, 2023):
- Set
dateRangeto"custom" - Set
customDateToto"2023-12-31" - Leave
customDateFromempty
- Set