{
  "name": "Expense Logging with Telegram to Google Sheets using AI Voice & Text Parsing",
  "nodes": [
    {
      "id": "d71544a0-04a0-4a73-b0d9-e4db8852dc19",
      "name": "OpenAI Chat Model",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        240,
        224
      ]
    },
    {
      "id": "c7f116d1-f52e-460c-ab58-1e5b44827491",
      "name": "Structured Output Parser",
      "type": "@n8n/n8n-nodes-langchain.outputParserStructured",
      "position": [
        432,
        208
      ]
    },
    {
      "id": "ead09816-98d8-442f-af2a-24ec186f4279",
      "name": "Parse Expenses with AI",
      "type": "@n8n/n8n-nodes-langchain.chainLlm",
      "position": [
        224,
        0
      ]
    },
    {
      "id": "ba58f8fa-7bba-4eb4-9276-e29bbd0a9135",
      "name": "Append to Google Sheet",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        1056,
        16
      ]
    },
    {
      "id": "d65ced97-b390-4c65-9f0c-d62100c27abd",
      "name": "Wait 0.5 seconds",
      "type": "n8n-nodes-base.wait",
      "position": [
        1264,
        16
      ]
    },
    {
      "id": "b4b6cd46-e379-4384-9a9c-84a133258a0c",
      "name": "Send Telegram Confirmation",
      "type": "n8n-nodes-base.telegram",
      "position": [
        1968,
        -32
      ]
    },
    {
      "id": "a53bba6f-067f-4f5a-8ecb-43c13b1cbe10",
      "name": "Split Out",
      "type": "n8n-nodes-base.splitOut",
      "position": [
        576,
        0
      ]
    },
    {
      "id": "bebffb6b-fba5-4cc1-b2fc-d2e411a0322b",
      "name": "Loop Over Items",
      "type": "n8n-nodes-base.splitInBatches",
      "position": [
        848,
        0
      ]
    },
    {
      "id": "f96ba471-26c0-49d7-a598-75c7250970c7",
      "name": "Telegram Message Trigger",
      "type": "n8n-nodes-base.telegramTrigger",
      "position": [
        -928,
        16
      ]
    },
    {
      "id": "93c9787e-0762-4353-acc7-ad1af68c1ad6",
      "name": "Check if Audio file",
      "type": "n8n-nodes-base.if",
      "position": [
        -704,
        16
      ]
    },
    {
      "id": "1e00fabd-b1f6-47b9-9ea6-98752e8606b7",
      "name": "Transcribe audio",
      "type": "@n8n/n8n-nodes-langchain.openAi",
      "position": [
        -256,
        -80
      ]
    },
    {
      "id": "d79a073d-16b5-47c3-a5c2-309467909892",
      "name": "Set field",
      "type": "n8n-nodes-base.set",
      "position": [
        -256,
        112
      ]
    },
    {
      "id": "789e3937-56ae-4184-9bff-756e28e8a49d",
      "name": "Merge",
      "type": "n8n-nodes-base.merge",
      "position": [
        1456,
        -32
      ]
    },
    {
      "id": "7b9b778b-67ed-4f7b-a9cd-ce3a99187512",
      "name": "Get File",
      "type": "n8n-nodes-base.telegram",
      "position": [
        -480,
        -80
      ]
    },
    {
      "id": "7a049246-8692-4ca2-92d7-6044ce0f5fe8",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1088,
        -624
      ],
      "parameters": {
        "width": 416,
        "height": 208,
        "content": "### 🛠️ Troubleshooting  \n- **Missing rows?** Increase the Wait time to 800–1200 ms.  \n- **AI returns no expenses?** Check that your message includes numbers and merchants.  \n- **Google Sheets errors?*"
      }
    },
    {
      "id": "cec5f58e-0599-4885-ad84-3c5fc2a136e5",
      "name": "Build Expense Summary Text",
      "type": "n8n-nodes-base.code",
      "position": [
        864,
        -160
      ]
    },
    {
      "id": "e63af906-3ac2-4b91-a528-aa82b3bc0a21",
      "name": "Build Confirmation Text",
      "type": "n8n-nodes-base.set",
      "position": [
        1664,
        -32
      ]
    },
    {
      "id": "3bae6da9-7466-4b8d-99bc-40ff66f37441",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1760,
        0
      ],
      "parameters": {
        "width": 672,
        "height": 288,
        "content": "### 🔧 Setup Instructions  \n1. Connect credentials: **Telegram**, **Google**, **OpenAI**.  \n2. Create a Google Sheet with headers:  \n   `Date | Category | Merchant | Amount | Note`  \n3. Copy your Sheet"
      }
    },
    {
      "id": "e9678959-c7f9-4cff-9f29-065fee86fc6a",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1760,
        -624
      ],
      "parameters": {
        "width": 672,
        "height": 624,
        "content": "### 📌 Purpose  \nLog multiple expenses directly from Telegram into Google Sheets — using either text or audio messages.\n\nThis workflow is for anyone who wants a **fast, low-effort way to track expenses"
      }
    },
    {
      "id": "0f45caec-6049-4a2b-bf3a-ff39cc305fc8",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -960,
        -288
      ],
      "parameters": {
        "width": 960,
        "height": 608,
        "content": "### 🎤 Telegram Input & Transcription  \nThis section receives a Telegram message, detects if it's audio, and transcribes it when needed.\n\nWhy: We want the user to be able to log expenses hands-free thr"
      }
    },
    {
      "id": "d25f9ad8-c964-4c49-a02e-d92316937094",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        112,
        -288
      ],
      "parameters": {
        "width": 624,
        "height": 640,
        "content": "### 🤖 AI Parsing & Expense Extraction  \nThis section uses AI to identify all expenses in the message, splits them into individual items, and prepares them for Google Sheets.\n\nWhy: A single message may"
      }
    },
    {
      "id": "205d3995-05cd-491b-a9b6-3c7d7229e12f",
      "name": "Sticky Note5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        784,
        -336
      ],
      "parameters": {
        "width": 1408,
        "height": 688,
        "content": "### 📊 Write to Sheets & Send Confirmation  \nThis section loops through each expense, writes it to Google Sheets, builds a summary, and sends a confirmation back to Telegram.\n\nWhy: Users need quick fee"
      }
    }
  ],
  "connections": {
    "Merge": {
      "main": [
        [
          {
            "node": "Build Confirmation Text",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get File": {
      "main": [
        [
          {
            "node": "Transcribe audio",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Set field": {
      "main": [
        [
          {
            "node": "Parse Expenses with AI",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Split Out": {
      "main": [
        [
          {
            "node": "Loop Over Items",
            "type": "main",
            "index": 0
          },
          {
            "node": "Build Expense Summary Text",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Loop Over Items": {
      "main": [
        [
          {
            "node": "Merge",
            "type": "main",
            "index": 1
          }
        ],
        [
          {
            "node": "Append to Google Sheet",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Transcribe audio": {
      "main": [
        [
          {
            "node": "Parse Expenses with AI",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Wait 0.5 seconds": {
      "main": [
        [
          {
            "node": "Loop Over Items",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "Parse Expenses with AI",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Check if Audio file": {
      "main": [
        [
          {
            "node": "Get File",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Set field",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Append to Google Sheet": {
      "main": [
        [
          {
            "node": "Wait 0.5 seconds",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Parse Expenses with AI": {
      "main": [
        [
          {
            "node": "Split Out",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Build Confirmation Text": {
      "main": [
        [
          {
            "node": "Send Telegram Confirmation",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Structured Output Parser": {
      "ai_outputParser": [
        [
          {
            "node": "Parse Expenses with AI",
            "type": "ai_outputParser",
            "index": 0
          }
        ]
      ]
    },
    "Telegram Message Trigger": {
      "main": [
        [
          {
            "node": "Check if Audio file",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Build Expense Summary Text": {
      "main": [
        [
          {
            "node": "Merge",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Send Telegram Confirmation": {
      "main": [
        []
      ]
    }
  }
}