On this page
Sommatic Docs
Open portal

Outlook - Mail

Send, read, and manage emails through Microsoft Outlook via the Microsoft Graph API.

View as Markdown
Open in
Connectors Available connectors.microsoft.outlook.mail Version 1.0.0 Execution: async

Sends, replies to, forwards, reads, lists or deletes Outlook messages, or reads a message's attachments, through Microsoft Graph. The result of the chosen operation is returned under result.

Connect your Microsoft 365 account and automate email operations — send notifications, process incoming mail, manage drafts, and more.

Operations:

  • Send: Compose and send a new email with recipients, subject, body, and optional attachments.
  • Reply: Reply to an existing email by message ID.
  • Get: Retrieve a specific email by message ID.
  • List: List emails from a folder with optional filtering.
  • Delete: Delete an email by message ID.
  • Forward: Forward an email to new recipients.

How it works

  1. Resolves the node config and requires connection_id. Gets a Graph token: with client_id, client_secret and tenant_id in the credential secret it requests an app-only token; otherwise it uses the secret's token or access_token as is.
  2. Targets /users/<mailbox_email> when mailbox_mode is other, otherwise /me, and dispatches on operation (default send).
  3. send requires to and subject, splits to, cc and bcc on commas and posts sendMail with an HTML or text body (content_type).
  4. reply uses custom_message_id when reply_target is custom, else the incoming item's id, else message_id. Without overrides it posts /reply with body as the comment. With to, cc, bcc or include_quoted_original: false it creates a reply draft, sets recipients and body (your body, then <hr/>, then the quoted original, unless the quote is disabled) and sends it.
  5. forward requires message_id and to. Without overrides it posts /forward. With forward_subject, forward_importance, timezone, language, cc or bcc it creates a forward draft (sending Prefer: outlook.timezone and Accept-Language for the quoted header), patches it, sends it and returns its conversation_id and internet_message_id (from the draft, or from up to 5 Sent Items lookups 1.5 s apart).
  6. get returns the Graph message for message_id; list returns up to limit messages of folder, newest first, optionally filtered by the OData filter; delete deletes message_id; get_attachments returns the attachments of the incoming item's id (or message_id).

In a workflow

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

{
  "node_id": "node-confirm-order",
  "label": "Send confirmation",
  "operator_slug": "connectors.microsoft.outlook.mail",
  "operator_version": "1.0.0",
  "config": {
    "connection_id": "pi-credential-xxxx",
    "mailbox_mode": "other",
    "mailbox_email": "orders@example.com",
    "operation": "send",
    "to": "{{ $json.customer_email }}",
    "subject": "Order {{ $json.order_id }} received",
    "body": "<p>Thanks, we received your order.</p>",
    "content_type": "html"
  }
}

Configuration

connection_id string Required

Credential for Microsoft Graph API access. Accepts credentials of type `oauth2` (access + refresh token), `service-account` (tenant id + client id + client secret), or `object` (advanced Graph config).

mailbox_mode string Optional

Token owner: uses the mailbox of the account that generated the credential. Other mailbox: specify an email address (requires Application permissions in Azure AD).

Default: token_owner

Allowed values: token_ownerother

mailbox_email string Optional Accepts expressions

Email address of the mailbox to operate on (e.g., support@organization.com).

Shown when: mailbox_mode = other

operation string Required

The email operation to perform.

Default: send

Allowed values: sendreplygetlistdeleteforwardget_attachments

to string Optional Accepts expressions

Comma-separated emails to override the default reply recipient (which Graph sets to the original sender). Use to route the reply to e.g. the court mailbox instead of the natural-person who forwarded the case. Triggers enriched 4-call flow.

Shown when: operation = reply

cc string Optional Accepts expressions

Comma-separated emails to receive a visible copy of the reply.

Shown when: operation = reply

bcc string Optional Accepts expressions

Comma-separated emails to receive a blind copy of the reply. Triggers enriched 4-call flow (createReply → PATCH → send) and preserves the original message quote.

Shown when: operation = reply

subject string Optional Accepts expressions

Email subject line.

Shown when: operation = send

body string Optional Accepts expressions

Email body content. Supports HTML.

Shown when: operation = send | reply

content_type string Optional

Whether the body is plain text or HTML.

Default: html

Allowed values: texthtml

Shown when: operation = send | reply

reply_target string Optional

Incoming message: automatically replies to the email received from the previous node. Custom: specify a message ID manually.

Default: incoming

Allowed values: incomingcustom

Shown when: operation = reply

custom_message_id string Optional Accepts expressions

The ID of the email to reply to.

Shown when: operation = reply · reply_target = custom

message_id string Optional Accepts expressions

The ID of the email message.

Shown when: operation = get | delete | forward

forward_subject string Optional Accepts expressions

Custom subject for the forwarded message. If empty, Outlook prefixes "FW: " to the original subject (default Graph behavior).

Shown when: operation = forward

forward_importance string Optional

Importance flag for the forwarded message. Set to "high" to mark as urgent. Empty = default (normal).

Allowed values: lownormalhigh

Shown when: operation = forward

timezone string Optional

Optional Windows time zone name used for the time shown in the quoted header of the forwarded message (e.g. "SA Pacific Standard Time" for Colombia). Empty = UTC (default Graph behavior).

Shown when: operation = forward

language string Optional

Optional language tag for the labels of the quoted header of the forwarded message (e.g. "es-CO" shows De / Enviado / Para / Asunto). Empty = English (default Graph behavior). Day and month names stay in English.

Shown when: operation = forward

folder string Optional

The mail folder to list messages from.

Default: inbox

Allowed values: inboxsentitemsdraftsdeleteditemsjunkemailarchive

Shown when: operation = list

limit number Optional

Maximum number of messages to return.

Default: 10

Shown when: operation = list

filter string Optional Accepts expressions

OData filter expression (e.g., "isRead eq false").

Shown when: operation = list

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.

to
to, cc and bcc are declared twice in the definition, and the second declaration (reply overrides) wins, so the form only shows them for reply. The worker still reads to, cc and bcc for send and forward too.
include_quoted_original Read by the code, not declared
Undeclared. Default true. false makes reply send only body as HTML, without Graph's quoted original.
content_type
Only used by send. Replies and forwards keep the content type of Graph's draft.
attachment_filter Read by the code, not declared
Undeclared (alias filter_content_type). For get_attachments, keeps attachments whose content type starts with this value, case-insensitive.
timezone
Forward only: a Windows time zone name for the time in the quoted header. language (a language tag such as es-ES) sets its labels. Either one forces the draft-based forward.

Output ports

out default

The operation succeeded. The output is { result, operation }, except get_attachments, which returns { attachments, count } plus attachment when there is exactly one.

Data
{
  "result": {
    "sent": true,
    "status": 202
  },
  "operation": "send"
}
error

A validation failed (the output is the envelope { ok, errors, port }) or a Graph call failed (the output is { error, response } with Graph's error body).

Data
{
  "ok": false,
  "errors": [
    "Recipient (to) is required for send operation"
  ],
  "port": "error"
}

In expressions

What a later node can read from this node's output with $("Outlook - Mail").item.json.<path> (write your node's label instead of Outlook - Mail). 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 - Mail").item.json.resultobject= {…}Operation result from Microsoft Graph API.
$("Outlook - Mail").item.json.operationstring= "send"The operation that was performed.
$("Outlook - Mail").item.json.result.sentbooleanNot suggested by the editor= true—
$("Outlook - Mail").item.json.result.statusnumberNot suggested by the editor= 202—

— 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.
Failed to resolve Microsoft 365 access token error The credential could not be resolved, the token request failed, or the secret has neither client credentials nor a token.
Unknown operation: <operation> error operation is not send, reply, get, list, delete, forward or get_attachments.
Recipient (to) is required for <send|forward> operation error to is empty. Subject is required for send operation is the equivalent check for subject.
Message ID is required for <get|delete|forward> operation error message_id is empty. Reply and get_attachments return a longer variant that mentions the previous node.
createReply did not return a draft message id error Graph did not create the reply draft. createForward did not return a draft message id is the forward equivalent.
Request failed with status code <status> error Graph rejected the call (unknown message, invalid OData filter, missing Mail.Send / Mail.ReadWrite permission, expired token). See response for Graph's error.

Input contract

connection_id string Required
operation string Required
to string Optional
subject string Optional
body string Optional
message_id string Optional

Output contract

result object Optional

Operation result from Microsoft Graph API.

operation string Optional

The operation that was performed.

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.mail",
  "name": "Outlook - Mail",
  "category": "integrations",
  "version": "1.0.0",
  "description": "Send, read, and manage emails through Microsoft Outlook via the Microsoft Graph API.\n\n  Connect your Microsoft 365 account and automate email operations — send notifications, process incoming mail, manage drafts, and more.\n\n  **Operations:**\n  - **Send:** Compose and send a new email with recipients, subject, body, and optional attachments.\n  - **Reply:** Reply to an existing email by message ID.\n  - **Get:** Retrieve a specific email by message ID.\n  - **List:** List emails from a folder with optional filtering.\n  - **Delete:** Delete an email by message ID.\n  - **Forward:** Forward an email to new recipients.",
  "capabilities": [
    "email",
    "microsoft",
    "outlook",
    "office365",
    "graph-api"
  ],
  "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. 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_mode": {
        "type": "string",
        "title": "Mailbox",
        "enum": [
          "token_owner",
          "other"
        ],
        "default": "token_owner",
        "description": "Token owner: uses the mailbox of the account that generated the credential. Other mailbox: specify an email address (requires Application permissions in Azure AD)."
      },
      "mailbox_email": {
        "type": "string",
        "title": "Mailbox Email",
        "description": "Email address of the mailbox to operate on (e.g., support@organization.com).",
        "format": "expression",
        "displayOptions": {
          "show": {
            "mailbox_mode": [
              "other"
            ]
          }
        }
      },
      "operation": {
        "type": "string",
        "title": "Operation",
        "enum": [
          "send",
          "reply",
          "get",
          "list",
          "delete",
          "forward",
          "get_attachments"
        ],
        "default": "send",
        "description": "The email operation to perform."
      },
      "to": {
        "type": "string",
        "title": "To (Reply override)",
        "description": "Comma-separated emails to override the default reply recipient (which Graph sets to the original sender). Use to route the reply to e.g. the court mailbox instead of the natural-person who forwarded the case. Triggers enriched 4-call flow.",
        "format": "expression",
        "displayOptions": {
          "show": {
            "operation": [
              "reply"
            ]
          }
        }
      },
      "cc": {
        "type": "string",
        "title": "CC (Reply)",
        "description": "Comma-separated emails to receive a visible copy of the reply.",
        "format": "expression",
        "displayOptions": {
          "show": {
            "operation": [
              "reply"
            ]
          }
        }
      },
      "bcc": {
        "type": "string",
        "title": "BCC (Reply)",
        "description": "Comma-separated emails to receive a blind copy of the reply. Triggers enriched 4-call flow (createReply → PATCH → send) and preserves the original message quote.",
        "format": "expression",
        "displayOptions": {
          "show": {
            "operation": [
              "reply"
            ]
          }
        }
      },
      "subject": {
        "type": "string",
        "title": "Subject",
        "description": "Email subject line.",
        "format": "expression",
        "displayOptions": {
          "show": {
            "operation": [
              "send"
            ]
          }
        }
      },
      "body": {
        "type": "string",
        "title": "Body",
        "description": "Email body content. Supports HTML.",
        "format": "expression",
        "displayOptions": {
          "show": {
            "operation": [
              "send",
              "reply"
            ]
          }
        }
      },
      "content_type": {
        "type": "string",
        "title": "Content Type",
        "enum": [
          "text",
          "html"
        ],
        "default": "html",
        "description": "Whether the body is plain text or HTML.",
        "displayOptions": {
          "show": {
            "operation": [
              "send",
              "reply"
            ]
          }
        }
      },
      "reply_target": {
        "type": "string",
        "title": "Reply To",
        "enum": [
          "incoming",
          "custom"
        ],
        "default": "incoming",
        "description": "Incoming message: automatically replies to the email received from the previous node. Custom: specify a message ID manually.",
        "displayOptions": {
          "show": {
            "operation": [
              "reply"
            ]
          }
        }
      },
      "custom_message_id": {
        "type": "string",
        "title": "Message ID",
        "description": "The ID of the email to reply to.",
        "format": "expression",
        "displayOptions": {
          "show": {
            "operation": [
              "reply"
            ],
            "reply_target": [
              "custom"
            ]
          }
        }
      },
      "message_id": {
        "type": "string",
        "title": "Message ID",
        "description": "The ID of the email message.",
        "format": "expression",
        "displayOptions": {
          "show": {
            "operation": [
              "get",
              "delete",
              "forward"
            ]
          }
        }
      },
      "forward_subject": {
        "type": "string",
        "title": "Forward Subject (override)",
        "description": "Custom subject for the forwarded message. If empty, Outlook prefixes \"FW: \" to the original subject (default Graph behavior).",
        "format": "expression",
        "displayOptions": {
          "show": {
            "operation": [
              "forward"
            ]
          }
        }
      },
      "forward_importance": {
        "type": "string",
        "title": "Forward Importance",
        "enum": [
          "",
          "low",
          "normal",
          "high"
        ],
        "default": "",
        "description": "Importance flag for the forwarded message. Set to \"high\" to mark as urgent. Empty = default (normal).",
        "displayOptions": {
          "show": {
            "operation": [
              "forward"
            ]
          }
        }
      },
      "timezone": {
        "type": "string",
        "title": "Forward Time Zone",
        "description": "Optional Windows time zone name used for the time shown in the quoted header of the forwarded message (e.g. \"SA Pacific Standard Time\" for Colombia). Empty = UTC (default Graph behavior).",
        "default": "",
        "displayOptions": {
          "show": {
            "operation": [
              "forward"
            ]
          }
        }
      },
      "language": {
        "type": "string",
        "title": "Forward Language",
        "description": "Optional language tag for the labels of the quoted header of the forwarded message (e.g. \"es-CO\" shows De / Enviado / Para / Asunto). Empty = English (default Graph behavior). Day and month names stay in English.",
        "default": "",
        "displayOptions": {
          "show": {
            "operation": [
              "forward"
            ]
          }
        }
      },
      "folder": {
        "type": "string",
        "title": "Folder",
        "enum": [
          "inbox",
          "sentitems",
          "drafts",
          "deleteditems",
          "junkemail",
          "archive"
        ],
        "default": "inbox",
        "description": "The mail folder to list messages from.",
        "displayOptions": {
          "show": {
            "operation": [
              "list"
            ]
          }
        }
      },
      "limit": {
        "type": "number",
        "title": "Limit",
        "default": 10,
        "description": "Maximum number of messages to return.",
        "displayOptions": {
          "show": {
            "operation": [
              "list"
            ]
          }
        }
      },
      "filter": {
        "type": "string",
        "title": "Filter",
        "description": "OData filter expression (e.g., \"isRead eq false\").",
        "format": "expression",
        "displayOptions": {
          "show": {
            "operation": [
              "list"
            ]
          }
        }
      },
      "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",
      "operation"
    ]
  },
  "input_contract_schema": {
    "type": "object",
    "properties": {
      "connection_id": {
        "type": "string"
      },
      "operation": {
        "type": "string"
      },
      "to": {
        "type": "string"
      },
      "subject": {
        "type": "string"
      },
      "body": {
        "type": "string"
      },
      "message_id": {
        "type": "string"
      }
    },
    "required": [
      "connection_id",
      "operation"
    ]
  },
  "output_contract_schema": {
    "type": "object",
    "properties": {
      "result": {
        "type": "object",
        "description": "Operation result from Microsoft Graph API."
      },
      "operation": {
        "type": "string",
        "description": "The operation that was performed."
      }
    }
  },
  "ports": [
    {
      "port_id": "out",
      "label": "Success",
      "description": "Operation completed successfully.",
      "is_default": true,
      "supports_condition": true
    },
    {
      "port_id": "error",
      "label": "Error",
      "description": "Operation failed (auth error, invalid message ID, API error).",
      "is_default": false,
      "supports_condition": true
    }
  ],
  "execution_mode": "async",
  "required_resources": [],
  "compatible_worker_pools": [
    "standard-io",
    "cloud-io"
  ],
  "tags": [
    "email",
    "microsoft",
    "outlook",
    "office365",
    "send",
    "connector"
  ],
  "is_stateful": false,
  "publisher": {
    "identity": "org_sommatic_ai",
    "profile": {
      "name": "Sommatic AI",
      "verified": true,
      "url": "https://me.veripass.com/sommatic",
      "logo_url": null
    }
  }
}

Execution

Execution
async
Stateful
No
Retries (retryOnFail)
No
Credentials
Resolved on the server from connection_id; the secret never reaches the workflow.
Capabilities
emailmicrosoftoutlookoffice365graph-api
Tags
emailmicrosoftoutlookoffice365sendconnector

Notes and limits

  • list and get_attachments read a single Graph page; get_attachments includes base64 contentBytes for every attachment.
  • Sending operations are not idempotent and the node does not retry them; re-running a failed workflow can send a message twice.
  • An OAuth access token stored in the credential is never refreshed. App-only tokens need mailbox_mode: other, because they have no /me.
  • Draft-based replies and forwards return draft_id, conversation_id and internet_message_id, which connectors.microsoft.outlook.message.category can use to label the sent copy.

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