Gmail Get Inbox
Controlled node
Overview
Fetches email messages from a Gmail inbox using a configured Google connection. This node retrieves messages with support for pagination via limit and offset parameters, allowing you to fetch specific ranges of emails from the inbox. The node enforces a maximum fetch limit of 500 messages per execution.
This node requires a valid Gmail connection to be configured in the project settings. Use the Connections property panel to select an existing Google connection.
Inputs
| Input | Type | Description | Default |
|---|---|---|---|
| Run | Event | Triggers the node to fetch inbox messages. | - |
| Limit | Number | The maximum number of messages to return (max 500). | 100 |
| Offset | Number | The number of messages to skip before starting to return results. | 0 |
Outputs
| Output | Type | Description |
|---|---|---|
| Messages | Data | An array of email message objects containing inbox data. Returns an empty array if no messages are found or if an error occurs. |
| Done | Event | Fires when the node has finished fetching messages. |
Properties
| Property | Type | Description | Default |
|---|---|---|---|
| Connections | Connection | The Google/Gmail connection to use for fetching emails. Must be configured in project settings. | - |
Runtime Behavior and Defaults
- Maximum Limit: The node enforces a hard limit of 500 messages per fetch operation. If
limit + offsetexceeds 500, the node will return an error. - Pagination: Use
offsetto paginate through large inboxes. For example, to get messages 101-200, setoffsetto 100 andlimitto 100. - Connection Validation: If no connection is selected, the node outputs the string
"Select a connection first"in the messages output. - Error Handling: If the project ID cannot be determined or the fetch fails, the node returns an empty array or null.
Example Usage
Basic Inbox Fetch
Connect a Start node to the Run input of Gmail Get Inbox to fetch the latest 100 messages when the workflow starts.
Paginated Inbox Processing
To process emails in batches:
- Set Limit to
100and Offset to0for the first batch - Process those messages
- Increment Offset by
100and trigger Run again for the next batch - Continue until fewer than 100 messages are returned
Filtering Results
Connect the Messages output to a Filter List node to search for specific emails by subject, sender, or content after fetching the inbox.
// Example output structure for messages:
[
{
id: "12345abc",
threadId: "thread123",
subject: "Meeting Tomorrow",
from: "sender@example.com",
date: "2024-01-15T10:30:00Z",
snippet: "Hi, just confirming our meeting..."
}
]