{
  "name": "VESPERA - Daily Project Brief",
  "nodes": [
    {
      "id": "a1b2c3d4-0001-4000-8000-000000000001",
      "name": "Schedule Trigger",
      "type": "n8n-nodes-base.scheduleTrigger",
      "typeVersion": 1.1,
      "position": [
        0,
        300
      ],
      "parameters": {
        "rule": {
          "interval": [
            {
              "field": "days",
              "daysInterval": 1,
              "triggerAtHour": 8,
              "triggerAtMinute": 0
            }
          ]
        }
      }
    },
    {
      "id": "a1b2c3d4-0002-4000-8000-000000000002",
      "name": "Read Approval Queue",
      "type": "n8n-nodes-base.readBinaryFile",
      "typeVersion": 1,
      "position": [
        220,
        300
      ],
      "parameters": {
        "filePath": "C:/Users/pro/ObsidianVaults/VESPERA_Vault/APPROVAL_QUEUE.md",
        "dataPropertyName": "data"
      }
    },
    {
      "id": "a1b2c3d4-0003-4000-8000-000000000003",
      "name": "Read Audit Log",
      "type": "n8n-nodes-base.readBinaryFile",
      "typeVersion": 1,
      "position": [
        440,
        300
      ],
      "parameters": {
        "filePath": "C:/Users/pro/ObsidianVaults/VESPERA_Vault/AUDIT_LOG.md",
        "dataPropertyName": "data"
      }
    },
    {
      "id": "a1b2c3d4-0004-4000-8000-000000000004",
      "name": "Build Daily Brief",
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        660,
        300
      ],
      "parameters": {
        "jsCode": "const now = new Date();\nconst pad = (n) => String(n).padStart(2, '0');\nconst dateStr = `${now.getFullYear()}-${pad(now.getMonth()+1)}-${pad(now.getDate())}`;\nconst dateCompact = dateStr.replace(/-/g, '');\n\n// APPROVAL_QUEUE.md \u2014 Read Approval Queue \ub178\ub4dc\uc5d0\uc11c \ucc38\uc870\nlet approvalContent = '(file not found)';\ntry {\n  const buf = await this.helpers.getBinaryDataBuffer(\n    $('Read Approval Queue').first(), 'data'\n  );\n  approvalContent = buf.toString('utf-8');\n} catch(e) { approvalContent = `(read error: ${e.message})`; }\n\n// AUDIT_LOG.md \u2014 \ud604\uc7ac \uc544\uc774\ud15c (Read Audit Log \uc9c1\ud6c4)\nlet auditContent = '(file not found)';\ntry {\n  const buf = await this.helpers.getBinaryDataBuffer(items[0], 'data');\n  auditContent = buf.toString('utf-8');\n} catch(e) { auditContent = `(read error: ${e.message})`; }\n\n// Pending \ud56d\ubaa9 \ucd94\ucd9c\nconst pendingRows = approvalContent\n  .split('\\n')\n  .filter(l => l.trim().startsWith('|') && l.includes('Pending'))\n  .join('\\n') || '(\uc5c6\uc74c)';\n\n// \ucd5c\uadfc Audit 3\uc904\nconst auditRows = auditContent\n  .split('\\n')\n  .filter(l => l.trim().startsWith('|') && !l.includes('---') && !l.includes('Timestamp'))\n  .slice(-3)\n  .join('\\n') || '(\uc5c6\uc74c)';\n\nconst content = [\n  '---',\n  'type: daily_brief',\n  `date: ${dateStr}`,\n  '---',\n  `# Daily Brief - ${dateStr}`,\n  '',\n  '## Approval Queue',\n  pendingRows,\n  '',\n  '## Recent Audit',\n  auditRows,\n  '',\n  \"## Today's Focus\",\n  '- [ ] ',\n  ''\n].join('\\n');\n\nconst fileName = `${dateCompact}_daily_brief.md`;\n\nconst binaryData = await this.helpers.prepareBinaryData(\n  Buffer.from(content, 'utf-8'),\n  fileName,\n  'text/markdown'\n);\n\nreturn [{ json: { content, filename: fileName }, binary: { brief: binaryData } }];"
      }
    },
    {
      "id": "a1b2c3d4-0005-4000-8000-000000000005",
      "name": "Write Daily Brief",
      "type": "n8n-nodes-base.writeBinaryFile",
      "typeVersion": 1,
      "position": [
        880,
        300
      ],
      "parameters": {
        "fileName": "=C:/Users/pro/ObsidianVaults/VESPERA_Vault/08_Daily_Brief/{{ $json.filename }}",
        "dataPropertyName": "brief"
      }
    }
  ],
  "connections": {
    "Schedule Trigger": {
      "main": [
        [
          {
            "node": "Read Approval Queue",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Read Approval Queue": {
      "main": [
        [
          {
            "node": "Read Audit Log",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Read Audit Log": {
      "main": [
        [
          {
            "node": "Build Daily Brief",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Build Daily Brief": {
      "main": [
        [
          {
            "node": "Write Daily Brief",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "active": false,
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "3",
  "meta": {
    "templateCredsSetupCompleted": true,
    "instanceName": "VESPERA"
  }
}