{
  "name": "Extract & approve tasks from Telegram to Notion with Gemini AI & voice support",
  "nodes": [
    {
      "id": "34b3273c-721e-488b-9bce-14ee704185ab",
      "name": "Google Gemini Chat Model",
      "type": "@n8n/n8n-nodes-langchain.lmChatGoogleGemini",
      "position": [
        -64,
        128
      ]
    },
    {
      "id": "e7d20742-834e-496f-9dda-9789035e7355",
      "name": "Approval Check (If Approved?)",
      "type": "n8n-nodes-base.if",
      "position": [
        1232,
        -48
      ]
    },
    {
      "id": "e8a10ffe-b0ca-4fac-b995-b81675799620",
      "name": "Telegram: Receive Message",
      "type": "n8n-nodes-base.telegramTrigger",
      "position": [
        -1472,
        -32
      ]
    },
    {
      "id": "a396c59a-f7b1-43aa-a8d8-572761967c2a",
      "name": "Switch: Text or Voice",
      "type": "n8n-nodes-base.switch",
      "position": [
        -1168,
        -32
      ]
    },
    {
      "id": "a2dde0cd-d68b-4545-820d-6d2c410ebd40",
      "name": "Set: Prepare Text",
      "type": "n8n-nodes-base.set",
      "position": [
        -608,
        -176
      ]
    },
    {
      "id": "17e32a68-39e4-406a-8a98-0e57d8a06ca4",
      "name": "Telegram: Download Voice File",
      "type": "n8n-nodes-base.telegram",
      "position": [
        -832,
        224
      ]
    },
    {
      "id": "7225d6e4-e632-4957-96b3-17ee4a7008c3",
      "name": "Gemini: Transcribe Voice",
      "type": "@n8n/n8n-nodes-langchain.googleGemini",
      "position": [
        -576,
        224
      ]
    },
    {
      "id": "54ee3516-9e72-4b28-9cbe-e82b0c37547a",
      "name": "Set: Put Transcript into Text",
      "type": "n8n-nodes-base.set",
      "position": [
        -336,
        224
      ]
    },
    {
      "id": "bf58028e-5018-4105-86c9-5d7495fd22b4",
      "name": "AI Extractor: TaskName & TaskDue",
      "type": "@n8n/n8n-nodes-langchain.informationExtractor",
      "position": [
        -64,
        -32
      ]
    },
    {
      "id": "95ed4be7-aa98-4f72-bd87-dd96ed105f2e",
      "name": "If: Extraction Valid?",
      "type": "n8n-nodes-base.if",
      "position": [
        416,
        -32
      ]
    },
    {
      "id": "1e2f1750-1704-42fe-82c6-7c25a47dd39a",
      "name": "Telegram: Ask Approve / Decline",
      "type": "n8n-nodes-base.telegram",
      "position": [
        832,
        -48
      ]
    },
    {
      "id": "fe396f08-c258-462d-bf61-1f50c3922510",
      "name": "Notion: Create Task Page",
      "type": "n8n-nodes-base.notion",
      "position": [
        1616,
        -64
      ]
    },
    {
      "id": "273da7c6-1dfe-4b70-a9ba-0f66d238d6c6",
      "name": "Telegram: Notify - Task Created",
      "type": "n8n-nodes-base.telegram",
      "position": [
        1824,
        -64
      ]
    },
    {
      "id": "f8d85ba2-217b-4d76-8954-c539ed472b9a",
      "name": "Telegram: Notify - Task Not Created",
      "type": "n8n-nodes-base.telegram",
      "position": [
        1248,
        208
      ]
    },
    {
      "id": "5a32830d-f766-45d3-a330-d058d8ff0d2b",
      "name": "Telegram: Notify - Extraction Failed",
      "type": "n8n-nodes-base.telegram",
      "position": [
        416,
        224
      ]
    },
    {
      "id": "772bab86-fb65-490e-a369-0e6c621fb7d0",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1536,
        -208
      ],
      "parameters": {
        "width": null,
        "height": 352,
        "content": "## 💬 Telegram: Receive Message  \nTriggers when a new Telegram message arrives either text or voice and sends the data forward for processing."
      }
    },
    {
      "id": "515140eb-2d20-44e3-9350-5c8fd044b02f",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1232,
        -208
      ],
      "parameters": {
        "width": null,
        "height": 352,
        "content": "## 🔀 Switch: Text or Voice  \nChecks if the message is text or voice and routes it to the matching branch."
      }
    },
    {
      "id": "1d535e73-7312-4a03-b186-d92642568b3b",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -688,
        -304
      ],
      "parameters": {
        "width": 256,
        "height": 288,
        "content": "## ✏️ Set: Prepare Text  \nExtracts the text message from Telegram and stores it for later processing."
      }
    },
    {
      "id": "89c4d4ca-548c-4708-93f9-dc24cbb5cb5a",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -896,
        32
      ],
      "parameters": {
        "width": 720,
        "height": 368,
        "content": "## 🎙️ Voice Processing Chain  \n1. **Telegram: Download Voice File:** Downloads the user's voice message from Telegram.  \n2. **Gemini: Transcribe Voice:** Sends the downloaded audio to Google Gemini an"
      }
    },
    {
      "id": "5592afdf-aa6b-4cca-86aa-ad53c15ce6bd",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -128,
        -288
      ],
      "parameters": {
        "width": 352,
        "height": 560,
        "content": "## 🧠 Task Information Extraction  \n1. **Google Gemini Chat Model** – Powers the AI extraction with Gemini 2.5 Flash Lite.  \n2. **AI Extractor: TaskName & TaskDue** – Identifies and extracts the *task "
      }
    },
    {
      "id": "30861b16-0e27-40a2-9273-cf4ca47de3b4",
      "name": "Sticky Note5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        288,
        -288
      ],
      "parameters": {
        "width": 352,
        "height": 720,
        "content": "## ✅ Validate Task Extraction\n1. **If: Extraction Valid?** – Checks if both `TaskName` and `TaskDue` exist from the AI-extracted output.  \n2. **Telegram: Notify - Extraction Failed** – Sends a Telegra"
      }
    },
    {
      "id": "de731a57-c922-4e9b-bf3a-eb797f71180d",
      "name": "Sticky Note6",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        704,
        -288
      ],
      "parameters": {
        "width": 352,
        "height": 448,
        "content": "## 📩 Ask for Task Approval\n- **Telegram: Ask Approve / Decline** – Sends a message with the extracted `TaskName` and `TaskDue` to the user.  \n- Provides **Approve** and **Decline** buttons for double "
      }
    },
    {
      "id": "b1332d50-95e4-4dc7-9923-078ecd4e7ad2",
      "name": "Sticky Note7",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1120,
        -208
      ],
      "parameters": {
        "width": 352,
        "height": 608,
        "content": "## ✅ Check Task Approval\n- **Approval Check (If Approved?)** – Checks if the user approved the task in Telegram.\n- **Telegram: Notify - Task Not Created** – Notifies the user if the task was declined."
      }
    },
    {
      "id": "67ff91ca-9c5f-4cff-a253-cebafa5d0cdf",
      "name": "Sticky Note8",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1536,
        -208
      ],
      "parameters": {
        "width": 496,
        "height": 336,
        "content": "## 📝 Create Task in Notion\n- **Notion: Create Task Page** – Adds a new page in Notion with the extracted task name and due date.\n- **Telegram: Notify - Task Created** – Confirms to the user that the t"
      }
    },
    {
      "id": "b990b59b-76c1-44e8-95e5-a9daf9e08f8e",
      "name": "Sticky Note9",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -2528,
        -608
      ],
      "parameters": {
        "width": 896,
        "height": 1312,
        "content": "# Quick Setup Checklist — Telegram → Transcribe → Extract → Notion\n\n## 1) Telegram (BotFather)\n- Create a bot with **BotFather** → `/newbot` → copy the **Bot Token**.\n- Start the bot in your Telegram "
      }
    }
  ],
  "connections": {
    "Set: Prepare Text": {
      "main": [
        [
          {
            "node": "AI Extractor: TaskName & TaskDue",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "If: Extraction Valid?": {
      "main": [
        [
          {
            "node": "Telegram: Ask Approve / Decline",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Telegram: Notify - Extraction Failed",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Switch: Text or Voice": {
      "main": [
        [
          {
            "node": "Set: Prepare Text",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Telegram: Download Voice File",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Gemini: Transcribe Voice": {
      "main": [
        [
          {
            "node": "Set: Put Transcript into Text",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Google Gemini Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "AI Extractor: TaskName & TaskDue",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Notion: Create Task Page": {
      "main": [
        [
          {
            "node": "Telegram: Notify - Task Created",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Telegram: Receive Message": {
      "main": [
        [
          {
            "node": "Switch: Text or Voice",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Approval Check (If Approved?)": {
      "main": [
        [
          {
            "node": "Notion: Create Task Page",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Telegram: Notify - Task Not Created",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Set: Put Transcript into Text": {
      "main": [
        [
          {
            "node": "AI Extractor: TaskName & TaskDue",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Telegram: Download Voice File": {
      "main": [
        [
          {
            "node": "Gemini: Transcribe Voice",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Telegram: Ask Approve / Decline": {
      "main": [
        [
          {
            "node": "Approval Check (If Approved?)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "AI Extractor: TaskName & TaskDue": {
      "main": [
        [
          {
            "node": "If: Extraction Valid?",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}