{
  "id": "UzjlcNQAWoWPTBlh",
  "meta": {
    "templateCredsSetupCompleted": true
  },
  "name": "My workflow",
  "tags": [],
  "nodes": [
    {
      "id": "6e82969f-c696-4544-805b-acf50b525894",
      "name": "\ud83e\uddfe Workflow Overview",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -176,
        -16
      ],
      "parameters": {
        "color": 7,
        "width": 400,
        "height": 680,
        "content": "## \ud83e\uddfe AI Receipt Data Extraction Workflow\n\n**Overview:**\nAutomates receipt processing for expense management. Upload receipts to Google Drive \u2192 VLM Run extracts data \u2192 Saves to spreadsheet.\n\n**Key Features:**\n- \ud83d\udcc1 Auto-monitors Google Drive folder\n- \ud83e\udd16 Extracts merchant, amount, date, currency\n- \ud83d\udcca Saves structured data to Google Sheets\n- \ud83d\udcf1 Mobile-friendly uploads\n\n**Perfect for:**\n- Business expense reporting\n- Personal finance tracking\n- Accounting automation\n- Travel expenses\n\n**Requirements:**\n- VLM Run API\n- Google Drive & Sheets OAuth2"
      },
      "typeVersion": 1
    },
    {
      "id": "09152ec5-6101-441d-a58a-40b8644b2368",
      "name": "\ud83d\udcc1 Input Processing Documentation",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        256,
        -16
      ],
      "parameters": {
        "color": 7,
        "width": 400,
        "height": 680,
        "content": "## \ud83d\udcc1 Input Processing\n\n**Monitors & downloads receipt files from Google Drive.**\n\n**Process:**\n1. Watches designated Drive folder\n2. Auto-triggers on new uploads\n3. Downloads files for AI processing\n\n**Supported Formats:**\n- Images (JPG, PNG, WEBP)\n- PDF documents\n- Mobile camera uploads\n- Scanned receipts"
      },
      "typeVersion": 1
    },
    {
      "id": "bec1401d-79b0-4192-b40a-0be5afe121f9",
      "name": "\ud83e\udd16 AI Extraction Documentation",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        672,
        -16
      ],
      "parameters": {
        "width": 400,
        "height": 680,
        "content": "## \ud83e\udd16 VLM Run Receipt Extraction\n\n**Uses VLM Run node to extract structured data from receipt images/PDFs.**\n\n**Extracts:**\n- Merchant name\n- Customer info\n- Total amount\n- Currency\n- Transaction date\n\n**Features:**\n- Handles poor quality images\n- Various receipt formats\n- OCR text recognition"
      },
      "typeVersion": 1
    },
    {
      "id": "77f8bd06-a94c-407e-abf7-8a632c3cb847",
      "name": "\ud83d\udcca Storage Documentation",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1088,
        -16
      ],
      "parameters": {
        "color": 7,
        "width": 420,
        "height": 680,
        "content": "## \ud83d\udcca Data Storage\n\n**Structures and stores extracted data in Google Sheets.**\n\n**Features:**\n- Clean, organized format\n- Centralized expense database\n- Auto-appends new entries\n- Analysis-ready data\n\n**Data Fields:**\n- Customer name\n- Merchant name\n- Amount & currency\n- Transaction date\n\n**Benefits:**\n- Real-time tracking\n- Easy exports\n- Mobile access"
      },
      "typeVersion": 1
    },
    {
      "id": "1546d13f-a9c4-44ba-a477-d3f62dc431f8",
      "name": "Monitor Receipt Uploads",
      "type": "n8n-nodes-base.googleDriveTrigger",
      "notes": "Monitors Google Drive folder for new receipt uploads and triggers processing automatically.",
      "position": [
        304,
        464
      ],
      "parameters": {
        "event": "fileCreated",
        "options": {},
        "pollTimes": {
          "item": [
            {
              "mode": "everyMinute"
            }
          ]
        },
        "triggerOn": "specificFolder",
        "folderToWatch": {
          "__rl": true,
          "mode": "list",
          "value": "1reWORwI1tMa-eGB75NCXq9eRw4CiQIhX",
          "cachedResultUrl": "https://drive.google.com/drive/folders/1reWORwI1tMa-eGB75NCXq9eRw4CiQIhX",
          "cachedResultName": "n8n"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "2d9461de-94cd-470f-866a-da37ea9b9e66",
      "name": "Download  Receipt File",
      "type": "n8n-nodes-base.googleDrive",
      "notes": "Downloads receipt files from Google Drive for AI processing.",
      "position": [
        512,
        464
      ],
      "parameters": {
        "fileId": {
          "__rl": true,
          "mode": "id",
          "value": "={{ $json.id }}"
        },
        "options": {
          "binaryPropertyName": "data"
        },
        "operation": "download"
      },
      "typeVersion": 3
    },
    {
      "id": "2aade65f-8084-4206-b87c-9378790c7c26",
      "name": "VLM Run Receipt Parser",
      "type": "@vlm-run/n8n-nodes-vlmrun.vlmRun",
      "notes": "Uses VLM AI to extract merchant name, amount, currency, and date from receipt images.",
      "position": [
        832,
        464
      ],
      "parameters": {
        "domain": "document.receipt"
      },
      "credentials": {
        "vlmRunApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "bfa34d27-9b1a-4084-ad73-fe51b355e61b",
      "name": "Format Receipt Data",
      "type": "n8n-nodes-base.set",
      "notes": "Transforms AI-extracted receipt data into clean, structured format for spreadsheet storage.",
      "position": [
        1152,
        464
      ],
      "parameters": {
        "values": {
          "string": [
            {
              "name": "Customer",
              "value": "={{ $json.response.customer_name }}"
            },
            {
              "name": "Merchant",
              "value": "={{ $json.response.merchant_name }}"
            },
            {
              "name": "Amount",
              "value": "={{ $json.response.total }}"
            },
            {
              "name": "Currency",
              "value": "={{ $json.response.currency }}"
            },
            {
              "name": "Date",
              "value": "={{ $json.response.transaction_date }}"
            }
          ]
        },
        "options": {},
        "keepOnlySet": true
      },
      "typeVersion": 1
    },
    {
      "id": "689e122f-077d-4f53-96ab-4b9d76b42fe3",
      "name": "Save to Expense Database",
      "type": "n8n-nodes-base.googleSheets",
      "notes": "Automatically saves extracted receipt data to Google Sheets for expense tracking.",
      "position": [
        1328,
        464
      ],
      "parameters": {
        "columns": {
          "value": {
            "Date": "={{ $json.Date }}",
            "Amount": "={{ $json.Amount }}",
            "Currency": "={{ $json.Currency }}",
            "Customer": "={{ $json.Customer }}",
            "Merchant": "={{ $json.Merchant }}"
          },
          "schema": [
            {
              "id": "Customer",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "Customer",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Merchant",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "Merchant",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Amount",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "Amount",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Currency",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "Currency",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Date",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "Date",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            }
          ],
          "mappingMode": "defineBelow",
          "matchingColumns": [
            "Customer"
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {},
        "operation": "append",
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": "gid=0",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/11_VjMdhv_JN2eSRZiw_t0dIN-yShkn2jlCDwiG8eb14/edit#gid=0",
          "cachedResultName": "Sheet1"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "11_VjMdhv_JN2eSRZiw_t0dIN-yShkn2jlCDwiG8eb14",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/11_VjMdhv_JN2eSRZiw_t0dIN-yShkn2jlCDwiG8eb14/edit?usp=drivesdk",
          "cachedResultName": "Receipt Data"
        }
      },
      "typeVersion": 4.6
    }
  ],
  "active": false,
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "e051df12-21f0-4df9-bb0f-a98842e2c734",
  "connections": {
    "Format Receipt Data": {
      "main": [
        [
          {
            "node": "Save to Expense Database",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Download  Receipt File": {
      "main": [
        [
          {
            "node": "VLM Run Receipt Parser",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "VLM Run Receipt Parser": {
      "main": [
        [
          {
            "node": "Format Receipt Data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Monitor Receipt Uploads": {
      "main": [
        [
          {
            "node": "Download  Receipt File",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}