{
  "name": "TeamRetro: Weekly overdue actions digest",
  "nodes": [
    {
      "id": "tr0400-0000-0000-0000-000000000001",
      "name": "Setup",
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        -60,
        40
      ],
      "parameters": {
        "width": 460,
        "height": 320,
        "color": 4,
        "content": "## Setup\n\n**API key:** team-scoped (`trt_`) returns that one team; account-scoped (`tra_`) covers every team in the account.\n\n1. Pick your TeamRetro credential on **Get Overdue Actions**.\n2. Optional: add a **Team IDs** or **Team Tags** filter on that node to narrow the digest.\n3. Pick the Slack channel.\n4. Adjust the schedule (default: Mondays 09:00), then **activate**.\n\nNo webhook needed \u2014 this one is pure API polling on a timer."
      }
    },
    {
      "id": "tr0400-0000-0000-0000-000000000002",
      "name": "Every Monday 9am",
      "type": "n8n-nodes-base.scheduleTrigger",
      "typeVersion": 1.2,
      "position": [
        460,
        160
      ],
      "parameters": {
        "rule": {
          "interval": [
            {
              "field": "weeks",
              "weeksInterval": 1,
              "triggerAtDay": [
                1
              ],
              "triggerAtHour": 9,
              "triggerAtMinute": 0
            }
          ]
        }
      }
    },
    {
      "id": "tr0400-0000-0000-0000-000000000003",
      "name": "Get Overdue Actions",
      "type": "n8n-nodes-teamretro.teamRetro",
      "typeVersion": 1,
      "position": [
        700,
        160
      ],
      "parameters": {
        "resource": "action",
        "operation": "getAll",
        "returnAll": true,
        "filters": {
          "actionOverdue": true,
          "actionStatus": "accepted",
          "sort": "date"
        }
      }
    },
    {
      "id": "tr0400-0000-0000-0000-000000000004",
      "name": "Build Digest",
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        940,
        160
      ],
      "parameters": {
        "jsCode": "// One Slack message for the whole list, oldest due date first.\nconst actions = $input.all().map((i) => i.json).filter((a) => a && a.title);\n\nif (actions.length === 0) {\n  return [{ json: { text: ':white_check_mark: No overdue TeamRetro actions this week. Nice work!' } }];\n}\n\nconst lines = actions.map((a) => {\n  const owners = (a.assignedTo || []).map((u) => u.name || u.email).join(', ') || 'unassigned';\n  const team = a.team ? a.team.name : 'unknown team';\n  return `\u2022 *${a.title}* \u2014 ${owners} \u00b7 ${team} \u00b7 due ${a.due || 'n/a'}`;\n});\n\nreturn [{ json: { text: `:rotating_light: *${actions.length} overdue TeamRetro action(s)*\\n${lines.join('\\n')}` } }];"
      }
    },
    {
      "id": "tr0400-0000-0000-0000-000000000005",
      "name": "Post to Slack",
      "type": "n8n-nodes-base.slack",
      "typeVersion": 2.3,
      "position": [
        1180,
        160
      ],
      "parameters": {
        "select": "channel",
        "channelId": {
          "__rl": true,
          "mode": "name",
          "value": "#team-actions"
        },
        "text": "={{ $json.text }}",
        "otherOptions": {}
      }
    }
  ],
  "connections": {
    "Every Monday 9am": {
      "main": [
        [
          {
            "node": "Get Overdue Actions",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Overdue Actions": {
      "main": [
        [
          {
            "node": "Build Digest",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Build Digest": {
      "main": [
        [
          {
            "node": "Post to Slack",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "settings": {
    "executionOrder": "v1"
  }
}