{
  "name": "Stage 2 — Weekly CR Queue Summary",
  "nodes": [
    {
      "parameters": {
        "rule": {
          "interval": [
            {
              "field": "weeks",
              "triggerAtDay": [1],
              "triggerAtHour": 9
            }
          ]
        }
      },
      "id": "schedule-trigger-001",
      "name": "Every Monday 9am",
      "type": "n8n-nodes-base.scheduleTrigger",
      "typeVersion": 1.2,
      "position": [240, 300]
    },
    {
      "parameters": {
        "method": "GET",
        "url": "https://script.google.com/macros/s/AKfycbwzD5uqhShk2HA9GNDtaaQngusRGo0zHk9vvSPCag8ANX0EUs6k6a5XhIu9q5N-D5tVXw/exec",
        "options": {}
      },
      "id": "http-get-001",
      "name": "Read Project Register",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [500, 300]
    },
    {
      "parameters": {
        "promptType": "define",
        "text": "=You are reviewing the project's Change Request register on behalf of the Project Manager. Below is the current register data.\n\nCR data:\n{{ JSON.stringify($json.crs) }}\n\nProduce a queue summary in plain text. No markdown, no asterisks, no hashtags. Use these exact visual conventions:\n- Section headers in ALL CAPS, surrounded by lines of tildes (~)\n- Two blank lines between sections\n- For lists, prefix each item with a dash and a space\n- Keep total length under 400 words\n\nUse exactly this structure:\n\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\nQUEUE OVERVIEW\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\nTotal: [N] change requests\nPriority: [N] High, [N] Medium, [N] Low\nImpact: [breakdown by impact type]\nDate range: [oldest to newest]\n\n\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\nWHAT NEEDS PM ATTENTION FIRST\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\n[2-3 CRs the PM should look at first. For each:]\n- [Submitter name, role]: [one-line description]. [One-line reason.]\n\n\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\nPATTERNS ACROSS THE QUEUE\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\n[2-3 patterns or themes worth noticing, including any conflicts between CRs. Each as a short paragraph.]\n\n\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\nNOISE OR DUPLICATES\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\n[Brief note on test entries or duplicates. If none, say \"No noise detected.\"]"
      },
      "id": "llm-chain-001",
      "name": "Summarize Queue",
      "type": "@n8n/n8n-nodes-langchain.chainLlm",
      "typeVersion": 1.5,
      "position": [780, 300]
    },
    {
      "parameters": {
        "model": {
          "__rl": true,
          "value": "claude-haiku-4-5",
          "mode": "list",
          "cachedResultName": "Claude Haiku 4.5"
        },
        "options": {}
      },
      "id": "anthropic-model-001",
      "name": "Anthropic Chat Model",
      "type": "@n8n/n8n-nodes-langchain.lmChatAnthropic",
      "typeVersion": 1.3,
      "position": [780, 500]
    },
    {
      "parameters": {
        "method": "POST",
        "url": "https://script.google.com/macros/s/AKfycbwzD5uqhShk2HA9GNDtaaQngusRGo0zHk9vvSPCag8ANX0EUs6k6a5XhIu9q5N-D5tVXw/exec",
        "sendBody": true,
        "specifyBody": "json",
        "jsonBody": "={\n  \"generated_at\": \"{{ DateTime.now().toFormat('yyyy-MM-dd HH:mm') }}\",\n  \"summary_text\": {{ JSON.stringify($json.text) }}\n}",
        "options": {}
      },
      "id": "http-post-001",
      "name": "Save Summary to Sheet",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [1060, 300]
    }
  ],
  "connections": {
    "Every Monday 9am": {
      "main": [
        [
          {
            "node": "Read Project Register",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Read Project Register": {
      "main": [
        [
          {
            "node": "Summarize Queue",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Anthropic Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "Summarize Queue",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Summarize Queue": {
      "main": [
        [
          {
            "node": "Save Summary to Sheet",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "settings": {
    "executionOrder": "v1"
  },
  "staticData": null,
  "meta": {
    "templateCredsSetupCompleted": false
  },
  "pinData": {}
}
