Aller au contenu principal

Office 365 Toolkit

The Office 365 Toolkit lets your workflows interact with Outlook email and calendar through Microsoft Graph — searching and reading messages, handling attachments, sending or drafting mail, and searching or creating calendar events.

For related agent chat toolkits, see Microsoft Outlook, Microsoft Teams, Microsoft Excel, and Microsoft Word.

Prerequisites​

  • A workflow you can edit
  • A connected Office 365 account (personal or team) available to the node
  • Azure AD app permissions granted for Mail and Calendar (admin consent may be required)
  • Message IDs, attachment IDs, or datetime values from earlier nodes — or @ variables that supply them

Authentication​

All Office 365 tools require an Office 365 account connection. Each tool includes an Office 365 Account selector:

OptionDescription
Use my Office 365 accountUses your personal connected Office 365 account.
Use team accountUses a shared team Office 365 account configured for the project.

If no account is connected, click Connect Office 365 Account to authenticate with Microsoft.

Required Microsoft Graph scopes include Mail.ReadWrite, Mail.Send, Calendars.ReadWrite, User.Read, and offline_access.

Tools​

Search Emails​

Search Outlook emails using Microsoft Graph. Returns structured message metadata and excerpts. Supports KQL-style queries.

FieldRequiredDescription
Office 365 AccountYesSelect your personal or team Office 365 account.
QueryYesSearch query to filter Outlook emails (KQL syntax supported). Type @ to select a variable.
FolderNoMailbox folder to search. Leave blank for Inbox. Default is empty.
Max ResultsNoMaximum number of messages to return. Default is 10.
Include AttachmentsNoWhen enabled, fetch attachment metadata (filename, size, type). Does not include binary data. Default is false.
Include Attachment DataNoWhen enabled, include full binary attachment data (base64). Intended for workflows, not AI agents. Default is false.

Read Email​

Read a single Outlook message by Microsoft Graph message ID (from Search Emails). Returns the full body, headers, and optional attachment metadata.

FieldRequiredDescription
Office 365 AccountYesSelect your personal or team Office 365 account.
Message IdYesMicrosoft Graph message ID. Type @ to select a variable (for example from search results).
Include Attachment SummaryNoWhen enabled, include attachment id, name, size, and type without binary content. Default is true.

Read Attachments​

List all attachments on a message (id, filename, MIME type, size, inline flag). Does not return file bytes.

FieldRequiredDescription
Office 365 AccountYesSelect your personal or team Office 365 account.
Message IdYesMicrosoft Graph message ID whose attachments to list. Type @ to select a variable.

Download Attachments​

Download file attachments as base64 (contentBytes). Use attachment IDs from Read Attachments; omit IDs to fetch all non-inline files (capped at 25).

FieldRequiredDescription
Office 365 AccountYesSelect your personal or team Office 365 account.
Message IdYesMicrosoft Graph message ID. Type @ to select a variable.
Attachment IdsNoComma-separated Graph attachment IDs. Leave empty to download all non-inline file attachments (max 25). Default is empty.

Send Message​

Send an email through Outlook. Use only when the workflow intentionally sends mail.

FieldRequiredDescription
Office 365 AccountYesSelect your personal or team Office 365 account.
BodyYesHTML or plain text email body. Type @ to select a variable.
ToYesList of recipient email addresses.
SubjectYesSubject line for the email. Type @ to select a variable.
CcNoOptional CC recipients. Default is null.
BccNoOptional BCC recipients. Default is null.

Create Draft Message​

Create an Outlook draft email for later review or approval.

FieldRequiredDescription
Office 365 AccountYesSelect your personal or team Office 365 account.
BodyYesHTML or plain text email body. Type @ to select a variable.
ToYesList of recipient email addresses.
SubjectYesSubject line for the draft. Type @ to select a variable.
CcNoOptional CC recipients. Default is null.
BccNoOptional BCC recipients. Default is null.

Search Events​

Search calendar events within a timeframe. Useful for agenda lookups and meeting summaries.

FieldRequiredDescription
Office 365 AccountYesSelect your personal or team Office 365 account.
Start DatetimeYesISO 8601 start datetime (for example 2024-03-10T09:00:00). Type @ to select a variable.
End DatetimeYesISO 8601 end datetime. Type @ to select a variable.
Max ResultsNoMaximum number of events to return. Default is 10.
TruncateNoWhether to truncate long fields. Default is true.
Truncate LimitNoCharacter limit used when truncating. Default is 150.

Send Event​

Schedule a calendar event in Outlook with attendees and a description.

FieldRequiredDescription
Office 365 AccountYesSelect your personal or team Office 365 account.
BodyYesEvent description (HTML or plain text). Type @ to select a variable.
AttendeesYesEmail addresses of meeting attendees.
SubjectYesEvent subject. Type @ to select a variable.
Start DatetimeYesISO 8601 start datetime. Type @ to select a variable.
End DatetimeYesISO 8601 end datetime. Type @ to select a variable.

Tips​

  • Prefer @ variables for message IDs and attachment IDs from earlier nodes (search → read → download)
  • Keep Include Attachment Data off unless a later node needs the binary content
  • Use Create Draft Message when a human should review mail before it is sent
  • Use ISO 8601 datetimes (with timezone when possible) for calendar tools
  • For mail and calendar in agent chat, use Microsoft Outlook instead of this workflow toolkit

Troubleshooting​

SymptomWhat to check
Account selector emptyConnect personal or team Office 365; refresh the workflow editor
Authentication or consent errorsConfirm Azure AD app permissions and admin consent for Mail and Calendar scopes
Empty search resultsVerify Query / folder and that the connected mailbox has matching messages
Attachment download fails or is truncatedConfirm attachment IDs from Read Attachments; omit IDs only when you need all non-inline files (max 25)
Confused with agent Microsoft toolkitsAgent chat is split across Outlook, Teams, Excel, and Word