Templates / Optimize inactive Microsoft 365 premium licenses with Graph and Teams

Optimize inactive Microsoft 365 premium licenses with Graph and Teams

Needs changes

by Mychel Garzon ✓ · 47 views · created 2026-06-04 · CRM

Needs changes. This template uses 1 thing(s) that n8n 3.0 removes: Item Lists (legacy). 1 breaking item(s) found. Static check, last run 2026-12-01.

📬 Weekly n8n 3.0 breakage alerts, free

What this workflow does

This workflow has 26 nodes and runs on a schedule (cron 0 6 1 * *). Along the way it connects Microsoft Teams. It also calls graph.microsoft.com over HTTP.

How it runs

Trigger: On a schedule (cron 0 6 1 * *).

  1. Set Configuration Parameters (Edit Fields (Set)): sets 10 fields: premiumSkuPartNumbers, baselineSkuId, inactivityThresholdDays…
  2. Validate Configuration (Code): runs custom JavaScript code
  3. Fetch Subscribed SKUs (HTTP Request): calls graph.microsoft.com
  4. Generate Premium SKU Map (Code): runs custom JavaScript code
  5. Retrieve Exemption Group Members (HTTP Request): calls an HTTP API
  6. Compile Exemption List (Item Lists): reshapes item lists (legacy Item Lists node)
  7. Fetch All Licensed Users (Code): runs custom JavaScript code
  8. Filter Inactive Premium Members (Code): runs custom JavaScript code
  9. Check Downgradable Users (If): checks a condition and branches into true / false
  10. Divide Downgrade Plan (Code): runs custom JavaScript code

…plus 12 more steps. See the full node list below.

Services it uses

Microsoft Teams

HTTP calls to: graph.microsoft.com

Before you upgrade to n8n 3.0

1 thing in this workflow is removed in n8n 3.0. Fix it before you upgrade:

  • Item Lists (legacy) in Compile Exemption List, Gather Downgrade Results: replace with Split Out, Aggregate, Sort, Limit, Remove Duplicates or Summarize (match the operation used).

Rather not rewrite it? Many of these flows can be rebuilt in Make (free plan).

Published 2026 — 6% of 2026 templates need changes for 3.0. See how template age affects 3.0 readiness →

Check at runtime on n8n 3.0
  • Code node: the task timeout drops from 300s to 60s. Test with a realistic data volume.
Informational: a static scan can't see the data, so test these on your own instance. Status above is unchanged.
Removed in 3.0Replace with
Item Lists (legacy)
Compile Exemption List, Gather Downgrade Results
Split Out, Aggregate, Sort, Limit, Remove Duplicates or Summarize (match the operation used)

Nodes used (10)

From the author

Quick overview This workflow runs monthly to audit Microsoft 365 licensing via Microsoft Graph, identifies inactive users holding premium SKUs (excluding an exemption group and recent hires), optionally downgrades them to a baseline license, and posts a…

Excerpt from Mychel Garzon's description on n8n.io.

View the original on n8n.io → Check your own copy

Get the weekly “what broke” email

New templates, newly broken ones, and n8n release changes. One short email a week.

Form not loading? Subscribe here.