Kaffeeundcode
n8n Flow-Bibliothek
n8n Workflow 01.06.2026

Flow Arbeitsbereich

Intune Compliance Alert

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

Workflow Diagramm

auto-generiert
graph LR
    N0(["⚡ Schedule"])
    N1["🔧 Get NonCompliant Devices"]
    N2["🔧 Format Report"]
    N3{"🔀 If Devices Found"}
    N4["🔧 Send Teams Alert"]
    N5["🔧 No Action Needed"]
    N0 --> N1
    N1 --> N2
    N2 --> N3
    N3 --> N4
    N3 --> N5

    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 logic
    class N4 action
    class N5 action

01_Intune_Compliance_Alert.json

{
  "name": "01_Intune_Compliance_Alert",
  "nodes": [
    {
      "parameters": {
        "rule": {
          "interval": [
            {
              "field": "hours"
            }
          ]
        }
      },
      "name": "Schedule",
      "type": "n8n-nodes-base.schedule",
      "typeVersion": 1,
      "position": [
        250,
        300
      ]
    },
    {
      "parameters": {
        "authentication": "predefinedCredentialType",
        "nodeCredentialType": "microsoftGraphOAuth2Api",
        "requestMethod": "GET",
        "url": "https://graph.microsoft.com/v1.0/deviceManagement/managedDevices?$filter=complianceState eq 'nonCompliant'",
        "options": {}
      },
      "name": "Get NonCompliant Devices",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 3,
      "position": [
        450,
        300
      ],
      "credentials": {
        "microsoftGraphOAuth2Api": {
          "id": "YOUR_CREDENTIAL_ID",
          "name": "Microsoft Graph Account"
        }
      }
    },
    {
      "parameters": {
        "functionCode": "const devices = items[0].json.value;nconst summary = devices.map(d => `- ${d.deviceName} (${d.userPrincipalName}): ${d.complianceState}`).join('\n');nreturn [{ json: { summary, count: devices.length } }];"
      },
      "name": "Format Report",
      "type": "n8n-nodes-base.function",
      "typeVersion": 1,
      "position": [
        650,
        300
      ]
    },
    {
      "parameters": {
        "conditions": {
          "number": [
            {
              "value1": "={{ $json.count }}",
              "operation": "larger",
              "value2": 0
            }
          ]
        }
      },
      "name": "If Devices Found",
      "type": "n8n-nodes-base.if",
      "typeVersion": 1,
      "position": [
        850,
        300
      ]
    },
    {
      "parameters": {
        "resource": "chat",
        "message": "=⚠️ **Intune Compliance Alert** ⚠️nFound {{ $json.count }} non-compliant devices:nn{{ $json.summary }}"
      },
      "name": "Send Teams Alert",
      "type": "n8n-nodes-base.microsoftTeams",
      "typeVersion": 1,
      "position": [
        1050,
        200
      ]
    },
    {
      "parameters": {},
      "name": "No Action Needed",
      "type": "n8n-nodes-base.noOp",
      "typeVersion": 1,
      "position": [
        1050,
        400
      ]
    }
  ],
  "connections": {
    "Schedule": {
      "main": [
        [
          {
            "node": "Get NonCompliant Devices",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get NonCompliant Devices": {
      "main": [
        [
          {
            "node": "Format Report",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Format Report": {
      "main": [
        [
          {
            "node": "If Devices Found",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "If Devices Found": {
      "main": [
        [
          {
            "node": "Send Teams Alert",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "No Action Needed",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}