{
  "id": "rYFA4qgP9rXhcsUD",
  "name": "Voice Notes to Notion To-Do List - Telegram + Groq Whisper AI",
  "tags": [],
  "nodes": [
    {
      "id": "f7faf762-aee6-4c50-8f55-7c2ce19cc1be",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        0,
        0
      ],
      "parameters": {
        "width": 480,
        "height": 672,
        "content": "## Voice Notes to Notion To-Do List - Telegram + Groq Whisper AI\n\n### How it works\n\n1. Triggers when a voice message is received on Telegram.\n2. Downloads and renames the voice file to OGG format.\n3. Transcribes audio using Groq Whisper API.\n4. Searches for the daily page in Notion.\n5. Appends a to-do block or creates a new page if it does not exist.\n\n### Setup steps\n\n- [ ] Configure Telegram credentials and set up the bot to receive voice messages.\n- [ ] Set up an account with Groq Whisper API and obtain API key for transcription service.\n- [ ] Connect to your Notion workspace and obtain access to edit your daily pages.\n\n### Customization\n\nThe workflow can be adapted to trigger from different types of messages or to store results in other Notion databases."
      },
      "typeVersion": 1
    },
    {
      "id": "50233e72-173b-4065-a3ff-96818c3db09d",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        560,
        112
      ],
      "parameters": {
        "color": 7,
        "width": 608,
        "height": 304,
        "content": "## Telegram voice input\n\nHandles initial detection and downloading of voice messages from Telegram."
      },
      "typeVersion": 1
    },
    {
      "id": "132bc670-f934-4d9e-b754-e3cefdb2b3be",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1200,
        80
      ],
      "parameters": {
        "color": 7,
        "height": 320,
        "content": "## Audio transcription\n\nProcesses the converted audio file to text using Groq Whisper API."
      },
      "typeVersion": 1
    },
    {
      "id": "f280f992-1067-48e7-92b5-cd8a0eda45a7",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1472,
        0
      ],
      "parameters": {
        "color": 7,
        "width": 816,
        "height": 448,
        "content": "## Notion page management\n\nSearches for existing daily pages and updates Notion with new to-do entries."
      },
      "typeVersion": 1
    },
    {
      "id": "57070ebe-8ca7-457e-a72d-0255929bb3d7",
      "name": "When Voice Note Received",
      "type": "n8n-nodes-base.telegramTrigger",
      "position": [
        608,
        240
      ],
      "parameters": {
        "updates": [
          "message"
        ],
        "additionalFields": {
          "download": true
        }
      },
      "credentials": {
        "telegramApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "2e5aeefe-5117-4ab5-9162-fe764a059b28",
      "name": "Download Voice Note File",
      "type": "n8n-nodes-base.telegram",
      "position": [
        800,
        240
      ],
      "parameters": {
        "fileId": "={{ $json.message.voice.file_id }}",
        "resource": "file",
        "additionalFields": {}
      },
      "credentials": {
        "telegramApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "673f3aca-545c-465e-ab3a-393bc8631cc0",
      "name": "Convert File to OGG Format",
      "type": "n8n-nodes-base.code",
      "position": [
        1024,
        240
      ],
      "parameters": {
        "jsCode": "const items = $input.all();\nfor (const item of items) {\n  if (item.binary && item.binary.data) {\n    item.binary.data.fileName = item.binary.data.fileName.replace('.oga', '.ogg');\n    item.binary.data.fileExtension = 'ogg';\n  }\n}\nreturn items;"
      },
      "typeVersion": 2
    },
    {
      "id": "7c2a4897-7d6c-4e29-9211-f935e1ae1954",
      "name": "Post to Groq Whisper API",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        1248,
        240
      ],
      "parameters": {
        "url": "https://api.groq.com/openai/v1/audio/transcriptions",
        "method": "POST",
        "options": {},
        "sendBody": true,
        "contentType": "multipart-form-data",
        "authentication": "genericCredentialType",
        "bodyParameters": {
          "parameters": [
            {
              "name": "file",
              "parameterType": "formBinaryData",
              "inputDataFieldName": "data"
            },
            {
              "name": "model",
              "value": "whisper-large-v3-turbo"
            }
          ]
        },
        "genericAuthType": "httpHeaderAuth"
      },
      "typeVersion": 4.3
    },
    {
      "id": "e94dece6-fd4b-4683-ab2a-acd3de152b4e",
      "name": "Find Today's Notion Page",
      "type": "n8n-nodes-base.notion",
      "position": [
        1520,
        240
      ],
      "parameters": {
        "text": "={{ $now.setZone('Asia/Kolkata').format('ddMMyyyy') }}",
        "options": {},
        "operation": "search"
      },
      "typeVersion": 2.2,
      "alwaysOutputData": true
    },
    {
      "id": "72dd3e1f-c93f-40f6-91d8-decb57858e1f",
      "name": "If Daily Page Exists",
      "type": "n8n-nodes-base.if",
      "position": [
        1792,
        240
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 3,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "c1",
              "operator": {
                "type": "string",
                "operation": "exists",
                "singleValue": true
              },
              "leftValue": "={{ $json.id }}",
              "rightValue": 0
            }
          ]
        }
      },
      "typeVersion": 2.3
    },
    {
      "id": "fd0e2d93-2530-4116-93a7-72ea64b5decf",
      "name": "Add To-Do to Page",
      "type": "n8n-nodes-base.notion",
      "position": [
        2128,
        112
      ],
      "parameters": {
        "blockId": {
          "__rl": true,
          "mode": "id",
          "value": "={{ $json.id }}"
        },
        "blockUi": {
          "blockValues": [
            {
              "type": "to_do",
              "textContent": "={{ $('Post to Groq Whisper API').item.json.text }}"
            }
          ]
        },
        "resource": "block"
      },
      "typeVersion": 2.2
    },
    {
      "id": "4136ea15-b35b-4a07-bc1d-9396e516c053",
      "name": "Create New Daily Page in Notion",
      "type": "n8n-nodes-base.notion",
      "position": [
        2144,
        288
      ],
      "parameters": {
        "title": "={{ $now.setZone('Asia/Kolkata').format('ddMMyyyy') }}",
        "pageId": {
          "__rl": true,
          "mode": "id",
          "value": "Enter the Notion Page ID"
        },
        "blockUi": {
          "blockValues": [
            {
              "type": "to_do",
              "textContent": "={{ $('Post to Groq Whisper API').item.json.text }}"
            }
          ]
        },
        "options": {}
      },
      "typeVersion": 2.2
    }
  ],
  "active": false,
  "settings": {
    "binaryMode": "separate",
    "executionOrder": "v1"
  },
  "versionId": "0f4900d4-3a9d-4fdd-a3a0-ff0c40c2991d",
  "connections": {
    "If Daily Page Exists": {
      "main": [
        [
          {
            "node": "Add To-Do to Page",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Create New Daily Page in Notion",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Download Voice Note File": {
      "main": [
        [
          {
            "node": "Convert File to OGG Format",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Find Today's Notion Page": {
      "main": [
        [
          {
            "node": "If Daily Page Exists",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Post to Groq Whisper API": {
      "main": [
        [
          {
            "node": "Find Today's Notion Page",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "When Voice Note Received": {
      "main": [
        [
          {
            "node": "Download Voice Note File",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Convert File to OGG Format": {
      "main": [
        [
          {
            "node": "Post to Groq Whisper API",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}