{
  "meta": {
    "templateCredsSetupCompleted": true
  },
  "nodes": [
    {
      "id": "d1334412-af92-48bd-a6bd-9046cf1b193c",
      "name": "\ud83e\uddfe Workflow Overview",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        16,
        0
      ],
      "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 airtable.\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 Airtable\n- \ud83d\udcf1 Mobile-friendly uploads\n\n\n**Perfect for:**\n\n- Business expense reporting\n- Personal finance tracking\n- Accounting automation\n- Travel expenses\n\n\n**Requirements:**\n\n- VLM Run API from dashboard\n- Google Drive & Airtable OAuth2"
      },
      "typeVersion": 1
    },
    {
      "id": "61adceb3-a1de-4d37-814b-6bb1e99a4448",
      "name": "\ud83d\udcc1 Input Processing Documentation",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        432,
        0
      ],
      "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\n**Supported Formats:**\n- Images (JPG, PNG, WEBP)\n- PDF documents\n- Mobile camera uploads\n- Scanned receipts"
      },
      "typeVersion": 1
    },
    {
      "id": "83857d8b-460a-4e3f-8feb-10bd8d46c967",
      "name": "\ud83e\udd16 AI Extraction Documentation",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        848,
        0
      ],
      "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\n**Features:**\n- Handles poor quality images\n- Various receipt formats\n- OCR text recognition"
      },
      "typeVersion": 1
    },
    {
      "id": "f02b1746-2cb1-4d74-8af4-7a58ed1fbeb2",
      "name": "\ud83d\udcca Storage Documentation",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1264,
        0
      ],
      "parameters": {
        "color": 7,
        "width": 420,
        "height": 680,
        "content": "## \ud83d\udcbe Airtable Storage \n\n**Stores as new record (Airtable node)**\n- Saves parsed receipt data into your Airtable base and table \u2705\n- Maps each extracted field to matching Airtable columns \ud83d\udcca\n\n\n**Field types used**\n- **Date** \u2192 *Date with time* \u23f0\n- **Amount** \u2192 *Currency or Number (2 decimals)* \ud83d\udcb5\n- **Currency** \u2192 *Single select or Text* (e.g., USD, EUR, BDT)\n* **Customer, Merchant** \u2192 *Text* \u270d\ufe0f\n"
      },
      "typeVersion": 1
    },
    {
      "id": "4caddc75-a47c-4579-9221-cf196c378ca9",
      "name": "Monitor Receipt Uploads",
      "type": "n8n-nodes-base.googleDriveTrigger",
      "notes": "Monitors Google Drive folder for new receipt uploads and triggers processing automatically.",
      "position": [
        480,
        480
      ],
      "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"
        }
      },
      "credentials": {
        "googleDriveOAuth2Api": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "ea3b0627-b6ac-4df9-8075-8acb7b3e31b9",
      "name": "Download  Receipt File",
      "type": "n8n-nodes-base.googleDrive",
      "notes": "Downloads receipt files from Google Drive for AI processing.",
      "position": [
        688,
        480
      ],
      "parameters": {
        "fileId": {
          "__rl": true,
          "mode": "id",
          "value": "={{ $json.id }}"
        },
        "options": {
          "binaryPropertyName": "data"
        },
        "operation": "download"
      },
      "credentials": {
        "googleDriveOAuth2Api": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 3
    },
    {
      "id": "d9ee2098-00eb-4bc8-9e6b-a8f8c903f441",
      "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": [
        1008,
        480
      ],
      "parameters": {
        "domain": "document.receipt"
      },
      "credentials": {
        "vlmRunApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "d98486c3-6ac6-4341-87ff-2d8006e194e0",
      "name": "Format Receipt Data",
      "type": "n8n-nodes-base.set",
      "notes": "Transforms AI-extracted receipt data into clean, structured format for spreadsheet storage.",
      "position": [
        1328,
        480
      ],
      "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": "921e5c79-9211-4cd6-af7d-7584a09a40b1",
      "name": "Create a record",
      "type": "n8n-nodes-base.airtable",
      "position": [
        1504,
        480
      ],
      "parameters": {
        "base": {
          "__rl": true,
          "mode": "list",
          "value": "appuQQOmev4FlXUlz",
          "cachedResultUrl": "https://airtable.com/appuQQOmev4FlXUlz",
          "cachedResultName": "Receipt Data"
        },
        "table": {
          "__rl": true,
          "mode": "list",
          "value": "tblAlP7xMFINzScRN",
          "cachedResultUrl": "https://airtable.com/appuQQOmev4FlXUlz/tblAlP7xMFINzScRN",
          "cachedResultName": "Tasks"
        },
        "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,
              "readOnly": false,
              "required": false,
              "displayName": "Customer",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Merchant",
              "type": "string",
              "display": true,
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "Merchant",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Amount",
              "type": "number",
              "display": true,
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "Amount",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Currency",
              "type": "number",
              "display": true,
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "Currency",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Date",
              "type": "dateTime",
              "display": true,
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "Date",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            }
          ],
          "mappingMode": "defineBelow",
          "matchingColumns": [],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {},
        "operation": "create",
        "authentication": "airtableOAuth2Api"
      },
      "credentials": {
        "airtableOAuth2Api": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 2.1
    }
  ],
  "connections": {
    "Format Receipt Data": {
      "main": [
        [
          {
            "node": "Create a record",
            "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
          }
        ]
      ]
    }
  }
}