{
  "name": "Automate invoice analysis via Telegram with ChatGPT-4o-mini extraction",
  "nodes": [
    {
      "id": "b6433fae-ab23-4504-bf1c-07d98177799e",
      "name": "Telegram Trigger",
      "type": "n8n-nodes-base.telegramTrigger",
      "position": [
        -464,
        32
      ]
    },
    {
      "id": "e631a3ed-6930-4da7-a5dc-f33b4c852426",
      "name": "Check if Document",
      "type": "n8n-nodes-base.if",
      "position": [
        -304,
        32
      ]
    },
    {
      "id": "a22e54b3-e4e0-4b67-8e8f-ef9a5f163fdb",
      "name": "Get File from Telegram",
      "type": "n8n-nodes-base.telegram",
      "position": [
        -128,
        -64
      ]
    },
    {
      "id": "e93556dc-7af4-4e7d-9cb0-82aa0da39ed8",
      "name": "HTTP Request - Download File",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        32,
        -64
      ]
    },
    {
      "id": "aebfd1a1-bb29-4dbe-af72-4a6e986d4f79",
      "name": "Extract Invoice Data",
      "type": "n8n-nodes-base.extractFromFile",
      "position": [
        176,
        -64
      ]
    },
    {
      "id": "c9bf8764-2bc9-4861-b477-bbb60d516f34",
      "name": "AI Agent - Analyze Invoice",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        320,
        -64
      ]
    },
    {
      "id": "baead0ff-8676-4e77-9084-bd28484fc797",
      "name": "OpenAI Chat Model",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        320,
        128
      ]
    },
    {
      "id": "c149851f-3c38-4827-b1e9-14dbdbdd9172",
      "name": "Format Response",
      "type": "n8n-nodes-base.code",
      "position": [
        576,
        -64
      ]
    },
    {
      "id": "b6c9a341-c390-4d8e-8ab7-ef7896bf87b4",
      "name": "Send Analysis to Telegram",
      "type": "n8n-nodes-base.telegram",
      "position": [
        720,
        -64
      ]
    },
    {
      "id": "267e3223-6e60-432e-bb6d-980c2821b0e5",
      "name": "Send Error Message",
      "type": "n8n-nodes-base.telegram",
      "position": [
        -128,
        112
      ]
    },
    {
      "id": "2f8e4a85-0db5-421a-93c1-b5a5cc8c701c",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1024,
        -256
      ],
      "parameters": {
        "width": 544,
        "height": 624,
        "content": "## Introduction\nUpload invoices via Telegram, receive structured data instantly. Perfect for accountants and finance teams.\n## How It Works\nTelegram bot receives invoices, downloads files, extracts da"
      }
    },
    {
      "id": "80d92c1c-d7b6-47ae-8f9d-8520e61708a8",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        512,
        112
      ],
      "parameters": {
        "width": 320,
        "height": 288,
        "content": "## Prerequisites\n- n8n instance\n- Telegram Bot Token\n- OpenAI API key\n## Customization\n- Database storage\n- Accounting software integration\n## Benefits\n- Eliminates manual entry\n- Reduces errors"
      }
    }
  ],
  "connections": {
    "Format Response": {
      "main": [
        [
          {
            "node": "Send Analysis to Telegram",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Telegram Trigger": {
      "main": [
        [
          {
            "node": "Check if Document",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Check if Document": {
      "main": [
        [
          {
            "node": "Get File from Telegram",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Send Error Message",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "AI Agent - Analyze Invoice",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Extract Invoice Data": {
      "main": [
        [
          {
            "node": "AI Agent - Analyze Invoice",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get File from Telegram": {
      "main": [
        [
          {
            "node": "HTTP Request - Download File",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "AI Agent - Analyze Invoice": {
      "main": [
        [
          {
            "node": "Format Response",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "HTTP Request - Download File": {
      "main": [
        [
          {
            "node": "Extract Invoice Data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}