<!-- BusyBot node reference — https://busybot.net/tools/microsoft-outlook-trigger/ -->

> Node: Microsoft Outlook Trigger (`microsoft_outlook_trigger`) · Polling trigger · v1
> Category: Communication · Credentials: Microsoft Outlook OAuth2 (`microsoftOAuth2`)
> Updated: 2026-08-16

# Microsoft Outlook Trigger

> Trigger workflows on new Microsoft Outlook emails

## Overview

The Microsoft Outlook Trigger node polls the Microsoft Graph API at a configurable interval to detect new incoming emails. On each poll it queries the messages endpoint with a filter on receivedDateTime, fetching only messages received since the last poll. The first poll establishes a baseline timestamp and returns no items to prevent flooding with historical data. Supports filtering by read status, sender, folder inclusion/exclusion, attachment presence, and custom OData filter queries. Output can be simplified (key fields only), raw (all fields), or a user-selected subset of fields. Supports shared mailbox access via User Principal Name configuration in credentials.

**Category:** Communication  
**Tool Name:** `microsoft_outlook_trigger`  
**Version:** 1

**Appearance:** Icon: `lucide-Mail` | Color: `#0078d4`

## Node Type

**Trigger** — polling (checks for new data on a schedule)

## Input / Output

| Direction | Port(s) |
|-----------|--------|
| Input | None (trigger node) |
| Output | `Output` |

## Credentials

This tool requires **Microsoft Outlook OAuth2** credentials.
See the [Credentials Guide](https://busybot.net/credentials/microsoft-oauth2/) for setup instructions.

### Parameters

| Parameter | Type | Required | Default | Description |
|-----------|------|----------|---------|-------------|
| Microsoft Account | `credential` | No | — | Connect your Microsoft account via OAuth2. |
| Trigger On | `options` | No | `messageReceived` | Which event to trigger on. |
| | | | | Options: `messageReceived` |
| Output | `options` | No | `simple` | How much data to include in the output for each email message. |
| | | | | Options: `simple` (Simplified), `raw` (every field Microsoft Graph returns), `fields` (Select Included Fields) |
| Fields | `multiOptions` | No | `[]` | The fields to include in the output when using "Select Included Fields" mode. _(shown when Output is `fields`)_ |
| | | | | Options: `bccRecipients`, `body`, `bodyPreview`, `categories`, `ccRecipients`, `changeKey`, `conversationId`, `createdDateTime`, `flag`, `from`, `hasAttachments`, `importance`, `inferenceClassification`, `internetMessageId`, `isDeliveryReceiptRequested`, `isDraft`, `isRead`, `isReadReceiptRequested`, `lastModifiedDateTime`, `parentFolderId`, `receivedDateTime`, `replyTo`, `sender`, `sentDateTime`, `subject`, `toRecipients`, `webLink` |
| Filters | `collection` | No | `{}` | Which messages should start the workflow. Every filter you set must match. |
| — Filter Query | `string` | No | — | Custom OData filter query to apply (e.g. "isRead eq false"). See Microsoft Graph filter documentation. |
| — Has Attachments | `boolean` | No | `false` | Whether to only return messages that have attachments. |
| — Folders to Exclude | `string` | No | — | Comma-separated list of folder IDs to exclude from results. |
| — Folders to Include | `string` | No | — | Comma-separated list of folder IDs to include. Only messages in these folders will be returned. |
| — Read Status | `options` | No | `unread` | Filter messages by whether they have been read or not. |
| | | | | Options: `both` (Unread and Read Messages), `unread` (Unread Messages Only), `read` (Read Messages Only) |
| — Sender | `string` | No | — | Sender name or email address to filter by. |
| Options | `collection` | No | `{}` | Additional processing applied to each message. |
| — Attachments Prefix | `string` | No | `attachment_` | Prefix for the output fields containing binary attachment data. An index starting from 0 will be added (e.g. "attachment_0", "attachment_1"). |
| — Download Attachments | `boolean` | No | `false` | Whether to download message attachments and include them in the output. |
| Poll Interval | `number` | No | `1` | How often to check for new emails. |
| Poll Interval Unit | `options` | No | `minutes` | Unit for the poll interval. |
| | | | | Options: `seconds`, `minutes`, `hours` |

## Output Data

Each new message becomes one output item. Every item carries `_trigger` (always `microsoft_outlook_polling`) and `_timestamp` (when the poll ran). The rest of the shape depends on **Output**.

`simple` — the fields most workflows need, with addresses flattened to plain strings:

```json
{
  "id": "AAMkAGI2TG93AAA=",
  "conversationId": "AAQkAGI2TG93AAA=",
  "subject": "Invoice 4192",
  "bodyPreview": "Your invoice for August is attached",
  "from": "billing@example.com",
  "to": ["accounts@mycompany.com"],
  "categories": [],
  "hasAttachments": true,
  "_trigger": "microsoft_outlook_polling",
  "_timestamp": "2026-08-15T09:00:00.000Z"
}
```

`raw` — the complete Microsoft Graph message resource, with `from`, `toRecipients` and friends in their nested Graph form.

`fields` — only the properties selected in **Fields**, in their Graph form.

When **Download Attachments** is on, each item additionally carries:

- `_attachments` — one entry per attachment with `fieldName` (the binary property it was stored under), `name`, `contentType`, `size` and `isInline`.
- One binary property per attachment, named with the configured prefix plus a zero-based index (`attachment_0`, `attachment_1`, …), so downstream nodes can read the file.

Reference message data downstream by expression, e.g. `{{ $json.subject }}`.

## Usage Examples

- Start a workflow when a new email arrives in Outlook
- Monitor an Outlook inbox for unread messages from a specific sender
- Trigger automation when emails with attachments are received
- Watch a specific mail folder for new messages

## Example Configuration

Watch the mailbox for new unread mail:

```json
{
  "type": "microsoft_outlook_trigger",
  "parameters": {
    "event": "messageReceived",
    "output": "simple",
    "pollInterval": 5,
    "pollIntervalUnit": "minutes"
  }
}
```

Watch one sender's messages with attachments and download the files:

```json
{
  "type": "microsoft_outlook_trigger",
  "parameters": {
    "event": "messageReceived",
    "output": "raw",
    "pollInterval": 2,
    "pollIntervalUnit": "minutes",
    "filters": {
      "sender": "notifications@company.com",
      "hasAttachments": true,
      "readStatus": "unread"
    },
    "options": {
      "downloadAttachments": true,
      "attachmentsPrefix": "doc_"
    }
  }
}
```

Return only the properties you need, filtered by an OData query:

```json
{
  "type": "microsoft_outlook_trigger",
  "parameters": {
    "event": "messageReceived",
    "output": "fields",
    "fields": [
      "subject",
      "from",
      "body",
      "receivedDateTime",
      "hasAttachments",
      "importance"
    ],
    "pollInterval": 1,
    "pollIntervalUnit": "hours",
    "filters": {
      "readStatus": "both",
      "custom": "importance eq 'high' or importance eq 'normal'"
    }
  }
}
```

Watch specific folders only:

```json
{
  "type": "microsoft_outlook_trigger",
  "parameters": {
    "event": "messageReceived",
    "output": "simple",
    "pollInterval": 5,
    "pollIntervalUnit": "minutes",
    "filters": {
      "foldersToInclude": "AAMkAGI2THk0ZGItMWUzYS00YjkwLWE0YjktMGVjZGQ1YzRkYWRm",
      "readStatus": "both"
    }
  }
}
```

### Trigger Behavior

- **Activation:** Polling starts when the workflow is activated. There is no poll at the moment of activation — the first check runs one full interval later.
- **Schedule:** The trigger polls for new data based on the configured polling interval.
- **State:** Maintains internal state (the timestamp of the last check) so each poll returns only messages received since then.
- **First Run:** The first poll records the current time and returns no items, so activating the workflow never replays your mailbox.
- **Testing:** Running the node from the editor emits a single sample message so you can build the rest of the workflow; real mail arrives only while the workflow is activated.

## Tips

Configure your Microsoft OAuth2 credentials (access token, refresh token, client ID, client secret). Select output mode and optional filters like sender, read status, or specific folders. The trigger will poll for new emails at the configured interval and return only messages received since the last check.

### Parameter Relationships

- **`fields`**: only available when `output` is set to `"fields"`. This allows fine-grained control over which email properties are included in the output.
- **`options.downloadAttachments`**: when set to `true`, attachments are downloaded and attached to the item using the prefix specified in `options.attachmentsPrefix`.
- **`filters.foldersToInclude` vs `filters.foldersToExclude`**: these are mutually exclusive filtering approaches. Use `foldersToInclude` to only monitor specific folders, or `foldersToExclude` to monitor all folders except the ones specified.

### Notes

- All filters are combined with the time window using AND, so a message must satisfy every filter you set.
- If the credential's sign-in has permanently expired, the trigger returns no items until the account is reconnected.