Skip to main content

Convert Outlook emails to Planner tasks and monitor Secure Score with Teams alerts in M365

Workflow preview

Workflow preview
100%
Convert Outlook emails to Planner tasks and monitor Secure Score with Teams alerts in M365 preview
Open on n8n.io

1. Workflow Overview

Keep your IT operations moving, every action email becomes a tracked task, and every security alert lands where it belongs, automatically. Every IT team deals with the same two problems: important ...

Best for

  • Ticket Management automation workflows
  • AI Summarization automation workflows
  • advanced n8n builders looking for reusable templates

Tools used

n8n-nodes-base.scheduletrigger, n8n-nodes-base.microsoftoutlook, n8n-nodes-base.if, n8n-nodes-base.noop, n8n-nodes-base.splitinbatches, n8n-nodes-base.code, n8n-nodes-base.httprequest, n8n-nodes-base.microsoftteams

Source and attribution

This workflow is cataloged by N8N Workflows and links back to its original n8n.io source page by Mychel Garzon.

Original n8n.io source

1.1 Workflow description

Title
Convert Outlook emails to Planner tasks and monitor Secure Score with Teams alerts in M365
Workflow name
Convert Outlook emails to Planner tasks and monitor Secure Score with Teams alerts in M365

Keep your IT operations moving, every action email becomes a tracked task, and every security alert lands where it belongs, automatically.

Every IT team deals with the same two problems: important emails that should become tasks but don't, and security posture scores that nobody checks until something breaks. This workflow solves both automatically. It scans your Outlook inbox every 30 minutes for actionable emails and converts them into Microsoft Planner tasks, while a separate Monday morning pipeline monitors your Microsoft Secure Score and creates a priority-1 alert task if you drop below 80%.


How it works

The workflow runs two independent pipelines on a single Microsoft Graph OAuth2 credential:

Pipeline 1: Email-to-Task Parser (every 30 minutes)

  1. Email Ingestion: Polls Outlook for unread emails every 30 minutes. Exits cleanly if the inbox is empty. Splits emails into a sequential batch loop for one-at-a-time processing.
  2. Keyword Extraction & Date Parsing: Strips HTML from the email body and scans subject and body for configurable action keywords (URGENT, ACTION REQUIRED, TASK:, PLEASE REVIEW, CRITICAL). Extracts due dates from ISO format (2025-06-30), structured prefixes (due: 30.6.2025), or relative phrases (today, tomorrow, end of week, Friday).
  3. Task Creation Chain: Creates a Planner task via Graph API with the correct priority and due date, attaches the sender details and a 500-character body preview as the task description, posts a Teams notification, sends an auto-reply to the sender, and marks the email as read. Every node runs with Continue on Fail so a single API error does not crash the batch.
  4. Poison Pill Guard & Rate Limit: Checks upstream nodes for silent failures before continuing. Waits 2 seconds between emails to respect Graph API rate limits, then loops back for the next email.

Pipeline 2: Security Score Monitor (every Monday at 08:00)

  1. Score Fetch & Calculation: Fetches the latest Microsoft Secure Score from the Graph Security API and calculates it as a percentage of the maximum achievable score.
  2. Alert Routing & Deduplication: If below 80%, checks whether an open alert task already exists in Planner to avoid duplicate accumulation across weekly runs. Creates a new task or updates the existing one with the latest score.
  3. Security Task & Teams Alert: Creates or updates a priority-1 Planner task with a 24-hour due date and a Defender portal reference. Posts a Teams alert with current score, maximum score, and scan date. If the score is healthy, posts a green summary instead.

Key benefits

  • Keyword-driven task creation: Configurable keyword list means no hardcoded triggers, adapt it to your team's exact email language without touching code
  • Smart date extraction: Parses ISO dates, structured due:/by: prefixes, and natural language relative phrases in a single pass, timezone-aware for Europe/Helsinki
  • Deduplication guard: The security monitor checks for open alert tasks before creating new ones, so your Planner bucket stays clean across repeated weekly runs
  • Poison Pill Guard: Catches silent node failures after each email is processed without crashing the batch loop, failed emails are flagged, not lost
  • Continue on Fail throughout: A Teams API failure does not prevent the Planner task from being created or the email from being marked read
  • Global error handling: A dedicated Error Trigger catches any catastrophic workflow failure and sends a structured HTML alert email via Graph API with execution ID, failed node name, and timestamp

Setup

  1. Credentials: Connect your Microsoft Graph OAuth2 credential to all nodes (covers Outlook, Planner, and Teams)
  2. Workflow variables: Set the following in the n8n Variables panel:
  • PLANNER_PLAN_ID
  • PLANNER_BUCKET_ID
  • TASK_ASSIGNEE_USER_ID
  • TEAMS_TEAM_ID
  • TEAMS_CHANNEL_ID
  • MONITORED_MAILBOX (UPN of the Outlook mailbox to scan)
  • ACTION_KEYWORDS (comma-separated, defaults to: ACTION REQUIRED,URGENT,TASK:,PLEASE REVIEW,CRITICAL)
  1. Error alert: Update the recipient address in the Send Error Notification Email node ([email protected])
  2. Timezone: Set the REPORT_TIMEZONE environment variable if your team is not in Europe/Helsinki (defaults to Europe/Helsinki)
  3. Graph API permissions: Ensure your registered Azure App has Mail.ReadWrite, Tasks.ReadWrite, ChannelMessage.Send, and SecurityEvents.Read.All
  4. Activate: Turn the workflow on Pipeline 1 starts on the next 30-minute interval, Pipeline 2 fires the following Monday at 08:00

Who this is for

  • IT Operations teams managing a Microsoft 365 environment who want action emails automatically converted to tracked tasks without manual triage
  • IT managers and security leads who need a weekly automated check on tenant security posture without logging into Defender every Monday
  • MSPs and internal IT departments looking to standardize ITSM intake through email without deploying a full helpdesk platform
  • Small and mid-size teams that live in Microsoft 365 and want automation that stays entirely within the M365 ecosystem

Required credentials

  • Microsoft Graph OAuth2 (covers all M365 nodes: Outlook, Planner, Teams)

Required Graph API permissions

Mail.ReadWrite Tasks.ReadWrite ChannelMessage.Send SecurityEvents.Read.All


How to customize it

  • Change the keyword list: Update the ACTION_KEYWORDS workflow variable to match your team's exact email language no code changes needed
  • Adjust the security threshold: Change the 80% threshold in the Is Score Below 80%? node to match your organization's compliance baseline
  • Add more task destinations: Fan out from Keyword Match Found? to also create Jira tickets, ServiceNow incidents, or send a dedicated Slack message
  • Extend the date parser: Add additional relative phrase patterns to the Extract Task from Email code node to handle phrases like "next week" or "end of month"
  • Change the schedule: Modify the trigger intervals run the email parser every 15 minutes for high-volume inboxes, or shift the security check to Friday afternoons

1.2 Logical Blocks

This catalog entry is organized from the workflow JSON. The node-level section below shows the executable blocks available for review before importing the template.

2. Block-by-Block Analysis

Block 1 - Every 30 Minutes

Type / Role
n8n-nodes-base.scheduleTrigger - scheduleTrigger
Config choices
Version 1.2

Block 2 - Get Unread Emails

Type / Role
n8n-nodes-base.microsoftOutlook - microsoftOutlook
Config choices
Version 2

Block 3 - Any Emails?

Type / Role
n8n-nodes-base.if - if
Config choices
Version 2

Block 4 - No New Emails

Type / Role
n8n-nodes-base.noOp - noOp
Config choices
Version 1

Block 5 - One Email at a Time

Type / Role
n8n-nodes-base.splitInBatches - splitInBatches
Config choices
Version 3

Block 6 - Extract Task from Email

Type / Role
n8n-nodes-base.code - code
Config choices
Version 2

Block 7 - Keyword Match Found?

Type / Role
n8n-nodes-base.if - if
Config choices
Version 2

Block 8 - Create Planner Task

Type / Role
n8n-nodes-base.httpRequest - httpRequest
Config choices
Version 4.2

Block 9 - Set Task Details (Notes)

Type / Role
n8n-nodes-base.httpRequest - httpRequest
Config choices
Version 4.2

Block 10 - Post Teams Notification

Type / Role
n8n-nodes-base.microsoftTeams - microsoftTeams
Config choices
Version 1

Block 11 - Reply, Categorize & Mark Read

Type / Role
n8n-nodes-base.microsoftOutlook - microsoftOutlook
Config choices
Version 2

Block 12 - Mark as Read After Reply

Type / Role
n8n-nodes-base.microsoftOutlook - microsoftOutlook
Config choices
Version 2

Block 13 - Done (Email Processed)

Type / Role
n8n-nodes-base.noOp - noOp
Config choices
Version 1

Block 14 - Error Capture (Poison Pill Guard)

Type / Role
n8n-nodes-base.code - code
Config choices
Version 2

Block 15 - Had Error?

Type / Role
n8n-nodes-base.if - if
Config choices
Version 2

Block 16 - Mark as Read (No Action)

Type / Role
n8n-nodes-base.microsoftOutlook - microsoftOutlook
Config choices
Version 2

Block 17 - API Rate Limit Throttle

Type / Role
n8n-nodes-base.wait - wait
Config choices
Version 1

Block 18 - Workflow Error Trigger

Type / Role
n8n-nodes-base.errorTrigger - errorTrigger
Config choices
Version 1

Block 19 - Send Error Notification Email

Type / Role
n8n-nodes-base.httpRequest - httpRequest
Config choices
Version 4.2

Block 20 - Every Monday at 8AM

Type / Role
n8n-nodes-base.scheduleTrigger - scheduleTrigger
Config choices
Version 1.2

Block 21 - Get Latest Secure Score

Type / Role
n8n-nodes-base.httpRequest - httpRequest
Config choices
Version 4.2

Block 22 - Calculate Security Score Percentage

Type / Role
n8n-nodes-base.code - code
Config choices
Version 2

Block 23 - Is Score Below 80%?

Type / Role
n8n-nodes-base.if - if
Config choices
Version 2

Block 24 - Create Security Planner Task

Type / Role
n8n-nodes-base.httpRequest - httpRequest
Config choices
Version 4.2

Showing the first 24 of 42 workflow blocks. Download the JSON for the full node graph.

3. Summary Table

Workflow Convert Outlook emails to Planner tasks and monitor Secure Score with Teams alerts in M365
Complexity advanced
Nodes 42
Categories Ticket Management, AI Summarization
Author Mychel Garzon
Published 18 May 2026

4. Reproducing the Workflow from Scratch

  1. 1. Download the workflow JSON

    Use the JSON export at /data/workflows/15797/15797.json as the source template for this automation.

  2. 2. Import the template into n8n

    Open n8n, import the downloaded JSON, and review each node before activating the workflow.

  3. 3. Configure credentials and variables

    Replace placeholder credentials, API keys, webhook URLs, account IDs, and environment-specific values with your own settings.

  4. 4. Test with sample data

    Run the workflow manually or in a staging workspace, inspect node output, and confirm downstream systems receive the expected data.

  5. 5. Activate and monitor

    Enable the workflow only after testing, then monitor executions, errors, and rate limits during the first production runs.

5. General Notes & Resources

Review imported nodes carefully before activation. This catalog entry is intended to help you inspect the workflow structure, understand required services, and find related templates faster.

Node names, credentials, schedules, webhook paths, and external service limits may need adjustment for your workspace.

Frequently asked questions

What does Convert Outlook emails to Planner tasks and monitor Secure Score with Teams alerts in M365 do?

Keep your IT operations moving, every action email becomes a tracked task, and every security alert lands where it belongs, automatically. Every IT team deals with the same two problems: important ...

What do I need before importing this workflow?

Review the workflow JSON, configure any required credentials in n8n, and test the automation in a safe workspace before using it in production.

Can I customize this workflow?

Yes. Use the block-by-block analysis and the downloadable JSON to inspect each node, then adjust credentials, prompts, schedules, filters, or destinations for your Ticket Management, AI Summarization use case.