Outlook Mail:Search Emails
Controlled node
Overview
Find Outlook Mail messages with a search query.
Search messages in the connected Outlook Mail account. Search the mailbox, or enable sentFolder to search only sent messages. The default search is not limited to the inbox.
Inputs
| Input | Type | Description |
|---|---|---|
| run | Event | Triggers this operation. |
| query | Text | Search text, such as invoice. Leave unset to fetch without a search filter. |
| limit | Number | Maximum messages to return. Use a positive integer up to 500. Defaults to 100. |
| offset | Number | Number of matching messages to skip. Use a non-negative integer. Defaults to 0. |
Properties
| Setting | Type | Description |
|---|---|---|
| connections | Connection | Select an authenticated Outlook Mail connection from this project in the properties panel. |
| sentFolder | Boolean | Enable to search only Sent Items. Defaults to false (whole mailbox). |
Outputs
| Output | Type | Description |
|---|---|---|
| messages | Data | Array of message objects. Failures can return error text instead of an array. |
| done | Event | Fires when the node returns, including when it returns an error result. Check the data output before continuing. |
Message data
Each message contains id, threadId, subject, sentBy, sentTime, to, cc, bcc, snippet, status, isRead, plain and html. Recipient fields are arrays of email addresses. Use id when replying, marking a message as read or fetching attachments; it is not the thread ID. Outlook’s plain value may be a preview when the message contains an HTML body; use html when you need the full HTML content.
Pagination and errors
Both limit and limit + offset must be at most 500. This means offset pagination cannot take this node beyond the first 500 matching messages. Mailboxes can change between runs, so keep message IDs if you need to avoid processing a message twice.
Check that messages is an array before iterating. An empty array means there are no messages in that returned slice.
Example
Select the connection, set limit to 50 and offset to 0, and enter a query. Connect Start to run. After checking the result, pass messages to For Each → object and trigger its run from done. Use Get Value on each element to read fields such as id or subject.
To request the next slice, use offset: 50 with the same limit, keeping limit + offset within 500.