Skip to main content

Outlook Integration Guide

Overview

The Outlook integration allows your NINA workflows to connect with Microsoft Outlook via the Microsoft Graph API. This integration enables you to send and manage emails, create and track calendar events, and maintain contacts - all directly from your workflows.

Status

The Microsoft Graph API offers a wide range of functionalities. At present, our integration comprehensively supports key endpoints related to email management, calendar operations, and contact handling.

Credential Configuration

Before using the Outlook integration in your workflows, you need to configure credentials for authentication. This requires setting up an application in the Microsoft Azure Portal.

The Outlook integration supports three authentication methods:

Auth TypeBest ForUser InteractionMFA Compatible
OAuth2Interactive users with browser accessYes (browser sign-in)Yes
Username & Password (ROPC)Accounts without OAuth2/MFA setupNoNo
Client Credentials (App-Only)Service accounts, automation, no user contextNoYes

Setting Up Microsoft Azure App Registration

  1. Go to the Azure Portal
  2. Navigate to Azure Active DirectoryApp registrations
    • Note: In Spanish, this appears as "Registro de aplicaciones"
  3. Click + New registration
  4. Enter a name for your application (e.g., "NINA Outlook Integration")
  5. Set the appropriate Redirect URI (only required for OAuth2):
    • For POC environment: https://poc.zynap.com/api/v1/oauth2/callback
    • For Production environment: https://platform.zynap.com/api/v1/oauth2/callback
  6. Click Register
  7. After registration, note down the following values:
    • Application (client) ID
    • Directory (tenant) ID
  8. Create a client secret:
    • Go to Certificates & secrets
    • Click + New client secret
    • Add a description and select an expiration period
    • Click Add
    • IMPORTANT: Copy the Client Secret Value (Not the Secret ID) immediately, as it will not be shown again.

Required API Permissions

The permissions you need depend on the auth type you will use.

For OAuth2 and Username & Password (ROPC) — Delegated Permissions

  1. In your registered application, go to API permissions
  2. Click + Add a permission
  3. Select Microsoft Graph
  4. Choose Delegated permissions
  5. Add the following permissions:
    • Mail.ReadWrite - To read and create emails
    • Mail.Send - To send emails
    • Calendars.ReadWrite - To manage calendar events
    • Contacts.ReadWrite - To manage contacts
    • User.Read - Basic user profile information
    • offline_access - For refresh tokens (OAuth2 only)
  6. Click Add permissions
  7. Click Grant admin consent (may require admin privileges)

For Client Credentials (App-Only) — Application Permissions

  1. In your registered application, go to API permissions
  2. Click + Add a permission
  3. Select Microsoft Graph
  4. Choose Application permissions (not Delegated)
  5. Add the following permissions:
    • Mail.ReadWrite - To read and create emails
    • Mail.Send - To send emails
    • Calendars.ReadWrite - To manage calendar events
    • Contacts.ReadWrite - To manage contacts
    • User.Read.All - To access user mailboxes
  6. Click Add permissions
  7. Click Grant admin consent — this is mandatory for application permissions since no user will be prompted interactively

Security note: Application permissions grant access to all mailboxes in the tenant by default. To restrict to specific mailboxes, an Exchange admin can create an Application Access Policy scoping the app to a mail-enabled security group.

Additional Setup for ROPC

If using ROPC without a client secret (public client), you must enable the public client flow:

  1. In your app registration, go to Authentication
  2. Under Advanced settings, set Allow public client flows to Yes
  3. Click Save

Note: If you provide a client secret in the ROPC credential, this setting is not needed.

Creating an Outlook Credential in NINA

  1. Click an Outlook node in NINA's canvas
  2. Click Manage Auth and Add Credential
  3. Fill in the credential details:
    • Name: A descriptive name (e.g., "Outlook Production")
    • Description: Optional details about the credential's purpose
    • Auth Type: "OAuth2"
    • Client ID: The Application (client) ID from Azure
    • Client Secret: The client secret you generated
    • Scope: offline_access User.Read Mail.ReadWrite Mail.Send Calendars.ReadWrite Contacts.ReadWrite
    • Access Token URL: https://login.microsoftonline.com/{tenantId}/oauth2/v2.0/token
      • Replace {tenantId} with your Directory (tenant) ID from step 7 above
    • Auth URL: https://login.microsoftonline.com/{tenantId}/oauth2/v2.0/authorize
      • Replace {tenantId} with your Directory (tenant) ID from step 7 above
  4. Click Create to start the OAuth2 flow
  5. Sign in to your Microsoft account if prompted
  6. Review and accept the requested permissions, if prompted
  7. After successful authorization, test the credential

Option 2: Username & Password (ROPC)

Use when the mailbox account cannot be enrolled in OAuth2 (e.g., no browser access). Does not work with MFA-enabled accounts.

  1. Click an Outlook node in NINA's canvas
  2. Click Manage Auth and Add Credential
  3. Fill in the credential details:
    • Name: A descriptive name (e.g., "Outlook ROPC - Service Account")
    • Auth Type: "Username & Password"
    • Client ID: The Application (client) ID from Azure
    • Client Secret: Optional (required for confidential client apps)
    • Tenant ID: Your Microsoft 365 tenant ID (e.g., contoso.onmicrosoft.com)
    • Username: UPN / email address of the mailbox (e.g., [email protected])
    • Password: Password for the mailbox account
  4. Click Create
  5. Test the credential to verify it works

Option 3: Client Credentials (App-Only)

Use for service-to-service automation with no user interaction. The app authenticates as itself and targets a specific mailbox.

  1. Click an Outlook node in NINA's canvas
  2. Click Manage Auth and Add Credential
  3. Fill in the credential details:
    • Name: A descriptive name (e.g., "Outlook App-Only - Alerts Mailbox")
    • Auth Type: "Client Credentials (App-Only)"
    • Client ID: The Application (client) ID from Azure
    • Client Secret: The client secret you generated (mandatory)
    • Tenant ID: Your Microsoft 365 tenant ID (e.g., contoso.onmicrosoft.com)
    • User Principal Name: Email of the target mailbox (e.g., [email protected])
  4. Click Create
  5. Test the credential to verify it works

Important: The User Principal Name determines which mailbox the integration operates on. All operations (send email, read calendar, manage contacts) will target this specific mailbox.

Supported Resources and Operations

The Outlook integration supports the following resources and operations:

Message

OperationDescription
Create DraftCreates a new draft email message
Send EmailSends a new email message
Get EmailRetrieves details of a specific email
Get All EmailsSearches for and retrieves multiple emails
Update EmailUpdates an existing email message
Delete EmailDeletes an email message

Message Rule

OperationDescription
List RulesLists inbox message rules
Get RuleRetrieves details of a specific message rule
Create RuleCreates a new message rule
Update RuleUpdates an existing message rule
Delete RuleDeletes a message rule

Calendar

OperationDescription
Create EventCreates a new calendar event
Get EventRetrieves details of a specific event
Get All EventsSearches for and retrieves multiple events
Update EventUpdates an existing calendar event
Delete EventDeletes a calendar event

Contact

OperationDescription
Create ContactCreates a new contact
Get ContactRetrieves details of a specific contact
Get All ContactsSearches for and retrieves multiple contacts
Update ContactUpdates an existing contact
Delete ContactDeletes a contact

Mail Folder

OperationDescription
Create Mail FolderCreates a new mail folder
Get Mail FolderRetrieves details of a specific mail folder
Get All Mail FoldersLists all mail folders
Update Mail FolderUpdates an existing mail folder
Delete Mail FolderDeletes a mail folder

Attachment

OperationDescription
List AttachmentsRetrieves all attachments from a specific message
Get AttachmentRetrieves details of a specific attachment

Parameter Merging and Templating

The Outlook integration takes full advantage of NINA's parameter merging and templating capabilities:

Parameter Sources (in order of precedence)

  1. Node Parameters: Parameters configured directly in the Outlook Integration Node
  2. Extracted Parameters: Parameters automatically extracted from the input data
  3. Input Data: The complete input data from upstream nodes

When an Outlook Integration Node executes:

  • It combines parameters from all sources
  • Node parameters take precedence over extracted parameters
  • Template variables within parameters are processed (using {{variable_name}} syntax)
  • The combined parameters are used to execute the Outlook operation

Example: Sending Emails

Basic Email Sending

Below is an example of sending a basic email message:

Node Configuration:

{
"integration_service": "outlook",
"resource": "message",
"operation": "send",
"parameters": {
"subject": "Important Security Alert",
"bodyContent": "<h1>Security Alert</h1><p>We've detected unusual activity in your account.</p>",
"bodyContentType": "html",
"to": ["[email protected]"],
"additionalFields": {
"cc": ["[email protected]"],
"importance": "high"
}
}
}

Sending Email with Attachments

You can include file attachments in your emails:

Node Configuration:

{
"integration_service": "outlook",
"resource": "message",
"operation": "send",
"parameters": {
"subject": "Monthly Security Report",
"bodyContent": "<p>Please find attached the security report for this month.</p>",
"bodyContentType": "html",
"to": ["[email protected]"],
"additionalFields": {
"attachments": [
{
"name": "security-report.pdf",
"contentType": "application/pdf",
"contentBytes": "BASE64_ENCODED_FILE_CONTENT_HERE"
},
{
"name": "vulnerabilities.xlsx",
"contentType": "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
"contentBytes": "BASE64_ENCODED_FILE_CONTENT_HERE"
}
],
"importance": "normal",
"saveToSentItems": true
}
}
}

Personalized Emails Using Template Variables

You can use template variables to create personalized email content:

Input Data from Previous Node:

{
"recipient": {
"email": "[email protected]",
"firstName": "John",
"lastName": "Smith",
"role": "Security Analyst"
},
"report": {
"date": "2024-05-12",
"findings": 5,
"criticalIssues": 2,
"summary": "Multiple critical vulnerabilities detected"
}
}

Node Configuration with Template Variables:

{
"integration_service": "outlook",
"resource": "message",
"operation": "send",
"parameters": {
"subject": "Security Report: {{report.date}} - {{report.summary}}",
"bodyContent": "<h1>Security Report</h1><p>Hello {{recipient.firstName}},</p><p>We've completed the security scan on {{report.date}} and found {{report.findings}} issues, including {{report.criticalIssues}} critical vulnerabilities that require your immediate attention.</p><p>Please review the attached report at your earliest convenience.</p><p>Best regards,<br>Security Team</p>",
"bodyContentType": "html",
"to": ["{{recipient.email}}"],
"additionalFields": {
"importance": "{{report.criticalIssues > 0 ? 'high' : 'normal'}}"
}
}
}

Result:

This will send an email with:

  • Subject: "Security Report: 2024-05-12 - Multiple critical vulnerabilities detected"
  • Personalized greeting: "Hello John,"
  • Dynamic content showing 5 findings and 2 critical issues
  • To: "[email protected]"
  • Importance set to "high" based on the critical issues condition

Example: Email Retrieval and Folder Management

Retrieving Emails from a Specific Folder

Search for emails in a specific folder:

Node Configuration:

{
"integration_service": "outlook",
"resource": "message",
"operation": "getAll",
"parameters": {
"returnAll": false,
"limit": 10,
"filter": {
"folderPath": {
"mode": "id",
"value": "/inbox"
},
"readStatus": "unread",
"select": "id,subject,receivedDateTime,from,hasAttachments",
"orderBy": "receivedDateTime desc"
}
}
}

Retrieving a Specific Email

Get a single email by its ID:

Node Configuration:

{
"integration_service": "outlook",
"resource": "message",
"operation": "get",
"parameters": {
"messageId": "AAMkAGVmMDEzMTM4LTZmYWUtNDdkNC1hMDZiLTU1OGY5OTZhYmY4OABGAAAAAAAiQ8W967B7TKBjgx9rVEURBwAiIsqMbYjsT5e-T7KzowPTAAAAAAEMAAAiIsqMbYjsT5e-T7KzowPTAAAYbvZuAAA=",
"additionalFields": {
"select": "id,subject,body,from,toRecipients,attachments"
}
}
}

Updating Email Read Status

Mark an email as read:

Node Configuration:

{
"integration_service": "outlook",
"resource": "message",
"operation": "update",
"parameters": {
"messageId": "AAMkAGVmMDEzMTM4LTZmYWUtNDdkNC1hMDZiLTU1OGY5OTZhYmY4OABGAAAAAAAiQ8W967B7TKBjgx9rVEURBwAiIsqMbYjsT5e-T7KzowPTAAAAAAEMAAAiIsqMbYjsT5e-T7KzowPTAAAYbvZuAAA=",
"updateFields": {
"isRead": true
}
}
}

Example: Calendar Event Operations

Creating a Calendar Event

Create a new calendar event with attendees:

Node Configuration:

{
"integration_service": "outlook",
"resource": "calendar",
"operation": "create",
"parameters": {
"subject": "Security Incident Review",
"start": "2024-05-15T14:00:00",
"end": "2024-05-15T15:00:00",
"timeZone": "Eastern Standard Time",
"additionalFields": {
"bodyContent": "<p>Meeting to review the security incident from last week.</p><p>Please bring all relevant documentation.</p>",
"bodyContentType": "html",
"location": "Conference Room B",
"isOnlineMeeting": true,
"importance": "high",
"attendees": [
{
"email": "[email protected]",
"type": "required"
},
{
"email": "[email protected]",
"type": "required"
},
{
"email": "[email protected]",
"type": "optional"
}
]
}
}
}

Retrieving Calendar Events

Get upcoming calendar events:

Node Configuration:

{
"integration_service": "outlook",
"resource": "calendar",
"operation": "getAll",
"parameters": {
"returnAll": false,
"limit": 10,
"filter": {
"startDateTime": "2024-05-12T00:00:00Z",
"endDateTime": "2024-05-19T00:00:00Z",
"orderBy": "start/dateTime asc"
}
}
}

Updating a Calendar Event

Update an existing event's details:

Node Configuration:

{
"integration_service": "outlook",
"resource": "calendar",
"operation": "update",
"parameters": {
"eventId": "AAMkAGVmMDEzMTM4LTZmYWUtNDdkNC1hMDZiLTU1OGY5OTZhYmY4OABGAAAAAAAiQ8W967B7TKBjgx9rVEURBwAiIsqMbYjsT5e-T7KzowPTAAAAAAENAAAiIsqMbYjsT5e-T7KzowPTAAAbMOqHAAA=",
"updateFields": {
"subject": "URGENT: Security Incident Review",
"location": "Executive Conference Room",
"start": "2024-05-15T13:30:00",
"end": "2024-05-15T15:30:00",
"timeZone": "Eastern Standard Time",
"bodyContent": "<p><strong>URGENT UPDATE:</strong> Meeting extended to 2 hours and moved to Executive Conference Room. CISO will attend.</p><p>Meeting to review the security incident from last week.</p><p>Please bring all relevant documentation.</p>",
"importance": "high"
}
}
}

Example: Contact Management

Creating a Contact

Create a new contact with detailed information:

Node Configuration:

{
"integration_service": "outlook",
"resource": "contact",
"operation": "create",
"parameters": {
"givenName": "Jane",
"surname": "Doe",
"additionalFields": {
"emailAddresses": [
{
"address": "[email protected]",
"name": "Jane Doe"
},
{
"address": "[email protected]",
"name": "Jane Doe (Personal)"
}
],
"businessPhones": ["+1 (555) 123-4567"],
"mobilePhone": "+1 (555) 987-6543",
"jobTitle": "Chief Information Security Officer",
"companyName": "Acme Corporation",
"department": "Information Security",
"officeLocation": "New York Office"
}
}
}

Retrieving Contacts

Search for contacts:

Node Configuration:

{
"integration_service": "outlook",
"resource": "contact",
"operation": "getAll",
"parameters": {
"returnAll": false,
"limit": 20,
"filter": {
"filterString": "startswith(companyName,'Acme')",
"orderBy": "surname asc"
}
}
}

Updating a Contact

Update an existing contact's information:

Node Configuration:

{
"integration_service": "outlook",
"resource": "contact",
"operation": "update",
"parameters": {
"contactId": "AAMkAGVmMDEzMTM4LTZmYWUtNDdkNC1hMDZiLTU1OGY5OTZhYmY4OABGAAAAAAAiQ8W967B7TKBjgx9rVEURBwAiIsqMbYjsT5e-T7KzowPTAAAAAAEOAAAiIsqMbYjsT5e-T7KzowPTAAAYjQx1AAA=",
"updateFields": {
"jobTitle": "Head of Cybersecurity",
"mobilePhone": "+1 (555) 987-6543",
"companyName": "Acme Security Solutions"
}
}
}

Example: Message Rule Management

Message rules allow you to automatically organize and process incoming emails based on specific conditions. This is particularly useful for security teams to automatically categorize alerts, forward critical notifications, or organize emails into specific folders.

Creating a Message Rule

Create a rule to automatically move security alerts to a dedicated folder:

Node Configuration:

{
"integration_service": "outlook",
"resource": "messageRule",
"operation": "create",
"parameters": {
"displayName": "Security Alert Auto-Organization",
"sequence": 1,
"isEnabled": true,
"conditions": {
"subjectContains": ["SECURITY ALERT", "CRITICAL VULNERABILITY", "INCIDENT"],
"fromAddresses": ["[email protected]", "[email protected]"],
"importance": "high"
},
"actions": {
"moveToFolder": "AAMkAGVmMDEzMTM4LTZmYWUtNDdkNC1hMDZiLTU1OGY5OTZhYmY4OABGAAAAAAAiQ8W967B7TKBjgx9rVEURBwAiIsqMbYjsT5e-T7KzowPTAAAAAAEMAAAiIsqMbYjsT5e-T7KzowPTAAAYbvZuAAA=",
"markAsRead": false,
"markImportance": "high",
"stopProcessingRules": true
}
}
}

Creating a Rule with Forwarding Action

Create a rule to forward critical security incidents to the security team:

Node Configuration:

{
"integration_service": "outlook",
"resource": "messageRule",
"operation": "create",
"parameters": {
"displayName": "Critical Incident Forwarding",
"sequence": 2,
"isEnabled": true,
"conditions": {
"subjectContains": ["CRITICAL INCIDENT", "BREACH DETECTED", "EMERGENCY"],
"bodyOrSubjectContains": ["immediate action required", "urgent response needed"]
},
"actions": {
"forwardTo": ["[email protected]", "[email protected]"],
"markImportance": "high",
"copyToFolder": "AAMkAGVmMDEzMTM4LTZmYWUtNDdkNC1hMDZiLTU1OGY5OTZhYmY4OABGAAAAAAAiQ8W967B7TKBjgx9rVEURBwAiIsqMbYjsT5e-T7KzowPTAAAAAAEMAAAiIsqMbYjsT5e-T7KzowPTAAAYbvZuAAA="
},
"exceptions": {
"senderContains": ["test", "demo"],
"subjectContains": ["TEST", "DEMO"]
}
}
}

Listing Message Rules

Retrieve all existing message rules:

Node Configuration:

{
"integration_service": "outlook",
"resource": "messageRule",
"operation": "list",
"parameters": {
"top": 20,
"skip": 0
}
}

Updating a Message Rule

Modify an existing rule to add new conditions:

Node Configuration:

{
"integration_service": "outlook",
"resource": "messageRule",
"operation": "update",
"parameters": {
"ruleId": "AAMkAGVmMDEzMTM4LTZmYWUtNDdkNC1hMDZiLTU1OGY5OTZhYmY4OABGAAAAAAAiQ8W967B7TKBjgx9rVEURBwAiIsqMbYjsT5e-T7KzowPTAAAAAAEMAAAiIsqMbYjsT5e-T7KzowPTAAAYbvZuAAA=",
"displayName": "Enhanced Security Alert Auto-Organization",
"isEnabled": true,
"conditions": {
"subjectContains": ["SECURITY ALERT", "CRITICAL VULNERABILITY", "INCIDENT", "MALWARE DETECTED"],
"fromAddresses": ["[email protected]", "[email protected]", "[email protected]"],
"importance": "high",
"hasAttachments": false
},
"actions": {
"moveToFolder": "AAMkAGVmMDEzMTM4LTZmYWUtNDdkNC1hMDZiLTU1OGY5OTZhYmY4OABGAAAAAAAiQ8W967B7TKBjgx9rVEURBwAiIsqMbYjsT5e-T7KzowPTAAAAAAEMAAAiIsqMbYjsT5e-T7KzowPTAAAYbvZuAAA=",
"markAsRead": false,
"markImportance": "high",
"stopProcessingRules": true
}
}
}

Example: Mail Folder Management

Mail folders help organize emails into logical categories. This is essential for security teams to maintain organized archives of security communications, incident reports, and compliance documentation.

Creating a Mail Folder

Create a new folder for security incident tracking:

Node Configuration:

{
"integration_service": "outlook",
"resource": "mailFolder",
"operation": "create",
"parameters": {
"displayName": "Security Incidents 2024",
"isHidden": false
}
}

Creating a Subfolder

Create a subfolder within an existing folder:

Node Configuration:

{
"integration_service": "outlook",
"resource": "mailFolder",
"operation": "create",
"parameters": {
"displayName": "Critical Incidents",
"parentFolderId": "AAMkAGVmMDEzMTM4LTZmYWUtNDdkNC1hMDZiLTU1OGY5OTZhYmY4OABGAAAAAAAiQ8W967B7TKBjgx9rVEURBwAiIsqMbYjsT5e-T7KzowPTAAAAAAEMAAAiIsqMbYjsT5e-T7KzowPTAAAYbvZuAAA=",
"isHidden": false
}
}

Listing All Mail Folders

Retrieve all top-level mail folders:

Node Configuration:

{
"integration_service": "outlook",
"resource": "mailFolder",
"operation": "getAll",
"parameters": {
"top": 50,
"select": "id,displayName,childFolderCount,totalItemCount,unreadItemCount",
"orderby": "displayName asc"
}
}

Listing Child Folders

Get all subfolders of a specific parent folder:

Node Configuration:

{
"integration_service": "outlook",
"resource": "mailFolder",
"operation": "getAll",
"parameters": {
"parentFolderId": "AAMkAGVmMDEzMTM4LTZmYWUtNDdkNC1hMDZiLTU1OGY5OTZhYmY4OABGAAAAAAAiQ8W967B7TKBjgx9rVEURBwAiIsqMbYjsT5e-T7KzowPTAAAAAAEMAAAiIsqMbYjsT5e-T7KzowPTAAAYbvZuAAA=",
"top": 20,
"select": "id,displayName,totalItemCount",
"filter": "totalItemCount gt 0"
}
}

Getting a Specific Mail Folder

Retrieve details of a specific folder:

Node Configuration:

{
"integration_service": "outlook",
"resource": "mailFolder",
"operation": "get",
"parameters": {
"folderId": "inbox",
"additionalFields": {
"select": "id,displayName,totalItemCount,unreadItemCount,childFolderCount",
"expand": "childFolders"
}
}
}

Updating a Mail Folder

Rename a mail folder:

Node Configuration:

{
"integration_service": "outlook",
"resource": "mailFolder",
"operation": "update",
"parameters": {
"folderId": "AAMkAGVmMDEzMTM4LTZmYWUtNDdkNC1hMDZiLTU1OGY5OTZhYmY4OABGAAAAAAAiQ8W967B7TKBjgx9rVEURBwAiIsqMbYjsT5e-T7KzowPTAAAAAAEMAAAiIsqMbYjsT5e-T7KzowPTAAAYbvZuAAA=",
"displayName": "Security Incidents Archive 2024",
"isHidden": true
}
}

Example: Attachment Management

Attachments often contain critical security information such as incident reports, vulnerability scans, or forensic evidence. The attachment operations allow you to retrieve and analyze these files programmatically.

Listing Email Attachments

Retrieve all attachments from a specific security incident email:

Node Configuration:

{
"integration_service": "outlook",
"resource": "attachment",
"operation": "list",
"parameters": {
"messageId": "AAMkAGVmMDEzMTM4LTZmYWUtNDdkNC1hMDZiLTU1OGY5OTZhYmY4OABGAAAAAAAiQ8W967B7TKBjgx9rVEURBwAiIsqMbYjsT5e-T7KzowPTAAAAAAEMAAAiIsqMbYjsT5e-T7KzowPTAAAYbvZuAAA=",
"select": "id,name,contentType,size,lastModifiedDateTime",
"top": 10
}
}

Filtering Attachments by Type

List only PDF attachments from an email:

Node Configuration:

{
"integration_service": "outlook",
"resource": "attachment",
"operation": "list",
"parameters": {
"messageId": "AAMkAGVmMDEzMTM4LTZmYWUtNDdkNC1hMDZiLTU1OGY5OTZhYmY4OABGAAAAAAAiQ8W967B7TKBjgx9rVEURBwAiIsqMbYjsT5e-T7KzowPTAAAAAAEMAAAiIsqMbYjsT5e-T7KzowPTAAAYbvZuAAA=",
"filter": "contentType eq 'application/pdf'",
"select": "id,name,size,contentType"
}
}

Getting a Specific Attachment

Retrieve details and content of a specific attachment:

Node Configuration:

{
"integration_service": "outlook",
"resource": "attachment",
"operation": "get",
"parameters": {
"messageId": "AAMkAGVmMDEzMTM4LTZmYWUtNDdkNC1hMDZiLTU1OGY5OTZhYmY4OABGAAAAAAAiQ8W967B7TKBjgx9rVEURBwAiIsqMbYjsT5e-T7KzowPTAAAAAAEMAAAiIsqMbYjsT5e-T7KzowPTAAAYbvZuAAA=",
"attachmentId": "AAMkAGVmMDEzMTM4LTZmYWUtNDdkNC1hMDZiLTU1OGY5OTZhYmY4OABGAAAAAAAiQ8W967B7TKBjgx9rVEURBwAiIsqMbYjsT5e-T7KzowPTAAAAAAEMAAAiIsqMbYjsT5e-T7KzowPTAAAYbvZuAAA=",
"select": "id,name,contentType,size,contentBytes"
}
}

Processing Attachments in Workflows

Use template variables to process attachment information:

Input Data from Previous Node:

{
"incident": {
"id": "INC-2024-001",
"severity": "critical",
"messageId": "AAMkAGVmMDEzMTM4LTZmYWUtNDdkNC1hMDZiLTU1OGY5OTZhYmY4OABGAAAAAAAiQ8W967B7TKBjgx9rVEURBwAiIsqMbYjsT5e-T7KzowPTAAAAAAEMAAAiIsqMbYjsT5e-T7KzowPTAAAYbvZuAAA="
}
}

Node Configuration with Template Variables:

{
"integration_service": "outlook",
"resource": "attachment",
"operation": "list",
"parameters": {
"messageId": "{{incident.messageId}}",
"filter": "size gt 1024 and (contentType eq 'application/pdf' or contentType eq 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet')",
"select": "id,name,contentType,size",
"top": 5
}
}

Integration in Workflow Context

The Outlook integration is particularly powerful when combined with other nodes in a workflow:

Complete workflow showing Outlook integration nodes connected with other node types

Common Workflow Patterns:

  1. Security Alert Notifications:

    • Security Scan Node → Script Node (analyze results) → If/Else Node (severity check) → Outlook Integration Node (send email alert)
  2. Scheduled Reporting:

    • Schedule Node → Script Node (generate report) → Outlook Integration Node (send email with attachment)
  3. Email Processing Pipeline:

    • Webhook Node (trigger) → Outlook Integration Node (get emails) → Script Node (analyze content) → Outlook Integration Node (send responses)
  4. Incident Response Coordination:

    • Alert Node → Script Node (incident details) → Outlook Integration Node (create calendar event) → Outlook Integration Node (send email to team)
  5. Contact Synchronization:

    • Database Node → Script Node (format contacts) → Outlook Integration Node (create/update contacts)

Troubleshooting Authentication

OAuth2

IssueResolution
Token expiredThe integration automatically refreshes tokens when possible. If this fails, reconnect the credential by clicking "Authorize" again.
Insufficient permissionsVerify that all required permissions are granted in Azure App Registration. You may need to re-consent to permissions.
Invalid client ID/secretDouble-check the client ID and client secret from Azure. Note that secrets expire and may need to be regenerated.
Redirect URI mismatchEnsure the redirect URI in Azure exactly matches the one expected by NINA.
Tenant restrictionsFor multi-tenant apps, ensure your Azure AD tenant allows the application access.
Consent issuesEnsure you're signing in with an account that has sufficient privileges to grant consent.

Username & Password (ROPC)

IssueResolution
AADSTS50076 — MFA requiredROPC does not support MFA. Disable MFA for this account or use OAuth2 / Client Credentials instead.
AADSTS7000218 — Public client flow not enabledEnable "Allow public client flows" in Azure app Authentication settings, or provide a client secret.
AADSTS50034 — Account not foundVerify the username is a valid UPN in the tenant. Personal Microsoft accounts (@outlook.com, @hotmail.com) are not supported.
AADSTS65001 — Consent not grantedAn admin must grant consent for the delegated permissions on the app registration.

Client Credentials (App-Only)

IssueResolution
403 ErrorAccessDenied on Graph API callsThe app likely has Delegated permissions instead of Application permissions. Add the correct Application permissions and grant admin consent.
AADSTS7000215 — Invalid client secretDouble-check the client secret value (not the secret ID). Secrets expire — regenerate if needed.
404 or ErrorInvalidUserThe userPrincipalName does not match any user in the tenant. Verify the email address.
Access to unintended mailboxesBy default, app-only permissions grant access to all mailboxes. Use an Application Access Policy to restrict scope.

General

IssueResolution
Connection issuesCheck network connectivity to Microsoft Graph API endpoints.
Request timeoutMicrosoft Graph API can have timeouts. Consider implementing retry logic in workflows.

Best Practices

  1. Choose the Right Auth Type: Use OAuth2 when possible. Use ROPC only for accounts without MFA/OAuth2 setup. Use Client Credentials for service-to-service automation.

  2. Restrict App-Only Access: When using Client Credentials, work with your Exchange admin to create Application Access Policies that limit which mailboxes the app can access.

  3. Handle Attachments Carefully: Base64-encode file attachments correctly and set the appropriate content type.

  4. Leverage Template Variables: Use {{variable_name}} syntax to create dynamic, personalized email content.

  5. Filter Email Retrieval: When using "Get All Emails", always apply appropriate filters to limit the result set.

  6. Set Appropriate Timeouts: For operations involving large attachments or many recipients, allow for longer execution times.

  7. Error Handling: Implement error handling for rate limiting, authentication failures, and other API issues.

  8. Manage Credentials Carefully: Regularly rotate client secrets in Azure and update your credentials in NINA. ROPC credentials should be rotated when the user's password changes.

  9. Use Importance Flags Wisely: Reserve "high" importance for truly urgent messages to prevent recipient fatigue.

  10. Respect Calendar Availability: Check recipients' availability before scheduling calendar events.

  11. Process HTML Content Safely: When generating HTML email content, sanitize any user-provided input to prevent issues.

Updated: 2026-04-01