{
  "name": "Generate stale page reports for Confluence spaces with REST API v1 and v2",
  "nodes": [
    {
      "id": "86a3fab8-8a58-486b-a6bd-410fe3227d46",
      "name": "When clicking ‘Execute workflow’",
      "type": "n8n-nodes-base.manualTrigger",
      "position": [
        -800,
        -272
      ]
    },
    {
      "id": "aeabbb6d-18eb-4165-9de2-a49ad7a88cae",
      "name": "Set Variables",
      "type": "n8n-nodes-base.set",
      "position": [
        -576,
        -272
      ]
    },
    {
      "id": "01d2e5be-51e6-4875-ae2f-9263c0a54c01",
      "name": "Confluence - Get Spaces",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -64,
        -144
      ]
    },
    {
      "id": "f6ae755d-ca03-4667-94c1-ba477e3834d1",
      "name": "Format Space Ids",
      "type": "n8n-nodes-base.set",
      "position": [
        160,
        -144
      ]
    },
    {
      "id": "1b57be44-b8e8-4fe8-b8a0-75a83f2df4bb",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -160,
        -208
      ],
      "parameters": {
        "width": 1376,
        "height": 240,
        "content": "## Confluence API v2"
      }
    },
    {
      "id": "b94622d4-d90c-4058-854f-21d53d15b672",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -160,
        -464
      ],
      "parameters": {
        "width": 1376,
        "height": 240,
        "content": "## Confluence API v1"
      }
    },
    {
      "id": "9e5b51a5-5bdd-4fbf-88f5-826f327e014c",
      "name": "Confluence - Get Outdated Spaces via CQL",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -64,
        -400
      ]
    },
    {
      "id": "7a114039-4852-4d46-8cbe-086cf5f1be72",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -160,
        -608
      ],
      "parameters": {
        "width": 352,
        "height": 128,
        "content": "## Confluence API Reference\n* [V1 CQL Search](https://developer.atlassian.com/cloud/confluence/rest/v1/api-group-search/#api-wiki-rest-api-search-get)\n* [V2 Get Spaces](https://developer.atlassian.com"
      }
    },
    {
      "id": "ec8e82bc-326b-403b-a383-ddc818edcd55",
      "name": "Filter Version by cutoffDate",
      "type": "n8n-nodes-base.filter",
      "position": [
        832,
        -144
      ]
    },
    {
      "id": "c3c963f4-09e2-460b-bbc3-6692c36ef8bf",
      "name": "Switch API Version",
      "type": "n8n-nodes-base.switch",
      "position": [
        -352,
        -272
      ]
    },
    {
      "id": "57da6622-eecd-4978-9c87-a434d843764e",
      "name": "Set Report Data V2",
      "type": "n8n-nodes-base.set",
      "position": [
        1056,
        -144
      ]
    },
    {
      "id": "92190adf-9303-44bd-9503-3cbc7ca13d89",
      "name": "Set Report Data V1",
      "type": "n8n-nodes-base.set",
      "position": [
        1056,
        -400
      ]
    },
    {
      "id": "eb9b413f-bf6d-462e-b50c-8f7347d1f7e2",
      "name": "Split Out Pages V1",
      "type": "n8n-nodes-base.splitOut",
      "position": [
        160,
        -400
      ]
    },
    {
      "id": "0080113f-8918-4880-8f83-849c00686d33",
      "name": "Split Out Pages V2",
      "type": "n8n-nodes-base.splitOut",
      "position": [
        608,
        -144
      ]
    },
    {
      "id": "970001e9-438d-46ac-a7a0-f2fa0cac6364",
      "name": "Aggregate",
      "type": "n8n-nodes-base.aggregate",
      "position": [
        1376,
        -272
      ]
    },
    {
      "id": "20ead0de-fc37-4076-aa04-3f56ef8bb836",
      "name": "Confluence - Get Pages",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        384,
        -144
      ]
    },
    {
      "id": "51459632-b9ac-4948-9173-314b110f6d32",
      "name": "Sticky Note6",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1632,
        -64
      ],
      "parameters": {
        "width": 768,
        "height": 224,
        "content": "### Notes\n- API v2 is preferred and future-proof; v1 exists for legacy compatibility.\n- Pagination limits are set to 50 items per request — increase if needed.\n- If results are empty:\n  - Verify space"
      }
    },
    {
      "id": "a1f68570-063b-4964-b455-812a8560362b",
      "name": "Sticky Note7",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1632,
        -608
      ],
      "parameters": {
        "width": 768,
        "height": 528,
        "content": "## How it works\nThis workflow identifies stale Confluence pages based on last modification date. A **Set Variables** node defines the core inputs: your Atlassian domain, target space keys, an age thre"
      }
    }
  ],
  "connections": {
    "Set Variables": {
      "main": [
        [
          {
            "node": "Switch API Version",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Format Space Ids": {
      "main": [
        [
          {
            "node": "Confluence - Get Pages",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Set Report Data V1": {
      "main": [
        [
          {
            "node": "Aggregate",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Set Report Data V2": {
      "main": [
        [
          {
            "node": "Aggregate",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Split Out Pages V1": {
      "main": [
        [
          {
            "node": "Set Report Data V1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Split Out Pages V2": {
      "main": [
        [
          {
            "node": "Filter Version by cutoffDate",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Switch API Version": {
      "main": [
        [
          {
            "node": "Confluence - Get Outdated Spaces via CQL",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Confluence - Get Spaces",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Confluence - Get Pages": {
      "main": [
        [
          {
            "node": "Split Out Pages V2",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Confluence - Get Spaces": {
      "main": [
        [
          {
            "node": "Format Space Ids",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Filter Version by cutoffDate": {
      "main": [
        [
          {
            "node": "Set Report Data V2",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "When clicking ‘Execute workflow’": {
      "main": [
        [
          {
            "node": "Set Variables",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Confluence - Get Outdated Spaces via CQL": {
      "main": [
        [
          {
            "node": "Split Out Pages V1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}