{
  "name": "Email reports on expiring Microsoft Entra ID app secrets and certificates with Microsoft Graph",
  "nodes": [
    {
      "id": "c032ba4b-6ad9-4aaf-9336-7023d25710be",
      "name": "When clicking ‘Execute workflow’",
      "type": "n8n-nodes-base.manualTrigger",
      "position": [
        -208,
        16
      ]
    },
    {
      "id": "f6886b67-bdcd-42fa-8b28-38d232fa91ae",
      "name": "Split Out Applications",
      "type": "n8n-nodes-base.splitOut",
      "position": [
        464,
        16
      ]
    },
    {
      "id": "0648ee8a-90d8-42f0-a79e-29ec3d37f2c9",
      "name": "Set Variables",
      "type": "n8n-nodes-base.set",
      "position": [
        16,
        16
      ]
    },
    {
      "id": "e9617bcf-8764-4f8f-9f7d-37f3be8a38d3",
      "name": "Merge",
      "type": "n8n-nodes-base.merge",
      "position": [
        1360,
        16
      ]
    },
    {
      "id": "1239f798-30b5-4da3-a2eb-cee7f25a676e",
      "name": "Filter Client Secrets",
      "type": "n8n-nodes-base.filter",
      "position": [
        912,
        -80
      ]
    },
    {
      "id": "d9f6dfd9-07b3-4ff5-bef3-1501a27f26eb",
      "name": "Split Out Client Secrets",
      "type": "n8n-nodes-base.splitOut",
      "position": [
        688,
        -80
      ]
    },
    {
      "id": "02b33d87-3e06-4c10-afec-584b826645c1",
      "name": "Split Out Certificates",
      "type": "n8n-nodes-base.splitOut",
      "position": [
        688,
        112
      ]
    },
    {
      "id": "e5e91f10-cbeb-44b9-a89a-a4778afdcdf6",
      "name": "Filter Client Certificates",
      "type": "n8n-nodes-base.filter",
      "position": [
        912,
        112
      ]
    },
    {
      "id": "219314a0-9ce8-4352-b6be-3ffb92f52362",
      "name": "Build Client Secrets Report",
      "type": "n8n-nodes-base.set",
      "position": [
        1136,
        -80
      ]
    },
    {
      "id": "b603c3e5-0027-48b3-8ca7-fcd82d133657",
      "name": "Build Certificates Report",
      "type": "n8n-nodes-base.set",
      "position": [
        1136,
        112
      ]
    },
    {
      "id": "d6b1957d-2216-414a-94cf-e1da38d3f517",
      "name": "Get EntraID Applications and Secrets",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        240,
        16
      ]
    },
    {
      "id": "6e3ff7b9-174a-44fd-8f94-c5a262b0894b",
      "name": "Aggregate",
      "type": "n8n-nodes-base.aggregate",
      "position": [
        1584,
        16
      ]
    },
    {
      "id": "8d7fe566-f4ce-4c15-a45b-4c7171398bfe",
      "name": "If Expiring Secrets not empty",
      "type": "n8n-nodes-base.if",
      "position": [
        1792,
        16
      ]
    },
    {
      "id": "073c5d14-3bbe-427e-a6eb-7343071ef45a",
      "name": "No Operation, do nothing",
      "type": "n8n-nodes-base.noOp",
      "position": [
        2016,
        112
      ]
    },
    {
      "id": "11d6a960-44de-44bf-8002-2f001e3d6b19",
      "name": "HTML Table with Expiring Secrets",
      "type": "n8n-nodes-base.html",
      "position": [
        2016,
        -80
      ]
    },
    {
      "id": "87ad3402-890e-4356-bff0-5a121cf6dcc2",
      "name": "Send email",
      "type": "n8n-nodes-base.emailSend",
      "position": [
        2224,
        -80
      ]
    },
    {
      "id": "86d429d5-168c-4f08-bec5-09a24fc5bde9",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -880,
        -128
      ],
      "parameters": {
        "width": 608,
        "height": 368,
        "content": "## How it works\n1. Fetches all Entra ID applications and their credential metadata via Microsoft Graph  \n2. Separates client secrets and certificates into individual entries  \n3. Filters entries that "
      }
    },
    {
      "id": "9f166c9c-8eaa-45e5-b647-418b6ea0c946",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        624,
        -160
      ],
      "parameters": {
        "width": 672,
        "height": 432,
        "content": "## Filter expiring secrets"
      }
    },
    {
      "id": "c38ec327-7ead-4c78-93ba-8a02cfeca86b",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1568,
        -160
      ],
      "parameters": {
        "width": 832,
        "height": 432,
        "content": "## Report\nBuild the report as an HTML table and send it via mail"
      }
    },
    {
      "id": "34dba612-3b2d-4342-9897-760dfb651c3f",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -48,
        -48
      ],
      "parameters": {
        "width": 224,
        "height": 224,
        "content": "## Variables"
      }
    },
    {
      "id": "d682d2a0-d5b6-498a-996f-c2a6fc3ab0e5",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        176,
        -64
      ],
      "parameters": {
        "width": 448,
        "height": 272,
        "content": "## Get EntraID Applications"
      }
    },
    {
      "id": "35e3d142-ad5b-4554-a76a-3aa6f6f21aa4",
      "name": "Sticky Note6",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -880,
        256
      ],
      "parameters": {
        "width": 608,
        "height": 144,
        "content": "### Notes\n- Requires EntraID Application\n- Use Client Credentials when adding the OAuth2 credentials in n8n\n- Use a schedule trigger to automatically run this\n- Need help? ✉️ **office@sus-tech.at**"
      }
    }
  ],
  "connections": {
    "Merge": {
      "main": [
        [
          {
            "node": "Aggregate",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Aggregate": {
      "main": [
        [
          {
            "node": "If Expiring Secrets not empty",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Set Variables": {
      "main": [
        [
          {
            "node": "Get EntraID Applications and Secrets",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Filter Client Secrets": {
      "main": [
        [
          {
            "node": "Build Client Secrets Report",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Split Out Applications": {
      "main": [
        [
          {
            "node": "Split Out Client Secrets",
            "type": "main",
            "index": 0
          },
          {
            "node": "Split Out Certificates",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Split Out Certificates": {
      "main": [
        [
          {
            "node": "Filter Client Certificates",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Split Out Client Secrets": {
      "main": [
        [
          {
            "node": "Filter Client Secrets",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Build Certificates Report": {
      "main": [
        [
          {
            "node": "Merge",
            "type": "main",
            "index": 1
          }
        ]
      ]
    },
    "Filter Client Certificates": {
      "main": [
        [
          {
            "node": "Build Certificates Report",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Build Client Secrets Report": {
      "main": [
        [
          {
            "node": "Merge",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "If Expiring Secrets not empty": {
      "main": [
        [
          {
            "node": "HTML Table with Expiring Secrets",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "No Operation, do nothing",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "HTML Table with Expiring Secrets": {
      "main": [
        [
          {
            "node": "Send email",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get EntraID Applications and Secrets": {
      "main": [
        [
          {
            "node": "Split Out Applications",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "When clicking ‘Execute workflow’": {
      "main": [
        [
          {
            "node": "Set Variables",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}