Kaffeeundcode
n8n Flow-Bibliothek
n8n Workflow 01.06.2026

Flow Arbeitsbereich

Policy Conflict Repo

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

Workflow Diagramm

auto-generiert
graph LR
    N0(["⚡ Weekly Conflict Scan"])
    N1["🔧 Get Config Policies"]
    N2["🔧 Filter Conflicts"]
    N3{"🔀 If Conflicts Exist"}
    N4["🔧 Save to File"]
    N5["🔧 Notify Admin"]
    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

10_Policy_Conflict_Repo.json

{
    "name": "10_Policy_Conflict_Repo",
    "nodes": [
        {
            "parameters": {
                "rule": {
                    "interval": [
                        {
                            "field": "weeks",
                            "triggerAtDay": 1,
                            "triggerAtHour": 6
                        }
                    ]
                }
            },
            "name": "Weekly Conflict Scan",
            "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/deviceConfigurations?$expand=deviceStatusOverview",
                "options": {}
            },
            "name": "Get Config Policies",
            "type": "n8n-nodes-base.httpRequest",
            "typeVersion": 3,
            "position": [
                450,
                300
            ],
            "credentials": {
                "microsoftGraphOAuth2Api": {
                    "id": "YOUR_CREDENTIAL_ID",
                    "name": "Microsoft Graph Account"
                }
            }
        },
        {
            "parameters": {
                "functionCode": "const policies = items[0].json.value;nconst conflicts = policies.filter(p => p.deviceStatusOverview.conflictCount > 0);nnif (conflicts.length === 0) return [];nnconst report = conflicts.map(c => `Policy '${c.displayName}' has ${c.deviceStatusOverview.conflictCount} conflicts.`).join('\n');nreturn [{ json: { report, count: conflicts.length } }];"
            },
            "name": "Filter Conflicts",
            "type": "n8n-nodes-base.function",
            "typeVersion": 1,
            "position": [
                650,
                300
            ]
        },
        {
            "parameters": {
                "conditions": {
                    "number": [
                        {
                            "value1": "={{ $json.count }}",
                            "operation": "larger",
                            "value2": 0
                        }
                    ]
                }
            },
            "name": "If Conflicts Exist",
            "type": "n8n-nodes-base.if",
            "typeVersion": 1,
            "position": [
                850,
                300
            ]
        },
        {
            "parameters": {
                "content": "=**Intune Policy Conflicts Detected**nn{{ $json.report }}",
                "options": {}
            },
            "name": "Save to File",
            "type": "n8n-nodes-base.writeBinaryFile",
            "typeVersion": 1,
            "position": [
                1050,
                200
            ]
        },
        {
            "parameters": {
                "resource": "chat",
                "message": "=⚠️ Detected {{ $json.count }} policies with conflicts. Please check the report."
            },
            "name": "Notify Admin",
            "type": "n8n-nodes-base.microsoftTeams",
            "typeVersion": 1,
            "position": [
                1050,
                400
            ]
        }
    ],
    "connections": {
        "Weekly Conflict Scan": {
            "main": [
                [
                    {
                        "node": "Get Config Policies",
                        "type": "main",
                        "index": 0
                    }
                ]
            ]
        },
        "Get Config Policies": {
            "main": [
                [
                    {
                        "node": "Filter Conflicts",
                        "type": "main",
                        "index": 0
                    }
                ]
            ]
        },
        "Filter Conflicts": {
            "main": [
                [
                    {
                        "node": "If Conflicts Exist",
                        "type": "main",
                        "index": 0
                    }
                ]
            ]
        },
        "If Conflicts Exist": {
            "main": [
                [
                    {
                        "node": "Save to File",
                        "type": "main",
                        "index": 0
                    },
                    {
                        "node": "Notify Admin",
                        "type": "main",
                        "index": 0
                    }
                ]
            ]
        }
    }
}