On this page
Sommatic Docs
Open portal

Outlook - Multi-Mailbox Trigger

Triggers when a new email arrives in ANY of multiple Microsoft Outlook mailboxes.

View as Markdown
Open in
Connectors Partial connectors.microsoft.outlook.trigger.multi Version 1.0.0 Execution: async

Starts a workflow with the new messages of several Outlook mailboxes, checked in parallel, keeping a separate last-check time per mailbox. Each run emits one output with every new message in messages and the first one copied to the root.

Enterprise-grade multi-tenant mailbox listener. A single trigger node watches a list of mailboxes in parallel and fires one workflow execution per new email, with the originating mailbox identified in the payload. Ideal for shared inbox architectures (PQRS, support, legal intake, HR) where several functional mailboxes must feed the same triage workflow.

How it works:

  • On each polling cycle, the trigger checks ALL configured mailboxes in parallel (one Graph API call per mailbox).
  • Every new email found is emitted as an independent trigger fire — if 3 mailboxes each receive 1 new email in the same cycle, the workflow executes 3 times.
  • The originating mailbox is exposed as mailbox_email in the output payload so downstream nodes can route or tag accordingly.
  • lastTimeChecked state is tracked per mailbox independently (so a slow-polling mailbox does not block others).
  • If an email has many attachments, the heavy_attachments port is used instead of out for dedicated downstream processing.

When to prefer this over the single-mailbox trigger:

  • You have 2+ shared inboxes that should run the same workflow.
  • You want to avoid maintaining N parallel workflows (one per mailbox) that all do the same thing.
  • You need consistent state tracking across a mailbox cluster.

When NOT to prefer this:

  • You have >10K emails/month and need sub-second latency — use Graph webhooks + a queue (e.g. Service Bus) instead.
  • Each mailbox has materially different downstream logic — use separate workflows.

How it works

  1. What starts it: a manual run of the workflow. The backend scheduler does not start this node in this version (it only schedules cron.trigger and connectors.microsoft.outlook.trigger); the scheduled branch runs only when the input carries $scheduled: true.
  2. Resolves the node config, requires connection_id and at least one address in mailbox_emails (array or comma-separated string), and gets a Graph token.
  3. For each mailbox, queries folder for messages received since its $trigger_state.perMailbox[<mailbox>].lastTimeChecked (or since now when there is none), oldest first, at most max_emails_per_cycle (default 50), and stamps each message with mailbox_email.
  4. Scheduled branch: one pass; a mailbox whose query fails is skipped and keeps its last-check time. Manual run: repeats the pass every polling_interval seconds, refreshing the token, until any mailbox has mail or 30 minutes pass; a failing mailbox fails the run.
  5. Counts the attachments (up to 100) of the messages that have them, copies the first message's fields to the root, and chooses empty (no mail), heavy_attachments (the first message has attachment_threshold attachments or more) or out. Returns meta.trigger_state.perMailbox, which the backend stores after the run.

In a workflow

The node as it appears in a workflow file (draft_nodes[]), and the envelope of a successful run.

{
  "node_id": "node-shared-inboxes",
  "label": "Shared inboxes",
  "operator_slug": "connectors.microsoft.outlook.trigger.multi",
  "operator_version": "1.0.0",
  "config": {
    "connection_id": "pi-credential-xxxx",
    "mailbox_emails": [
      "billing@example.com",
      "support@example.com"
    ],
    "folder": "inbox",
    "polling_interval": 60,
    "attachment_threshold": 5,
    "max_emails_per_cycle": 50
  }
}

Configuration

connection_id string Required

Credential for Microsoft Graph API access. The app registration must have Mail.Read permission (Application) on all monitored mailboxes. Accepts credentials of type `oauth2` (access + refresh token), `service-account` (tenant id + client id + client secret), or `object` (advanced Graph config).

mailbox_emails array<string> Required

List of mailbox email addresses to monitor. Each email address must be accessible by the configured credential.

folder string Optional

The mail folder to watch for new messages (same folder applies to all mailboxes).

Default: inbox

Allowed values: inboxsentitemsdraftsdeleteditemsjunkemailarchive

polling_interval number Optional

How often to check for new emails. Minimum 60 seconds. Each mailbox is checked in parallel per cycle.

Default: 60

attachment_threshold number Optional

Number of attachments at or above which the email routes to the heavy_attachments port instead of out.

Default: 5

max_emails_per_cycle number Optional

Graph API $top value. Cap on how many new emails per mailbox are fetched in a single polling cycle (rest wait for next cycle).

Default: 50

Its configuration shows the shared execution settings, but this node does not apply retries (retryOnFail, maxTries) yet. continueOnFail is not applied by any node.

Behaviour in the code

What the implementation does with these keys beyond what the schema says.

mailbox_emails
Accepts an array or a comma-separated string. Every mailbox must be readable by the credential with application permission Mail.Read.
attachment_threshold
Evaluated on the first message only, even when several arrived.
polling_interval
Wait between passes in a manual run. The 60-second minimum is not enforced, and the backend scheduler does not use it for this node.

Output ports

out default

At least one mailbox had new mail and the first message is below the attachment threshold.

Data
{
  "messages": [
    {
      "id": "AAMkAGI2TG93AAA=",
      "subject": "Invoice request",
      "from": "ana@example.com",
      "to": [
        "billing@example.com"
      ],
      "cc": [],
      "receivedDateTime": "2026-11-26T14:02:51Z",
      "body": "<html><body><p>Please send the invoice.</p></body></html>",
      "bodyContentType": "html",
      "bodyPreview": "Please send the invoice.",
      "isRead": false,
      "hasAttachments": false,
      "importance": "normal",
      "conversationId": "AAQkAGI2TG93CCC=",
      "internetMessageId": "<CAF1x2y3z@mail.example.com>",
      "mailbox_email": "billing@example.com"
    }
  ],
  "count": 1,
  "hasNewEmails": true,
  "lastTimeChecked": "2026-11-26T14:03:00.120Z",
  "id": "AAMkAGI2TG93AAA=",
  "subject": "Invoice request",
  "from": "ana@example.com",
  "to": [
    "billing@example.com"
  ],
  "cc": [],
  "receivedDateTime": "2026-11-26T14:02:51Z",
  "body": "<html><body><p>Please send the invoice.</p></body></html>",
  "bodyContentType": "html",
  "bodyPreview": "Please send the invoice.",
  "isRead": false,
  "hasAttachments": false,
  "importance": "normal",
  "conversationId": "AAQkAGI2TG93CCC=",
  "internetMessageId": "<CAF1x2y3z@mail.example.com>",
  "mailbox_email": "billing@example.com"
}
heavy_attachments

The first message has attachment_threshold attachments or more. Same shape as out, with attachmentCount on the message.

Data
{
  "messages": [
    {
      "id": "AAMkAGI2TG94AAA=",
      "subject": "Scanned documents",
      "from": "ana@example.com",
      "to": [
        "support@example.com"
      ],
      "cc": [],
      "receivedDateTime": "2026-11-26T14:03:40Z",
      "body": "<html><body><p>Attached.</p></body></html>",
      "bodyContentType": "html",
      "bodyPreview": "Attached.",
      "isRead": false,
      "hasAttachments": true,
      "importance": "normal",
      "conversationId": "AAQkAGI2TG94CCC=",
      "internetMessageId": "<CAF4u5v6w@mail.example.com>",
      "mailbox_email": "support@example.com",
      "attachmentCount": 7
    }
  ],
  "count": 1,
  "hasNewEmails": true,
  "lastTimeChecked": "2026-11-26T14:04:00.087Z",
  "id": "AAMkAGI2TG94AAA=",
  "subject": "Scanned documents",
  "from": "ana@example.com",
  "to": [
    "support@example.com"
  ],
  "cc": [],
  "receivedDateTime": "2026-11-26T14:03:40Z",
  "body": "<html><body><p>Attached.</p></body></html>",
  "bodyContentType": "html",
  "bodyPreview": "Attached.",
  "isRead": false,
  "hasAttachments": true,
  "importance": "normal",
  "conversationId": "AAQkAGI2TG94CCC=",
  "internetMessageId": "<CAF4u5v6w@mail.example.com>",
  "mailbox_email": "support@example.com",
  "attachmentCount": 7
}
empty

No mailbox had new mail (scheduled branch), or a manual run waited 30 minutes without mail (then with timedOut: true and polledForMs).

Data
{
  "messages": [],
  "count": 0,
  "hasNewEmails": false,
  "lastTimeChecked": "2026-11-26T14:33:00.502Z",
  "timedOut": true,
  "polledForMs": 1800381
}
error

A validation failed (the output is the envelope { ok, errors, port }) or, in a manual run, a mailbox query failed (the output is { error }).

Data
{
  "ok": false,
  "errors": [
    "At least one mailbox email is required"
  ],
  "port": "error"
}

In expressions

What a later node can read from this node's output with $("Outlook - Multi-Mailbox Trigger").item.json.<path> (write your node's label instead of Outlook - Multi-Mailbox Trigger). Editor marks the paths the workflow editor suggests under Previous Nodes (the output contract); Worker marks the paths the worker really returns through out, from the output shown in Ports.

ExpressionEditorWorker
$("Outlook - Multi-Mailbox Trigger").item.json.idstring= "AAMkAGI2TG93AAA="The Graph message ID. Use this for reply/forward/delete operations.
$("Outlook - Multi-Mailbox Trigger").item.json.mailbox_emailstring= "billing@example.com"The mailbox this email was received in. Use this for per-mailbox routing downstream.
$("Outlook - Multi-Mailbox Trigger").item.json.subjectstring= "Invoice request"
$("Outlook - Multi-Mailbox Trigger").item.json.fromstring= "ana@example.com"Sender email address.
$("Outlook - Multi-Mailbox Trigger").item.json.toarray= […] (1)Recipient email addresses.
$("Outlook - Multi-Mailbox Trigger").item.json.ccarray= […] (0)
$("Outlook - Multi-Mailbox Trigger").item.json.receivedDateTimestring= "2026-11-26T14:02:51Z"
$("Outlook - Multi-Mailbox Trigger").item.json.bodystring= "<html><body><p>Please send the invoice.</p><…"Email body content.
$("Outlook - Multi-Mailbox Trigger").item.json.bodyContentTypestring= "html"
$("Outlook - Multi-Mailbox Trigger").item.json.bodyPreviewstring= "Please send the invoice."
$("Outlook - Multi-Mailbox Trigger").item.json.isReadboolean= false
$("Outlook - Multi-Mailbox Trigger").item.json.hasAttachmentsboolean= false
$("Outlook - Multi-Mailbox Trigger").item.json.attachmentCountnumberThe worker does not return it: reads as undefined —
$("Outlook - Multi-Mailbox Trigger").item.json.importancestring= "normal"
$("Outlook - Multi-Mailbox Trigger").item.json.conversationIdstring= "AAQkAGI2TG93CCC="
$("Outlook - Multi-Mailbox Trigger").item.json.internetMessageIdstring= "<CAF1x2y3z@mail.example.com>"
$("Outlook - Multi-Mailbox Trigger").item.json.messagesarrayNot suggested by the editor= […] (1)—
$("Outlook - Multi-Mailbox Trigger").item.json.countnumberNot suggested by the editor= 1—
$("Outlook - Multi-Mailbox Trigger").item.json.hasNewEmailsbooleanNot suggested by the editor= true—
$("Outlook - Multi-Mailbox Trigger").item.json.lastTimeCheckedstringNot suggested by the editor= "2026-11-26T14:03:00.120Z"—

— Editor: The editor suggests it, but the worker does not return it: it reads as undefined.

— Worker: The worker returns it but the editor does not suggest it: write it by hand. Keys inside objects can depend on your data or configuration (for example one key per label).

Errors

Message Port Cause and fix
Microsoft 365 credential is required error connection_id is empty.
At least one mailbox email is required error mailbox_emails is empty or contains no valid string.
Failed to resolve Microsoft 365 access token error The credential could not be resolved or the token request failed.
Poll failed: <message> error Manual run: the query of one of the mailboxes failed (for example 403 without Mail.Read on that mailbox).

Output contract

id string Optional

The Graph message ID. Use this for reply/forward/delete operations.

mailbox_email string Optional

The mailbox this email was received in. Use this for per-mailbox routing downstream.

subject string Optional
from string Optional

Sender email address.

to array Optional

Recipient email addresses.

cc array Optional
receivedDateTime string Optional
body string Optional

Email body content.

bodyContentType string Optional
bodyPreview string Optional
isRead boolean Optional
hasAttachments boolean Optional
attachmentCount number Optional
importance string Optional
conversationId string Optional
internetMessageId string Optional

Contracts (JSON Schema)

The definition exactly as the orchestrator declares it. All is the whole *.definition.js; compare it with the sections above to spot differences between the documentation and the schema. Use it to validate a node before you publish.

{
  "slug": "connectors.microsoft.outlook.trigger.multi",
  "name": "Outlook - Multi-Mailbox Trigger",
  "category": "integrations",
  "version": "1.0.0",
  "description": "Triggers when a new email arrives in ANY of multiple Microsoft Outlook mailboxes.\n\n  Enterprise-grade multi-tenant mailbox listener. A single trigger node watches a list of mailboxes in parallel and fires **one workflow execution per new email**, with the originating mailbox identified in the payload. Ideal for shared inbox architectures (PQRS, support, legal intake, HR) where several functional mailboxes must feed the same triage workflow.\n\n  **How it works:**\n  - On each polling cycle, the trigger checks ALL configured mailboxes in parallel (one Graph API call per mailbox).\n  - Every new email found is emitted as an independent trigger fire — if 3 mailboxes each receive 1 new email in the same cycle, the workflow executes 3 times.\n  - The originating mailbox is exposed as `mailbox_email` in the output payload so downstream nodes can route or tag accordingly.\n  - `lastTimeChecked` state is tracked **per mailbox** independently (so a slow-polling mailbox does not block others).\n  - If an email has many attachments, the `heavy_attachments` port is used instead of `out` for dedicated downstream processing.\n\n  **When to prefer this over the single-mailbox trigger:**\n  - You have 2+ shared inboxes that should run the same workflow.\n  - You want to avoid maintaining N parallel workflows (one per mailbox) that all do the same thing.\n  - You need consistent state tracking across a mailbox cluster.\n\n  **When NOT to prefer this:**\n  - You have >10K emails/month and need sub-second latency — use Graph webhooks + a queue (e.g. Service Bus) instead.\n  - Each mailbox has materially different downstream logic — use separate workflows.",
  "capabilities": [
    "email",
    "microsoft",
    "outlook",
    "trigger",
    "multi-mailbox",
    "shared-inbox"
  ],
  "group": [
    {
      "key": "microsoft",
      "name": "Microsoft",
      "icon_url": "/icons/integrations/microsoft/microsoft.svg"
    },
    {
      "key": "microsoft365",
      "name": "Microsoft 365",
      "icon_url": "/icons/integrations/microsoft/microsoft365.svg"
    }
  ],
  "icon_url": "/icons/integrations/microsoft/outlook.svg",
  "config_schema": {
    "type": "object",
    "properties": {
      "connection_id": {
        "type": "string",
        "title": "Microsoft 365 Credential",
        "description": "Credential for Microsoft Graph API access. The app registration must have Mail.Read permission (Application) on all monitored mailboxes. Accepts credentials of type `oauth2` (access + refresh token), `service-account` (tenant id + client id + client secret), or `object` (advanced Graph config).",
        "ui_widget": "connection_picker",
        "ui_options": {
          "credential_types": [
            "oauth2",
            "service-account",
            "object"
          ],
          "types": [
            "outlook",
            "microsoft365",
            "oauth2"
          ]
        }
      },
      "mailbox_emails": {
        "type": "array",
        "title": "Mailbox Emails",
        "description": "List of mailbox email addresses to monitor. Each email address must be accessible by the configured credential.",
        "items": {
          "type": "string",
          "format": "expression"
        }
      },
      "folder": {
        "type": "string",
        "title": "Folder",
        "enum": [
          "inbox",
          "sentitems",
          "drafts",
          "deleteditems",
          "junkemail",
          "archive"
        ],
        "default": "inbox",
        "description": "The mail folder to watch for new messages (same folder applies to all mailboxes)."
      },
      "polling_interval": {
        "type": "number",
        "title": "Polling Interval (seconds)",
        "default": 60,
        "description": "How often to check for new emails. Minimum 60 seconds. Each mailbox is checked in parallel per cycle."
      },
      "attachment_threshold": {
        "type": "number",
        "title": "Heavy Attachments Threshold",
        "default": 5,
        "description": "Number of attachments at or above which the email routes to the heavy_attachments port instead of out."
      },
      "max_emails_per_cycle": {
        "type": "number",
        "title": "Max Emails Per Mailbox Per Cycle",
        "default": 50,
        "description": "Graph API $top value. Cap on how many new emails per mailbox are fetched in a single polling cycle (rest wait for next cycle)."
      },
      "execution": {
        "type": "object",
        "title": "Execution Settings",
        "properties": {
          "alwaysOutputData": {
            "type": "boolean",
            "title": "Always Output Data",
            "description": "Always output data, even on error (if configured).",
            "default": false
          },
          "retryOnFail": {
            "type": "boolean",
            "title": "Retry On Fail",
            "description": "Retry the execution if it fails.",
            "default": false
          },
          "maxTries": {
            "type": "integer",
            "title": "Max Retries",
            "description": "Number of retries.",
            "default": 3,
            "displayOptions": {
              "show": {
                "retryOnFail": [
                  true
                ]
              }
            }
          },
          "waitBetweenTries": {
            "type": "integer",
            "title": "Wait Between Retries (ms)",
            "default": 1000,
            "displayOptions": {
              "show": {
                "retryOnFail": [
                  true
                ]
              }
            }
          },
          "continueOnFail": {
            "type": "boolean",
            "title": "Continue On Fail",
            "description": "Do not crash workflow on error.",
            "default": false
          },
          "timeout_ms": {
            "type": "integer",
            "title": "Timeout (ms)",
            "description": "Max execution time for this node before it is killed, in milliseconds. Honored by long-running operators (e.g. OCR/extraction, inline code). Default 300000 (5 min).",
            "default": 300000
          }
        }
      }
    },
    "required": [
      "connection_id",
      "mailbox_emails"
    ]
  },
  "input_contract_schema": null,
  "output_contract_schema": {
    "type": "object",
    "description": "The incoming email data, with the originating mailbox surfaced for routing.",
    "properties": {
      "id": {
        "type": "string",
        "description": "The Graph message ID. Use this for reply/forward/delete operations."
      },
      "mailbox_email": {
        "type": "string",
        "description": "The mailbox this email was received in. Use this for per-mailbox routing downstream."
      },
      "subject": {
        "type": "string"
      },
      "from": {
        "type": "string",
        "description": "Sender email address."
      },
      "to": {
        "type": "array",
        "description": "Recipient email addresses."
      },
      "cc": {
        "type": "array"
      },
      "receivedDateTime": {
        "type": "string",
        "format": "date-time"
      },
      "body": {
        "type": "string",
        "description": "Email body content."
      },
      "bodyContentType": {
        "type": "string"
      },
      "bodyPreview": {
        "type": "string"
      },
      "isRead": {
        "type": "boolean"
      },
      "hasAttachments": {
        "type": "boolean"
      },
      "attachmentCount": {
        "type": "number"
      },
      "importance": {
        "type": "string"
      },
      "conversationId": {
        "type": "string"
      },
      "internetMessageId": {
        "type": "string"
      }
    }
  },
  "ports": [
    {
      "port_id": "out",
      "label": "New Email",
      "is_default": true,
      "description": "A new email was received (below attachment threshold). Fires once per email per mailbox."
    },
    {
      "port_id": "heavy_attachments",
      "label": "Heavy Attachments",
      "description": "Email has attachments at or above the threshold. Route to a dedicated attachment processing node."
    },
    {
      "port_id": "empty",
      "label": "No New Emails",
      "description": "No new emails found in any monitored mailbox in this polling cycle."
    },
    {
      "port_id": "error",
      "label": "Error",
      "description": "Failed to fetch emails or authentication error."
    }
  ],
  "execution_mode": "async",
  "tags": [
    "email",
    "microsoft",
    "outlook",
    "trigger",
    "multi-mailbox",
    "shared-inbox",
    "premium"
  ],
  "is_stateful": true,
  "publisher": {
    "identity": "org_sommatic_ai",
    "profile": {
      "name": "Sommatic AI",
      "verified": true,
      "url": "https://me.veripass.com/sommatic",
      "logo_url": null
    }
  }
}

Execution

Execution
async
Stateful
Yes
Retries (retryOnFail)
No
Credentials
Resolved on the server from connection_id; the secret never reaches the workflow.
Capabilities
emailmicrosoftoutlooktriggermulti-mailboxshared-inbox
Tags
emailmicrosoftoutlooktriggermulti-mailboxshared-inboxpremium

Notes and limits

  • The definition says it fires once per email per mailbox; the code fires once per run. All the messages found are in messages and only the first is copied to the root, and the last-check times advance for all of them, so iterate messages (for example with flow.split) instead of relying on the root fields.
  • Unlike the single-mailbox trigger, a manual run starts from the stored per-mailbox last-check times when they exist, so it also returns mail received since the previous run.
  • With sample data the engine skips this node and passes the sample input on out. A manual run blocks for up to 30 minutes.

Reviewed against the orchestrator code · 31e874b · 2026-11-26

Install agent tools

Give your coding agent the official Sommatic AI docs: skills, the docs MCP server and Markdown pages, so it never has to scrape the site.

Skills only. They do not update by themselves; run it again to refresh.

npx skills add https://docs.sommatic.ai
How agents read these docs