Skip to content

Get Emails Node

The Get Emails node connects to a Microsoft 365 email account using a configured service connection and retrieves a list of email messages based on optional filters such as sender, recipient, subject, keywords, and date range.

This node is useful for automating workflows that depend on reading or processing recent email communications, such as triggering follow-up tasks based on incoming emails.

Node Purpose

This node retrieves email messages from a user's Microsoft 365 mailbox via Graph API using filters and constraints defined by the user. Results are stored in a variable for downstream consumption.


Inputs

LabelTypeDescription
ThirdParty-MicrosofttextThe ID of the linked Microsoft 365 service account.
Maximum Emails to RetrievenumberThe maximum number of emails to fetch. Must be between 1 and 1000.
Filter Totext(Optional) Filter emails sent to this address.
Filter Fromtext(Optional) Filter emails sent from this address.
Filter Subjecttext(Optional) Only retrieve emails containing this string in the subject.
Keywords searchtext(Optional) Search for keywords in the message body.
Unread EmailsbooleanIf true, only unread messages will be returned.
Inbox Folder onlybooleanIf true, restrict search to the Inbox folder.
Date AfterdateTime(Optional) Only include emails received after this date.
Date BeforedateTime(Optional) Only include emails received before this date.

Output

VariableTypeDescription
EmailslistA list of simplified email message objects matching the filter criteria.

Example Use Case

You want to monitor a shared mailbox for new customer support emails from a specific sender. You configure this node with:

  • Filter From: support@client.com
  • Unread Emails: true
  • Maximum Emails to Retrieve: 50
  • Date After: a recent date to avoid old messages

The output can then be parsed or processed by a downstream automation step.


Error Handling

  • If the Microsoft service account is not configured or cannot be retrieved, the task fails with: Required Service Accounts not found
  • If Maximum Emails to Retrieve is not between 1 and 1000, the task fails with: Maximum Emails to Retrieve must be between 1 and 1000
  • If an unhandled exception occurs during execution, it will return an error message in the format: Failed to Execute: - <error message>

Remarks

  • The email retrieval uses Microsoft Graph API and requires appropriate token permissions.
  • Emails are returned as emailMessageSimple objects; these typically include basic metadata like sender, subject, date, and body preview.
  • Filtering is additive: if multiple filters are specified, all must be matched for an email to be returned.

Tentech 2024