{
  "meta": {
    "templateCredsSetupCompleted": false
  },
  "name": "Check Due Reminders (Outlook + Telegram)",
  "nodes": [
    {
      "id": "f16b0b92-79ce-46fe-934d-b1d24268ef1a",
      "name": "\ud83d\udccb Setup & Operations",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -620,
        -504
      ],
      "parameters": {
        "color": 4,
        "width": 560,
        "height": 420,
        "content": "## Setup\n1. **Microsoft Outlook OAuth2** \u2192 pick calendar (`YOUR_OUTLOOK_CALENDAR_ID` or re-select in UI).\n2. **Telegram Bot API** \u2192 set `YOUR_TELEGRAM_GROUP_CHAT_ID` on all Telegram send nodes (not the Trello hub chat ID).\n3. Edit reminder message text and @mentions for your team.\n4. Schedule: **Trigger weekly** (default Monday)\u2014adjust in the Schedule Trigger.\n5. Calendar events should include a check identifier in the subject (workflow filters by subject pattern).\n\n## Operation\n- Weekly: lists Outlook events due today, tomorrow, and within the week \u2192 Telegram digest per window.\n\n## Credentials\nMicrosoft Outlook OAuth2 API, Telegram Bot API"
      },
      "typeVersion": 1
    },
    {
      "id": "87aed03f-c258-490b-b8ac-bee9ef9e9994",
      "name": "Get many events",
      "type": "n8n-nodes-base.microsoftOutlook",
      "position": [
        224,
        16
      ],
      "parameters": {
        "fields": [
          "subject",
          "start"
        ],
        "output": "fields",
        "filters": {},
        "resource": "event",
        "returnAll": true,
        "calendarId": {
          "__rl": true,
          "mode": "id",
          "value": "YOUR_OUTLOOK_CALENDAR_ID",
          "cachedResultName": "Calendar"
        },
        "fromAllCalendars": false
      },
      "credentials": {
        "microsoftOutlookOAuth2Api": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 2
    },
    {
      "id": "eef2f5c9-7577-47d8-8460-f33c7568696e",
      "name": "If item length is zero",
      "type": "n8n-nodes-base.if",
      "position": [
        672,
        16
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 3,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "b35e42a6-6a5f-45c1-953a-ac7a352703ad",
              "operator": {
                "type": "boolean",
                "operation": "true",
                "singleValue": true
              },
              "leftValue": "={{ Object.keys($items(\"Filter checks due this week\")[0].json).length === 0 }}",
              "rightValue": ""
            }
          ]
        }
      },
      "typeVersion": 2.3
    },
    {
      "id": "b4258999-105f-4158-a736-6317db88c354",
      "name": "Aggregate",
      "type": "n8n-nodes-base.aggregate",
      "position": [
        896,
        16
      ],
      "parameters": {
        "options": {},
        "fieldsToAggregate": {
          "fieldToAggregate": [
            {
              "fieldToAggregate": "subject"
            },
            {
              "fieldToAggregate": "start.dateTime"
            }
          ]
        }
      },
      "typeVersion": 1
    },
    {
      "id": "f9e74e97-5531-45b5-9db1-92fbd9fe117e",
      "name": "Trigger weekly on Sunday",
      "type": "n8n-nodes-base.scheduleTrigger",
      "position": [
        0,
        16
      ],
      "parameters": {
        "rule": {
          "interval": [
            {
              "field": "weeks",
              "triggerAtHour": 18
            }
          ]
        }
      },
      "typeVersion": 1.3
    },
    {
      "id": "fba5b726-103f-42d2-9a65-6293df97ef29",
      "name": "Filter checks due day before",
      "type": "n8n-nodes-base.filter",
      "position": [
        448,
        -224
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 3,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "0b04a4a5-0bae-459a-8112-57d4ac74c9f9",
              "operator": {
                "type": "dateTime",
                "operation": "before"
              },
              "leftValue": "={{ DateTime.fromISO($json.start.dateTime) }}",
              "rightValue": "={{ DateTime.now().plus({ hours: 24 }) }}"
            },
            {
              "id": "8dab4e08-0973-4705-869e-b5c813496fea",
              "operator": {
                "type": "dateTime",
                "operation": "after"
              },
              "leftValue": "={{ DateTime.fromISO($json.start.dateTime) }}",
              "rightValue": "={{ DateTime.now() }}"
            }
          ]
        }
      },
      "typeVersion": 2.3
    },
    {
      "id": "0ba2cbc0-201a-42e7-bd51-fb61fbe39f03",
      "name": "Aggregate check data",
      "type": "n8n-nodes-base.aggregate",
      "position": [
        672,
        -224
      ],
      "parameters": {
        "options": {},
        "fieldsToAggregate": {
          "fieldToAggregate": [
            {
              "fieldToAggregate": "subject"
            },
            {
              "fieldToAggregate": "start.dateTime"
            }
          ]
        }
      },
      "typeVersion": 1
    },
    {
      "id": "c0605eb1-34ca-4cf9-8326-e1f7022a7111",
      "name": "Send reminder on checks due day before",
      "type": "n8n-nodes-base.telegram",
      "position": [
        896,
        -224
      ],
      "parameters": {
        "text": "=Checks due TOMORROW:  \n\n{{ $json.subject.map((subj, index) => `\u2022 ${subj} (Date: ${$json.dateTime[index].split('T')[0]})`).join('\\n') }}\n\nFYI. @teammate4, @teammate1, @teammate2",
        "chatId": "YOUR_TELEGRAM_GROUP_CHAT_ID",
        "additionalFields": {
          "appendAttribution": false
        }
      },
      "credentials": {
        "telegramApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "f34df9a5-3a9d-4166-ba1b-c11091b2ea27",
      "name": "Send reminder on checks due for the week",
      "type": "n8n-nodes-base.telegram",
      "position": [
        1120,
        16
      ],
      "parameters": {
        "text": "=Checks due until next week:  \n\n{{ $json.subject.map((subj, index) => `\u2022 ${subj} (Date: ${$json.dateTime[index].split('T')[0]})`).join('\\n') }}\n\nFYI. @teammate4, @teammate1, @teammate2",
        "chatId": "YOUR_TELEGRAM_GROUP_CHAT_ID",
        "additionalFields": {
          "appendAttribution": false
        }
      },
      "credentials": {
        "telegramApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "643f7b88-259a-4d4f-8333-9bd0c2b6143e",
      "name": "Trigger daily",
      "type": "n8n-nodes-base.scheduleTrigger",
      "position": [
        0,
        -224
      ],
      "parameters": {
        "rule": {
          "interval": [
            {}
          ]
        }
      },
      "typeVersion": 1.3
    },
    {
      "id": "edc079ca-67f0-4f3b-9684-71d66ee892a6",
      "name": "Filter checks due today",
      "type": "n8n-nodes-base.filter",
      "position": [
        448,
        -464
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 3,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "0b04a4a5-0bae-459a-8112-57d4ac74c9f9",
              "operator": {
                "type": "dateTime",
                "operation": "afterOrEquals"
              },
              "leftValue": "={{ DateTime.fromISO($json.start.dateTime) }}",
              "rightValue": "={{ $today.startOf('day') }}"
            },
            {
              "id": "cf98e9e5-f328-47d9-98f9-283421ba8cd3",
              "operator": {
                "type": "dateTime",
                "operation": "beforeOrEquals"
              },
              "leftValue": "={{ DateTime.fromISO($json.start.dateTime) }}",
              "rightValue": "={{ $today.endOf('day') }}"
            }
          ]
        }
      },
      "typeVersion": 2.3
    },
    {
      "id": "0b378be0-1a7b-4ac0-88ab-492160174969",
      "name": "Get events for today",
      "type": "n8n-nodes-base.microsoftOutlook",
      "position": [
        224,
        -464
      ],
      "parameters": {
        "fields": [
          "subject",
          "start"
        ],
        "output": "fields",
        "filters": {},
        "resource": "event",
        "returnAll": true,
        "calendarId": {
          "__rl": true,
          "mode": "id",
          "value": "YOUR_OUTLOOK_CALENDAR_ID",
          "cachedResultName": "Calendar"
        },
        "fromAllCalendars": false
      },
      "credentials": {
        "microsoftOutlookOAuth2Api": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 2
    },
    {
      "id": "5ac81301-7e5c-4a0c-9571-37375f3589b1",
      "name": "Get events for tomorrow",
      "type": "n8n-nodes-base.microsoftOutlook",
      "position": [
        224,
        -224
      ],
      "parameters": {
        "fields": [
          "subject",
          "start"
        ],
        "output": "fields",
        "filters": {},
        "resource": "event",
        "returnAll": true,
        "calendarId": {
          "__rl": true,
          "mode": "id",
          "value": "YOUR_OUTLOOK_CALENDAR_ID",
          "cachedResultName": "Calendar"
        },
        "fromAllCalendars": false
      },
      "credentials": {
        "microsoftOutlookOAuth2Api": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 2
    },
    {
      "id": "9a690f0e-eaac-4683-9994-f061afa33ed9",
      "name": "Aggregate check data for today",
      "type": "n8n-nodes-base.aggregate",
      "position": [
        672,
        -464
      ],
      "parameters": {
        "options": {},
        "fieldsToAggregate": {
          "fieldToAggregate": [
            {
              "fieldToAggregate": "subject"
            },
            {
              "fieldToAggregate": "start.dateTime"
            }
          ]
        }
      },
      "typeVersion": 1
    },
    {
      "id": "db0ab343-388a-4c4e-980d-1fd30850e747",
      "name": "Send reminder on checks due today",
      "type": "n8n-nodes-base.telegram",
      "position": [
        896,
        -464
      ],
      "parameters": {
        "text": "=Checks due TODAY:  \n\n{{ $json.subject.map((subj, index) => `\u2022 ${subj} (Date: ${$json.dateTime[index].split('T')[0]})`).join('\\n') }}\n\nFYI. @teammate4, @teammate1, @teammate2",
        "chatId": "YOUR_TELEGRAM_GROUP_CHAT_ID",
        "additionalFields": {
          "appendAttribution": false
        }
      },
      "credentials": {
        "telegramApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "9c79b552-fb38-454c-9de7-8826d3a909a5",
      "name": "Trigger daily at midnight",
      "type": "n8n-nodes-base.scheduleTrigger",
      "position": [
        0,
        -464
      ],
      "parameters": {
        "rule": {
          "interval": [
            {}
          ]
        }
      },
      "typeVersion": 1.3
    },
    {
      "id": "39c1b811-c702-4cd2-8625-5eae4e8b0ac6",
      "name": "Filter checks due this week",
      "type": "n8n-nodes-base.filter",
      "position": [
        448,
        16
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 3,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "a5481142-920a-4075-b63b-de8525ae7009",
              "operator": {
                "type": "dateTime",
                "operation": "afterOrEquals"
              },
              "leftValue": "={{ $json.start.dateTime }}",
              "rightValue": "={{ $now }}"
            },
            {
              "id": "9352e7a8-653b-4e7b-8d14-7ce307d9955e",
              "operator": {
                "type": "dateTime",
                "operation": "beforeOrEquals"
              },
              "leftValue": "={{ $json.start.dateTime }}",
              "rightValue": "={{ $now.plus({ week: 1 }) }}"
            }
          ]
        }
      },
      "typeVersion": 2.3,
      "alwaysOutputData": true
    },
    {
      "id": "0b184297-9ee0-458c-a108-53789deaa840",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -80,
        -528
      ],
      "parameters": {
        "color": 5,
        "width": 1408,
        "height": 240,
        "content": "## Reminder for checks due TODAY"
      },
      "typeVersion": 1
    },
    {
      "id": "d82a1d24-c2e5-4a71-907b-4af224e1f686",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -80,
        -288
      ],
      "parameters": {
        "color": 5,
        "width": 1408,
        "height": 240,
        "content": "## Reminder for checks due TOMORROW"
      },
      "typeVersion": 1
    },
    {
      "id": "83a7bd9e-f04a-4984-a790-66029af42e07",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -80,
        -48
      ],
      "parameters": {
        "color": 5,
        "width": 1408,
        "height": 240,
        "content": "## Reminder for checks due WITHIN THE WEEK"
      },
      "typeVersion": 1
    }
  ],
  "active": false,
  "settings": {
    "binaryMode": "separate",
    "callerPolicy": "workflowsFromSameOwner",
    "timeSavedMode": "fixed",
    "availableInMCP": false,
    "executionOrder": "v1"
  },
  "connections": {
    "Aggregate": {
      "main": [
        [
          {
            "node": "Send reminder on checks due for the week",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Trigger daily": {
      "main": [
        [
          {
            "node": "Get events for tomorrow",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get many events": {
      "main": [
        [
          {
            "node": "Filter checks due this week",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Aggregate check data": {
      "main": [
        [
          {
            "node": "Send reminder on checks due day before",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get events for today": {
      "main": [
        [
          {
            "node": "Filter checks due today",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "If item length is zero": {
      "main": [
        [],
        [
          {
            "node": "Aggregate",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Filter checks due today": {
      "main": [
        [
          {
            "node": "Aggregate check data for today",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get events for tomorrow": {
      "main": [
        [
          {
            "node": "Filter checks due day before",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Trigger weekly on Sunday": {
      "main": [
        [
          {
            "node": "Get many events",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Trigger daily at midnight": {
      "main": [
        [
          {
            "node": "Get events for today",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Filter checks due this week": {
      "main": [
        [
          {
            "node": "If item length is zero",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Filter checks due day before": {
      "main": [
        [
          {
            "node": "Aggregate check data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Aggregate check data for today": {
      "main": [
        [
          {
            "node": "Send reminder on checks due today",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}