{
  "name": "Automated expense tracking with AI receipt analysis & Google Sheets",
  "nodes": [
    {
      "id": null,
      "name": "Format Summary Message",
      "type": "n8n-nodes-base.code",
      "position": [
        -1160,
        -660
      ]
    },
    {
      "id": null,
      "name": "Start: Telegram Input",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -3460,
        -1000
      ],
      "parameters": {
        "width": null,
        "height": null,
        "content": ""
      }
    },
    {
      "id": null,
      "name": "Check Invalid Input",
      "type": "n8n-nodes-base.if",
      "position": [
        -760,
        -660
      ]
    },
    {
      "id": null,
      "name": "Extract Text Input",
      "type": "n8n-nodes-base.set",
      "position": [
        -2580,
        -660
      ]
    },
    {
      "id": null,
      "name": "Check for Image",
      "type": "n8n-nodes-base.if",
      "position": [
        -3100,
        -860
      ]
    },
    {
      "id": null,
      "name": "Input Type Check",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -3140,
        -1000
      ],
      "parameters": {
        "width": null,
        "height": null,
        "content": ""
      }
    },
    {
      "id": null,
      "name": "Receipt Parser",
      "type": "@n8n/n8n-nodes-langchain.outputParserStructured",
      "position": [
        -1320,
        200
      ]
    },
    {
      "id": null,
      "name": "Send Error Message",
      "type": "n8n-nodes-base.telegram",
      "position": [
        -400,
        -800
      ]
    },
    {
      "id": null,
      "name": "Send Expense Summary",
      "type": "n8n-nodes-base.telegram",
      "position": [
        -400,
        -460
      ]
    },
    {
      "id": null,
      "name": "Extract Value From Image",
      "type": "n8n-nodes-tesseractjs.tesseractNode",
      "position": [
        -1600,
        -1040
      ]
    },
    {
      "id": null,
      "name": "Notify User: Send Summary",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -520,
        -560
      ],
      "parameters": {
        "width": null,
        "height": null,
        "content": ""
      }
    },
    {
      "id": null,
      "name": "Handle Text Input",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -2660,
        -800
      ],
      "parameters": {
        "width": null,
        "height": null,
        "content": ""
      }
    },
    {
      "id": null,
      "name": "Structure AI Output",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1620,
        -120
      ],
      "parameters": {
        "width": null,
        "height": null,
        "content": ""
      }
    },
    {
      "id": null,
      "name": "Download Receipt Image",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -2660,
        -1160
      ],
      "parameters": {
        "width": null,
        "height": null,
        "content": ""
      }
    },
    {
      "id": null,
      "name": "Extract Text from Image (OCR)",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1680,
        -1160
      ],
      "parameters": {
        "width": null,
        "height": null,
        "content": ""
      }
    },
    {
      "id": null,
      "name": "Format Summary for User",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1240,
        -780
      ],
      "parameters": {
        "width": null,
        "height": null,
        "content": ""
      }
    },
    {
      "id": null,
      "name": "AI Data Extraction",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1680,
        -780
      ],
      "parameters": {
        "width": null,
        "height": null,
        "content": ""
      }
    },
    {
      "id": null,
      "name": "Notify User: Send Error",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -520,
        -900
      ],
      "parameters": {
        "width": null,
        "height": null,
        "content": ""
      }
    },
    {
      "id": null,
      "name": "Validate Extracted Data",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -840,
        -780
      ],
      "parameters": {
        "width": null,
        "height": null,
        "content": ""
      }
    },
    {
      "id": null,
      "name": "Configure AI Model",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -2040,
        -120
      ],
      "parameters": {
        "width": null,
        "height": null,
        "content": ""
      }
    },
    {
      "id": null,
      "name": "Telegram Trigger1",
      "type": "n8n-nodes-base.telegramTrigger",
      "position": [
        -3400,
        -860
      ]
    },
    {
      "id": null,
      "name": "Google Gemini Chat Model",
      "type": "@n8n/n8n-nodes-langchain.lmChatGoogleGemini",
      "position": [
        -1840,
        200
      ]
    },
    {
      "id": null,
      "name": "Telegram",
      "type": "n8n-nodes-base.telegram",
      "position": [
        -2580,
        -1040
      ]
    },
    {
      "id": null,
      "name": "AI Agent",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        -1660,
        -660
      ]
    },
    {
      "id": null,
      "name": "Auto-fixing Output Parser",
      "type": "@n8n/n8n-nodes-langchain.outputParserAutofixing",
      "position": [
        -1480,
        -20
      ]
    },
    {
      "id": null,
      "name": "Simple Memory",
      "type": "@n8n/n8n-nodes-langchain.memoryBufferWindow",
      "position": [
        -1640,
        -380
      ]
    },
    {
      "id": null,
      "name": "Think",
      "type": "@n8n/n8n-nodes-langchain.toolThink",
      "position": [
        -1160,
        -380
      ]
    },
    {
      "id": null,
      "name": "Date & Time",
      "type": "n8n-nodes-base.dateTimeTool",
      "position": [
        -1260,
        -380
      ]
    },
    {
      "id": null,
      "name": "Mistral Cloud Chat Model",
      "type": "@n8n/n8n-nodes-langchain.lmChatMistralCloud",
      "position": [
        -2000,
        20
      ]
    },
    {
      "id": null,
      "name": "Mistral Cloud Chat Model1",
      "type": "@n8n/n8n-nodes-langchain.lmChatMistralCloud",
      "position": [
        -1560,
        200
      ]
    },
    {
      "id": null,
      "name": "Send Expense Summary1",
      "type": "n8n-nodes-base.telegram",
      "position": [
        860,
        -720
      ]
    },
    {
      "id": null,
      "name": "Google Sheets",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        520,
        -720
      ]
    },
    {
      "id": null,
      "name": "Edit Fields",
      "type": "n8n-nodes-base.set",
      "position": [
        180,
        -720
      ]
    },
    {
      "id": null,
      "name": "Save Image to Cloud",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1700,
        -1780
      ],
      "parameters": {
        "width": null,
        "height": null,
        "content": ""
      }
    },
    {
      "id": null,
      "name": "OpenAI Chat Model",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        -2000,
        200
      ]
    },
    {
      "id": null,
      "name": "OpenRouter Chat Model",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenRouter",
      "position": [
        -1840,
        20
      ]
    },
    {
      "id": null,
      "name": "Execute Workflow",
      "type": "n8n-nodes-base.executeWorkflow",
      "position": [
        820,
        -1680
      ]
    },
    {
      "id": null,
      "name": "When Executed by Another Workflow",
      "type": "n8n-nodes-base.executeWorkflowTrigger",
      "position": [
        840,
        -1180
      ]
    },
    {
      "id": null,
      "name": "Save Receipt",
      "type": "n8n-nodes-base.googleDrive",
      "position": [
        -1620,
        -1700
      ]
    },
    {
      "id": null,
      "name": "Merge",
      "type": "n8n-nodes-base.merge",
      "position": [
        160,
        -1680
      ]
    },
    {
      "id": null,
      "name": "Merge Data Streams",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        80,
        -1800
      ],
      "parameters": {
        "width": null,
        "height": null,
        "content": ""
      }
    },
    {
      "id": null,
      "name": "Trigger Save Workflow",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        740,
        -1800
      ],
      "parameters": {
        "width": null,
        "height": null,
        "content": ""
      }
    },
    {
      "id": null,
      "name": "Prepare Data for Sheet",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        120,
        -840
      ],
      "parameters": {
        "width": null,
        "height": null,
        "content": ""
      }
    },
    {
      "id": null,
      "name": "Save Data to Google Sheets",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        440,
        -840
      ],
      "parameters": {
        "width": null,
        "height": null,
        "content": ""
      }
    },
    {
      "id": null,
      "name": "Send Confirmation",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        780,
        -840
      ],
      "parameters": {
        "width": null,
        "height": null,
        "content": ""
      }
    },
    {
      "id": null,
      "name": "Future Ideas & Improvements",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1120,
        -840
      ],
      "parameters": {
        "width": null,
        "height": null,
        "content": ""
      }
    },
    {
      "id": null,
      "name": "Mistral Upload",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -1600,
        -1360
      ]
    },
    {
      "id": null,
      "name": "Mistral Signed URL",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -1280,
        -1360
      ]
    },
    {
      "id": null,
      "name": "Mistral DOC OCR",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -960,
        -1360
      ]
    },
    {
      "id": null,
      "name": "Code",
      "type": "n8n-nodes-base.code",
      "position": [
        -640,
        -1360
      ]
    },
    {
      "id": null,
      "name": "Extract Text via API (OCR)",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1680,
        -1480
      ],
      "parameters": {
        "width": null,
        "height": null,
        "content": ""
      }
    }
  ],
  "connections": {
    "Code": {
      "main": [
        [
          {
            "node": "AI Agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Merge": {
      "main": [
        [
          {
            "node": "Execute Workflow",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Think": {
      "ai_tool": [
        [
          {
            "node": "AI Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "AI Agent": {
      "main": [
        [
          {
            "node": "Format Summary Message",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Telegram": {
      "main": [
        [
          {
            "node": "Save Receipt",
            "type": "main",
            "index": 0
          },
          {
            "node": "Extract Value From Image",
            "type": "main",
            "index": 0
          },
          {
            "node": "Mistral Upload",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Date & Time": {
      "ai_tool": [
        [
          {
            "node": "AI Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Edit Fields": {
      "main": [
        [
          {
            "node": "Google Sheets",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Save Receipt": {
      "main": [
        [
          {
            "node": "Merge",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Google Sheets": {
      "main": [
        [
          {
            "node": "Send Expense Summary1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Simple Memory": {
      "ai_memory": [
        [
          {
            "node": "AI Agent",
            "type": "ai_memory",
            "index": 0
          }
        ]
      ]
    },
    "Mistral Upload": {
      "main": [
        [
          {
            "node": "Mistral Signed URL",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Receipt Parser": {
      "ai_outputParser": [
        [
          {
            "node": "Auto-fixing Output Parser",
            "type": "ai_outputParser",
            "index": 0
          }
        ]
      ]
    },
    "Check for Image": {
      "main": [
        [
          {
            "node": "Telegram",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Extract Text Input",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Mistral DOC OCR": {
      "main": [
        [
          {
            "node": "Code",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Telegram Trigger1": {
      "main": [
        [
          {
            "node": "Check for Image",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Extract Text Input": {
      "main": [
        [
          {
            "node": "AI Agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Mistral Signed URL": {
      "main": [
        [
          {
            "node": "Mistral DOC OCR",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Check Invalid Input": {
      "main": [
        [
          {
            "node": "Send Error Message",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Send Expense Summary",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Send Expense Summary": {
      "main": [
        [
          {
            "node": "Merge",
            "type": "main",
            "index": 1
          }
        ]
      ]
    },
    "Format Summary Message": {
      "main": [
        [
          {
            "node": "Check Invalid Input",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Extract Value From Image": {
      "main": [
        [
          {
            "node": "AI Agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Google Gemini Chat Model": {
      "ai_languageModel": [
        []
      ]
    },
    "Mistral Cloud Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "AI Agent",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Auto-fixing Output Parser": {
      "ai_outputParser": [
        [
          {
            "node": "AI Agent",
            "type": "ai_outputParser",
            "index": 0
          }
        ]
      ]
    },
    "Mistral Cloud Chat Model1": {
      "ai_languageModel": [
        [
          {
            "node": "Auto-fixing Output Parser",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "When Executed by Another Workflow": {
      "main": [
        [
          {
            "node": "Edit Fields",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}