{
  "name": "Vorlux AI | Daily Standup Automation",
  "nodes": [
    {
      "id": "cea9d686-acc0-4f7b-b116-cb6b7819fbbd",
      "name": "Daily 9AM",
      "type": "n8n-nodes-base.scheduleTrigger",
      "typeVersion": 1.2,
      "position": [
        220,
        300
      ],
      "parameters": {
        "rule": {
          "interval": [
            {
              "field": "hours",
              "hoursInterval": 24
            }
          ]
        }
      }
    },
    {
      "id": "ff6aee4b-5b8a-4605-b71d-ecd66b48fb64",
      "name": "Fetch Teams",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        460,
        300
      ],
      "parameters": {
        "method": "GET",
        "url": "={{$env.VORLUX_HUB_URL}}/api/org/teams?active=true",
        "options": {
          "timeout": 15000
        }
      }
    },
    {
      "id": "e89146ca-2834-42f4-a3c9-d8e122382825",
      "name": "Build Standups",
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        700,
        300
      ],
      "parameters": {
        "mode": "runOnceForAllItems",
        "jsCode": "const teams = $input.first().json.data || [];const hubUrl = $env.VORLUX_HUB_URL || 'http://localhost:3010';const standups = [];for (const team of teams.slice(0, 10)) {try {const tasksRes = await fetch(hubUrl + '/api/tasks?team=' + team.id + '&status=in_progress&limit=10');const tasks = (await tasksRes.json()).data || [];const doneRes = await fetch(hubUrl + '/api/tasks?team=' + team.id + '&completed_since=24h&limit=10');const done = (await doneRes.json()).data || [];standups.push({team: team.name,done: done.slice(0,5).map(t => t.title),inProgress: tasks.slice(0,5).map(t => t.title + ' (' + (t.assignee?.name || '?') + ')'),blockers: tasks.filter(t => t.priority === 'critical').map(t => t.title)});} catch {}}return [{json: {standups, teamCount: standups.length}}];"
      },
      "notes": "Fetches tasks per team and builds standup summaries"
    },
    {
      "id": "5e88f8fd-9d0d-43a2-89c2-ec9fdb2dfe38",
      "name": "Post to Discord",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        940,
        200
      ],
      "parameters": {
        "method": "POST",
        "url": "={{$env.DISCORD_OPS_WEBHOOK}}",
        "sendBody": true,
        "specifyBody": "json",
        "jsonBody": "={\"embeds\":[{\"title\":\"\ud83d\udccb Daily Standup \u2014 {{ new Date().toISOString().split(\"T\")[0] }}\",\"description\":\"{{ $json.standups.map(s => \"**\" + s.team + \"**\\n\u2705 Done: \" + (s.done.length || 0) + \" | \ud83d\udd04 Active: \" + (s.inProgress.length || 0) + (s.blockers.length ? \" | \ud83d\udea8 Blockers: \" + s.blockers.length : \"\")).join(\"\\n\\n\") }}\",\"color\":5793266,\"footer\":{\"text\":\"{{ $json.teamCount }} teams reported\"}}]}",
        "options": {
          "timeout": 10000
        }
      }
    },
    {
      "id": "4c2c855b-4757-476d-af24-af177bfef39e",
      "name": "Save Summary",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        940,
        400
      ],
      "parameters": {
        "method": "POST",
        "url": "={{$env.VORLUX_HUB_URL}}/api/analytics/standup",
        "sendBody": true,
        "specifyBody": "json",
        "jsonBody": "={{ JSON.stringify($json) }}",
        "options": {
          "timeout": 10000
        }
      }
    }
  ],
  "connections": {
    "Daily 9AM": {
      "main": [
        [
          {
            "node": "Fetch Teams",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Fetch Teams": {
      "main": [
        [
          {
            "node": "Build Standups",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Build Standups": {
      "main": [
        [
          {
            "node": "Post to Discord",
            "type": "main",
            "index": 0
          },
          {
            "node": "Save Summary",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "settings": {
    "executionOrder": "v1",
    "saveManualExecutions": true,
    "saveExecutionProgress": true
  }
}