{
  "name": "Multi-channel task reminder system with Telegram, Email and Slack",
  "nodes": [
    {
      "id": "d085b82b-f923-4d83-941d-2020134b704e",
      "name": "Webhook - Receive Task",
      "type": "n8n-nodes-base.webhook",
      "position": [
        -768,
        448
      ]
    },
    {
      "id": "090aecda-2c33-405d-a602-aaa55fd435cd",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -896,
        80
      ],
      "parameters": {
        "width": 380,
        "height": 500,
        "content": "## 📥 WEBHOOK ENTRY POINT\n\nThis webhook receives task creation requests from users.\n\n**Expected JSON Format:**\n```json\n{\n  \"userId\": \"user123\",\n  \"taskName\": \"Team Meeting\",\n  \"reminderTime\": \"2025-10-"
      }
    },
    {
      "id": "eb5810b6-3e18-4ef0-ae8c-e0cf1b3a6743",
      "name": "Validate Input",
      "type": "n8n-nodes-base.if",
      "position": [
        -304,
        448
      ]
    },
    {
      "id": "27bf912f-31f5-411d-ae7a-0cf5d12c49b0",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -448,
        160
      ],
      "parameters": {
        "width": 408,
        "height": 424,
        "content": "## ✅ INPUT VALIDATION\n\nChecks if required fields are present:\n- userId (required)\n- taskName (required)\n- reminderTime (required)\n- description (optional)\n- channel (optional)\n\nRoutes to error handler"
      }
    },
    {
      "id": "7a358fe1-7841-4533-bf48-bf1170d3aa22",
      "name": "Save Task to Database",
      "type": "n8n-nodes-base.postgres",
      "position": [
        128,
        352
      ]
    },
    {
      "id": "d39c06bd-11f1-4dd7-9213-c5e251845242",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        0,
        0
      ],
      "parameters": {
        "width": 380,
        "height": 496,
        "content": "## 💾 DATABASE STORAGE\n\nStores task in PostgreSQL database.\n\n**Table Schema:**\n- id (serial, primary key)\n- user_id (varchar)\n- task_name (varchar)\n- reminder_time (timestamp)\n- description (text)\n- ch"
      }
    },
    {
      "id": "e76eb098-e71b-4689-9830-0ac1c59e46f4",
      "name": "Success Response",
      "type": "n8n-nodes-base.respondToWebhook",
      "position": [
        464,
        352
      ]
    },
    {
      "id": "b3cdb19e-6342-4881-937c-651f34b37699",
      "name": "Error Response",
      "type": "n8n-nodes-base.respondToWebhook",
      "position": [
        128,
        544
      ]
    },
    {
      "id": "07e622f7-7f07-4998-b150-88cd1d75324e",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        400,
        64
      ],
      "parameters": {
        "width": 340,
        "height": 432,
        "content": "## 📤 RESPONSE HANDLERS\n\n**Success Response:**\nReturns 200 with task details\n\n**Error Response:**\nReturns 400 with error message\n\nBoth use JSON format for consistency."
      }
    },
    {
      "id": "054df4ef-2851-442b-ac8e-45d0acd2b9de",
      "name": "Schedule Trigger - Every 5 Minutes",
      "type": "n8n-nodes-base.scheduleTrigger",
      "position": [
        -768,
        1040
      ]
    },
    {
      "id": "110f25f1-6f56-4970-a783-3e6878231d22",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -928,
        752
      ],
      "parameters": {
        "width": 408,
        "height": 456,
        "content": "## ⏰ SCHEDULE TRIGGER\n\nRuns every 5 minutes to check for pending reminders.\n\n**Cron Expression:** */5 * * * *\n\nAdjust frequency based on your needs:\n- Every 1 min: */1 * * * *\n- Every 10 min: */10 * *"
      }
    },
    {
      "id": "bffcb07b-e5c5-4587-8795-4a316841772e",
      "name": "Fetch Due Tasks",
      "type": "n8n-nodes-base.postgres",
      "position": [
        -352,
        1040
      ]
    },
    {
      "id": "db4232c9-65fa-4be0-8594-582cb64be001",
      "name": "Sticky Note5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -496,
        768
      ],
      "parameters": {
        "width": 360,
        "height": 416,
        "content": "## 🔍 FETCH DUE TASKS\n\nQueries database for tasks where:\n- Status is 'pending'\n- Reminder time is within next 5 minutes\n- Not already sent\n\nThis ensures timely delivery without duplicates."
      }
    },
    {
      "id": "2f074a5a-5441-4cd9-bedc-36a80b2f0442",
      "name": "Check Tasks Exist",
      "type": "n8n-nodes-base.if",
      "position": [
        16,
        1056
      ]
    },
    {
      "id": "8fb3b2a4-31f4-4e57-a8fc-e5f2e19502ab",
      "name": "Sticky Note6",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -96,
        784
      ],
      "parameters": {
        "width": 320,
        "height": 408,
        "content": "## 🔀 TASK CHECKER\n\nChecks if any tasks were found.\n\nIf YES → Process reminders\nIf NO → Skip (no action needed)"
      }
    },
    {
      "id": "0284e84a-4b41-407d-9ca2-02950123b14e",
      "name": "Split Into Items",
      "type": "n8n-nodes-base.splitInBatches",
      "position": [
        464,
        880
      ]
    },
    {
      "id": "2a67a9a4-4317-48fa-b7d4-c666578d27f3",
      "name": "Sticky Note7",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        368,
        672
      ],
      "parameters": {
        "width": 304,
        "height": 360,
        "content": "## 🔄 SPLIT INTO ITEMS\n\nProcesses each task individually.\n\nEssential for sending personalized reminders to each user with their specific task details."
      }
    },
    {
      "id": "34887349-bfcb-4d72-aa3b-80c17cd64188",
      "name": "Route by Channel",
      "type": "n8n-nodes-base.switch",
      "position": [
        864,
        368
      ]
    },
    {
      "id": "7d8f1cb8-3c6e-4e0b-9d83-729b1927ec99",
      "name": "Sticky Note8",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        752,
        112
      ],
      "parameters": {
        "width": 340,
        "height": 404,
        "content": "## 📨 CHANNEL ROUTER\n\nRoutes reminders to appropriate channel:\n\n**Output 0:** Email\n**Output 1:** Slack\n**Output 2:** Telegram\n**Output 3:** SMS (Twilio)\n\nAdd more channels as needed!"
      }
    },
    {
      "id": "94e39533-9cf6-49ee-9c8b-0b785895d37e",
      "name": "Send Email Reminder",
      "type": "n8n-nodes-base.emailSend",
      "position": [
        1264,
        352
      ]
    },
    {
      "id": "0f0d5935-a428-4616-b230-4a0fcb109a9f",
      "name": "Sticky Note9",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1136,
        48
      ],
      "parameters": {
        "width": 340,
        "height": 452,
        "content": "## 📧 EMAIL SENDER\n\nSends formatted HTML email with:\n- Task name\n- Scheduled time\n- Description\n- Professional styling\n\n**Setup Required:**\n- Configure SMTP credentials\n- Set from email address"
      }
    },
    {
      "id": "5e0425d6-ed82-4eda-8a0e-80d3fbd8e78f",
      "name": "Send Slack Reminder",
      "type": "n8n-nodes-base.slack",
      "position": [
        944,
        848
      ]
    },
    {
      "id": "ed8ca2c7-a374-473a-a35e-a245b434e50c",
      "name": "Sticky Note10",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        784,
        544
      ],
      "parameters": {
        "width": 404,
        "height": 436,
        "content": "## 💬 SLACK SENDER\n\nSends Slack message using:\n- Markdown formatting\n- Direct message to user\n- Task details\n\n**Setup Required:**\n- Create Slack App\n- Add bot token\n- Install to workspace"
      }
    },
    {
      "id": "5f99e3b6-6458-465c-a300-a64d3e4885b8",
      "name": "Send Telegram Reminder",
      "type": "n8n-nodes-base.telegram",
      "position": [
        1392,
        1248
      ]
    },
    {
      "id": "efa080e8-9ddd-4ba8-9ffe-01bcd0400bab",
      "name": "Sticky Note11",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1264,
        976
      ],
      "parameters": {
        "width": 340,
        "height": 424,
        "content": "## 📱 TELEGRAM SENDER\n\nSends Telegram message with:\n- Bold formatting\n- Task details\n- Direct to user's chat ID\n\n**Setup Required:**\n- Create bot via @BotFather\n- Get bot token\n- User must start conver"
      }
    },
    {
      "id": "cc667e2b-5728-4ef9-a54b-4eac33d69b74",
      "name": "Update Task Status",
      "type": "n8n-nodes-base.postgres",
      "position": [
        1696,
        848
      ]
    },
    {
      "id": "695a7588-6cec-4fd9-942a-c63fca8ede0a",
      "name": "Sticky Note13",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1552,
        384
      ],
      "parameters": {
        "width": 400,
        "height": 616,
        "content": "## 🎯 WORKFLOW COMPLETE!\n\n**Setup Checklist:**\n1. ✅ Configure database credentials\n2. ✅ Set up email/Slack/Telegram\n3. ✅ Test webhook with sample data\n4. ✅ Verify schedule trigger timing\n5. ✅ Monitor f"
      }
    }
  ],
  "connections": {
    "Validate Input": {
      "main": [
        [
          {
            "node": "Save Task to Database",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Error Response",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Fetch Due Tasks": {
      "main": [
        [
          {
            "node": "Check Tasks Exist",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Route by Channel": {
      "main": [
        [
          {
            "node": "Send Email Reminder",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Split Into Items": {
      "main": [
        [
          {
            "node": "Route by Channel",
            "type": "main",
            "index": 0
          },
          {
            "node": "Send Slack Reminder",
            "type": "main",
            "index": 0
          },
          {
            "node": "Send Telegram Reminder",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Check Tasks Exist": {
      "main": [
        [
          {
            "node": "Split Into Items",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Update Task Status": {
      "main": [
        [
          {
            "node": "Split Into Items",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Send Email Reminder": {
      "main": [
        [
          {
            "node": "Update Task Status",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Send Slack Reminder": {
      "main": [
        [
          {
            "node": "Update Task Status",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Save Task to Database": {
      "main": [
        [
          {
            "node": "Success Response",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Send Telegram Reminder": {
      "main": [
        [
          {
            "node": "Update Task Status",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Webhook - Receive Task": {
      "main": [
        [
          {
            "node": "Validate Input",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Schedule Trigger - Every 5 Minutes": {
      "main": [
        [
          {
            "node": "Fetch Due Tasks",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}