Skip to main content

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.

Connection Required

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

InputTypeDescriptionDefault
RunEventTriggers the node to fetch inbox messages.-
LimitNumberThe maximum number of messages to return (max 500).100
OffsetNumberThe number of messages to skip before starting to return results.0

Outputs

OutputTypeDescription
MessagesDataAn array of email message objects containing inbox data. Returns an empty array if no messages are found or if an error occurs.
DoneEventFires when the node has finished fetching messages.

Properties

PropertyTypeDescriptionDefault
ConnectionsConnectionThe 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 + offset exceeds 500, the node will return an error.
  • Pagination: Use offset to paginate through large inboxes. For example, to get messages 101-200, set offset to 100 and limit to 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:

  1. Set Limit to 100 and Offset to 0 for the first batch
  2. Process those messages
  3. Increment Offset by 100 and trigger Run again for the next batch
  4. 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..."
}
]