Kaffeeundcode
n8n Flow-Bibliothek
n8n Workflow 01.06.2026

Flow Arbeitsbereich

License Usage Alert

Flow prüfen, Nodes verstehen, JSON importieren und Credentials sauber anpassen.

Workflow Diagramm

auto-generiert
graph LR
    N0(["⚡ Daily Check"])
    N1["🔧 Get Licenses"]
    N2["🔧 Filter High Usage"]
    N3["🔧 Alert Procurement"]
    N0 --> N1
    N1 --> N2
    N2 --> N3

    classDef trigger fill:#f59e0b,stroke:#b45309,color:#000
    classDef action fill:#292524,stroke:#44403c,color:#e7e5e4
    classDef logic fill:#1e1b4b,stroke:#4338ca,color:#c7d2fe
    class N0 trigger
    class N1 action
    class N2 action
    class N3 action

22_License_Usage_Alert.json

{
    "name": "22_License_Usage_Alert",
    "nodes": [
        {
            "parameters": {
                "rule": {
                    "interval": [
                        {
                            "field": "days"
                        }
                    ]
                }
            },
            "name": "Daily Check",
            "type": "n8n-nodes-base.schedule",
            "typeVersion": 1,
            "position": [
                250,
                300
            ]
        },
        {
            "parameters": {
                "authentication": "predefinedCredentialType",
                "nodeCredentialType": "microsoftGraphOAuth2Api",
                "requestMethod": "GET",
                "url": "https://graph.microsoft.com/v1.0/subscribedSkus",
                "options": {}
            },
            "name": "Get Licenses",
            "type": "n8n-nodes-base.httpRequest",
            "typeVersion": 3,
            "position": [
                450,
                300
            ],
            "credentials": {
                "microsoftGraphOAuth2Api": {
                    "id": "YOUR_CREDENTIAL_ID",
                    "name": "Microsoft Graph Account"
                }
            }
        },
        {
            "parameters": {
                "functionCode": "const skus = items[0].json.value;nconst critical = skus.filter(sku => {n  if (sku.capabilityStatus !== 'Enabled') return false;n  const used = sku.consumedUnits;n  const total = sku.prepaidUnits.enabled;n  const ratio = used / total;n  sku.usagePercent = Math.round(ratio * 100);n  return ratio > 0.9;n});nnreturn [{ json: { count: critical.length, details: critical } }];"
            },
            "name": "Filter High Usage",
            "type": "n8n-nodes-base.function",
            "typeVersion": 1,
            "position": [
                650,
                300
            ]
        },
        {
            "parameters": {
                "resource": "chat",
                "message": "=⚠️ **License Crunch Alert**nThe following licenses are running low (>90% used):nn{{ $json.details.map(s => `- ${s.skuPartNumber}: ${s.consumedUnits}/${s.prepaidUnits.enabled} (${s.usagePercent}%)`).join('\n') }}"
            },
            "name": "Alert Procurement",
            "type": "n8n-nodes-base.microsoftTeams",
            "typeVersion": 1,
            "position": [
                850,
                300
            ]
        }
    ],
    "connections": {
        "Daily Check": {
            "main": [
                [
                    {
                        "node": "Get Licenses",
                        "type": "main",
                        "index": 0
                    }
                ]
            ]
        },
        "Get Licenses": {
            "main": [
                [
                    {
                        "node": "Filter High Usage",
                        "type": "main",
                        "index": 0
                    }
                ]
            ]
        },
        "Filter High Usage": {
            "main": [
                [
                    {
                        "node": "Alert Procurement",
                        "type": "main",
                        "index": 0
                    }
                ]
            ]
        }
    }
}