{
  "name": "Extract tasks from Telegram messages to Notion using Gemini AI and Approvals",
  "nodes": [
    {
      "id": "2abd8dfa-9a30-40e9-a6f6-00dfebfb0a8c",
      "name": "Google Gemini Chat Model",
      "type": "@n8n/n8n-nodes-langchain.lmChatGoogleGemini",
      "position": [
        -192,
        128
      ]
    },
    {
      "id": "b628bda1-d9d4-4a08-8daf-92df2068b20b",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -640,
        -176
      ],
      "parameters": {
        "width": 304,
        "height": 336,
        "content": "## ⚡ Starts on new Telegram message.\nTriggers the workflow when a new Telegram message arrives. "
      }
    },
    {
      "id": "5fc725da-6bed-4db6-a366-48cd5c0a0c4e",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -256,
        -240
      ],
      "parameters": {
        "width": 352,
        "height": 512,
        "content": "## 🧠 Uses AI (Gemini) to return TaskName & TaskDue.\nThis node uses an AI model (e.g., Gemini) to extract the task name and due date from the Telegram message.  \nYou can easily switch to any other AI m"
      }
    },
    {
      "id": "cb518f25-0918-4c19-b56e-c5d3f4d0f459",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        144,
        -256
      ],
      "parameters": {
        "width": 304,
        "height": 448,
        "content": "## 📩 Sends extracted task; waits for Approve or Decline.\nSends a message with the extracted task name and due date.  \nWaits for your response you can **approve** or **decline** the task."
      }
    },
    {
      "id": "0395e170-03d3-44a2-86a2-2486587a60c4",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        496,
        -224
      ],
      "parameters": {
        "width": 320,
        "height": 384,
        "content": "## ⚖️ If approved → create task. If declined → notify.\nChecks if the user approved or declined the task.  \nIf **approved**, the workflow continues; if **declined**, it redirects to another step.\n"
      }
    },
    {
      "id": "63aa0097-e2ad-40d5-abf0-103f132305d3",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        896,
        48
      ],
      "parameters": {
        "width": null,
        "height": 368,
        "content": "## 📩 Decline Notification  \nSends a Telegram message to the user notifying them that they **declined the task** and no task was created in Notion.\n"
      }
    },
    {
      "id": "6ccb7215-746b-4449-b8ba-a535566bb04f",
      "name": "Sticky Note5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        896,
        -304
      ],
      "parameters": {
        "width": 512,
        "height": 320,
        "content": "## 📝 Create Notion Task  \nIf the task is approved, this node creates a new task in Notion using the extracted **task name** and **due date**.  \nAfter creation, it triggers the next node to send a Tele"
      }
    },
    {
      "id": "c1411a5a-f2a1-42cd-8c4a-708f2040a982",
      "name": "Telegram New Message Trigger",
      "type": "n8n-nodes-base.telegramTrigger",
      "position": [
        -544,
        -32
      ]
    },
    {
      "id": "1214ca68-7ced-4a27-b4b5-30caad364092",
      "name": "AI Extract: TaskName & TaskDue",
      "type": "@n8n/n8n-nodes-langchain.informationExtractor",
      "position": [
        -192,
        -32
      ]
    },
    {
      "id": "093e6dab-b137-4d80-8bff-09ff03f1018b",
      "name": "Send message and wait for response (Approve/Decline)",
      "type": "n8n-nodes-base.telegram",
      "position": [
        240,
        -32
      ]
    },
    {
      "id": "a5b24cc6-1ba0-400f-a218-c5ddcbff2574",
      "name": "Approval Check (If Approved?)",
      "type": "n8n-nodes-base.if",
      "position": [
        592,
        -32
      ]
    },
    {
      "id": "80e06ae0-4eb1-43fa-8215-828500e1a7df",
      "name": "Notion: Create Task (Page)",
      "type": "n8n-nodes-base.notion",
      "position": [
        976,
        -160
      ]
    },
    {
      "id": "8c629f2a-04bf-4ffe-960f-6ca107f6f13d",
      "name": "Notify: Task Created (Telegram)",
      "type": "n8n-nodes-base.telegram",
      "position": [
        1184,
        -160
      ]
    },
    {
      "id": "a5ff4f45-4ef8-4474-992b-a73b5983b462",
      "name": "Notify: Declined - No Task (Telegram)",
      "type": "n8n-nodes-base.telegram",
      "position": [
        960,
        224
      ]
    },
    {
      "id": "5f21dcbb-1d6d-4b16-8395-84a884a5e4fb",
      "name": "Sticky Note6",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1232,
        -336
      ],
      "parameters": {
        "width": 544,
        "height": 688,
        "content": "## 🔧 Setup & Requirements\n- Gemini API key (add as Google Palm / Gemini credential in n8n).  \n- Notion integration + database with properties:  \n  - **TaskName** (Title) — stores the task name.  \n  - "
      }
    }
  ],
  "connections": {
    "Google Gemini Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "AI Extract: TaskName & TaskDue",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Notion: Create Task (Page)": {
      "main": [
        [
          {
            "node": "Notify: Task Created (Telegram)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Telegram New Message Trigger": {
      "main": [
        [
          {
            "node": "AI Extract: TaskName & TaskDue",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Approval Check (If Approved?)": {
      "main": [
        [
          {
            "node": "Notion: Create Task (Page)",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Notify: Declined - No Task (Telegram)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "AI Extract: TaskName & TaskDue": {
      "main": [
        [
          {
            "node": "Send message and wait for response (Approve/Decline)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Send message and wait for response (Approve/Decline)": {
      "main": [
        [
          {
            "node": "Approval Check (If Approved?)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}