{
  "id": "vFC39W70nuEDi1Ub",
  "name": "Convert Telegram messages to to-do lists with Gemini and Notion",
  "tags": [],
  "nodes": [
    {
      "id": "70e0f492-232f-446c-a24b-f4678e76d4b6",
      "name": "Sticky Note - Description",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -256,
        -16
      ],
      "parameters": {
        "color": 5,
        "width": 480,
        "height": 1128,
        "content": "## \ud83d\udcdd Convert Telegram messages to to-do lists using AI and Notion\n\n### Who's it for\nAnyone who wants to quickly turn a typed message into a clean, actionable to-do list \u2014 freelancers, founders, students \u2014 without manually formatting tasks. Just message your bot, get back a structured list, automatically logged to Notion.\n\n### How it works\nThis workflow listens for messages sent to your Telegram bot. When a text message arrives, an AI model extracts a clean, numbered to-do list from it, logs the list to a Notion database, and replies back to the user in Telegram with the same list.\n\n### How to set up\n1. Create a Telegram bot via @BotFather and connect its token as a Telegram credential in n8n.\n2. Connect your Gemini (or other AI model) credential for the to-do extraction step.\n3. Connect a Notion integration and select your target database in the Notion node.\n4. Activate the workflow.\n\n### Requirements\n- A Telegram bot token\n- A Gemini API key (free tier available) or another supported AI model\n- A Notion account with an integration + database\n\n### How to customize\n- Edit the extraction prompt to change tone or output format (e.g. add due dates, priority tags)\n- Add a Filter node to ignore very short messages (avoids false triggers)\n- Swap the Notion logging step for Google Sheets or Airtable if preferred\n- Add a confirmation message before logging to Notion if you want a review step"
      },
      "typeVersion": 1
    },
    {
      "id": "865d5690-c4e6-405a-b004-3186cd2dcfef",
      "name": "Sticky Note - Trigger",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        336,
        544
      ],
      "parameters": {
        "color": 7,
        "width": 220,
        "height": 152,
        "content": "Triggers on every message.\nThe IF node filters for text only."
      },
      "typeVersion": 1
    },
    {
      "id": "7e0885f4-13f9-44b2-b159-15f1b5512897",
      "name": "Sticky Note - If",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        736,
        592
      ],
      "parameters": {
        "color": 7,
        "width": 220,
        "height": 80,
        "content": "Checks if the incoming\nmessage contains text."
      },
      "typeVersion": 1
    },
    {
      "id": "10f0ecde-3f00-40bc-a8dc-f4234fc282bb",
      "name": "Sticky Note - Extract",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1200,
        544
      ],
      "parameters": {
        "color": 7,
        "width": 220,
        "height": 136,
        "content": "Edit this prompt to change\nhow tasks are extracted/formatted."
      },
      "typeVersion": 1
    },
    {
      "id": "815b93f1-9b5a-42d4-878f-8050b4654249",
      "name": "Sticky Note - Notion",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2048,
        352
      ],
      "parameters": {
        "color": 7,
        "width": 220,
        "height": 112,
        "content": "Logs the extracted list\nas a new page in Notion."
      },
      "typeVersion": 1
    },
    {
      "id": "a7abb3ef-7756-410f-ab18-628e36d39aeb",
      "name": "Sticky Note - Reply",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2064,
        1072
      ],
      "parameters": {
        "color": 7,
        "width": 220,
        "height": 112,
        "content": "Sends the to-do list back\nto the user in the same chat."
      },
      "typeVersion": 1
    },
    {
      "id": "1bcfea91-ac55-4968-ad0e-c5cfca984624",
      "name": "Get telegram message",
      "type": "n8n-nodes-base.telegramTrigger",
      "position": [
        400,
        720
      ],
      "parameters": {
        "updates": [
          "message"
        ],
        "additionalFields": {}
      },
      "credentials": {
        "telegramApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "5f5e083b-1a55-4d15-a4ae-a44b0f68de0b",
      "name": "Text message?",
      "type": "n8n-nodes-base.if",
      "position": [
        784,
        720
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 3,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "875f0676-aa10-479c-a4a8-4001dc61ca6f",
              "operator": {
                "type": "string",
                "operation": "exists",
                "singleValue": true
              },
              "leftValue": "={{ $json.message.text }}",
              "rightValue": ""
            }
          ]
        }
      },
      "typeVersion": 2.3
    },
    {
      "id": "1035ce72-4a54-4b36-994d-48dd1d882a72",
      "name": "AI Agent",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        1200,
        704
      ],
      "parameters": {
        "text": "=Extract a clean, numbered to-do list from this message. Only include clear, actionable items \u2014 skip filler or unrelated chatter. If no action items are found, respond with \"No tasks found.\"\n\nMessage: {{ $json.message.text }}",
        "options": {},
        "promptType": "define"
      },
      "typeVersion": 3.1
    },
    {
      "id": "aa6c583b-06d5-4330-ae48-670f1968c7e8",
      "name": "Google Gemini Chat Model",
      "type": "@n8n/n8n-nodes-langchain.lmChatGoogleGemini",
      "position": [
        1200,
        1008
      ],
      "parameters": {
        "options": {}
      },
      "credentials": {
        "googlePalmApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "649a613f-a789-4483-a4a2-759be4f2a96e",
      "name": "Log to-do list to Notion",
      "type": "n8n-nodes-base.notion",
      "position": [
        2112,
        480
      ],
      "parameters": {
        "title": "=Voice To-Do \u2014 {{ $now.format('yyyy-MM-dd HH:mm') }}",
        "options": {},
        "resource": "databasePage",
        "databaseId": {
          "__rl": true,
          "mode": "list",
          "value": "REPLACE_WITH_YOUR_NOTION_DATABASE_ID",
          "cachedResultUrl": "https://www.notion.so/",
          "cachedResultName": "Your Notion database"
        }
      },
      "credentials": {
        "notionApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "ab17e874-4367-4b6c-8697-a9626ae61195",
      "name": "Reply with to-do list in Telegram",
      "type": "n8n-nodes-base.telegram",
      "position": [
        2112,
        880
      ],
      "parameters": {
        "text": "={{ $('AI Agent').item.json.output }}",
        "chatId": "={{ $('Get telegram message').item.json.message.chat.id }}",
        "additionalFields": {
          "appendAttribution": true
        }
      },
      "credentials": {
        "telegramApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1.2
    }
  ],
  "active": false,
  "settings": {
    "binaryMode": "separate",
    "executionOrder": "v1"
  },
  "versionId": "c1f9a27d-41a3-4056-b7f1-863d18849acd",
  "nodeGroups": [],
  "connections": {
    "AI Agent": {
      "main": [
        [
          {
            "node": "Log to-do list to Notion",
            "type": "main",
            "index": 0
          },
          {
            "node": "Reply with to-do list in Telegram",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Text message?": {
      "main": [
        [
          {
            "node": "AI Agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get telegram message": {
      "main": [
        [
          {
            "node": "Text message?",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Google Gemini Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "AI Agent",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    }
  }
}