Skip to main content

Outlook Search Emails

Controlled node

Overview

Searches Outlook messages using the Microsoft Graph API with a text-based search query. This node allows you to retrieve emails from either the inbox or sent folder, with support for pagination and result limiting.

The node requires an active Outlook connection configured in your project. Results are returned as an array of message objects containing standard email fields such as subject, sender, recipients, body preview, and received date.

Result Limit

There is a hard limit of 500 messages that can be fetched per execution. If you need to retrieve more emails, use the offset input to paginate through results in multiple workflow runs.

Inputs

InputTypeDescriptionDefault
RunEventTriggers the search operation.-
QueryTextSearch query text to filter emails (e.g., "from:john@example.com subject:report").-
LimitNumberMaximum number of messages to return (max 500).100
OffsetNumberNumber of messages to skip for pagination.0
ConnectionsConnectionOutlook connection reference for authentication.-
Sent FolderBooleanIf true, searches the Sent Items folder instead of the Inbox.false

Outputs

OutputTypeDescription
DoneEventFires when the search operation completes successfully or fails.
MessagesDataArray of email message objects. Each object contains properties like subject, sender, toRecipients, bodyPreview, receivedDateTime, and id. Returns an empty array if no messages are found.

Runtime Behavior and Defaults

  • Controlled Execution: This node only executes when triggered by the Run event input.
  • Default Search Scope: By default, the node searches the Inbox folder. Enable the Sent Folder property to search Sent Items instead.
  • Pagination: Use the offset input to skip previously retrieved messages. For example, to get messages 101-200, set limit to 100 and offset to 100.
  • Error Handling: If the search fails (e.g., invalid connection or API error), the messages output will contain an error string instead of an array.
  • Query Syntax: Supports standard Microsoft Graph search syntax including from:, subject:, and keyword searches.

Example Usage

Basic Inbox Search Connect a Start node or button event to the Run input, provide a search query like "quarterly report", and set the limit to 50. The node will return the 50 most recent emails matching that query from the inbox.

Sent Folder Search To find emails you sent to a specific recipient, check the Sent Folder property in the panel UI and use a query like "to:client@company.com".

Pagination To retrieve all emails in batches of 100:

  1. First run: limit=100, offset=0 (gets messages 1-100)
  2. Second run: limit=100, offset=100 (gets messages 101-200)
  3. Continue until the returned array is empty or smaller than the limit.