{
  "name": "Automatic Gmail invoice PDF upload to Google Drive with spreadsheet logging",
  "nodes": [
    {
      "id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
      "name": "Gmail Trigger",
      "type": "n8n-nodes-base.gmailTrigger",
      "position": [
        224,
        304
      ]
    },
    {
      "id": "note1-2345-6789-abcd-ef1234567891",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        128,
        80
      ],
      "parameters": {
        "width": 280,
        "height": 216,
        "content": "## 📧 Gmail Trigger\nThis node monitors your Gmail inbox for new emails containing invoices. It checks every minute for unread emails with 'invoice' in the subject line and downloads any PDF attachments"
      }
    },
    {
      "id": "filter-node-123-456-789-abcdef123456",
      "name": "Has PDF Attachments?",
      "type": "n8n-nodes-base.filter",
      "position": [
        448,
        304
      ]
    },
    {
      "id": "note2-3456-7890-bcde-f12345678902",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        432,
        480
      ],
      "parameters": {
        "width": 260,
        "height": 140,
        "content": "## 🔍 Filter Check\nThis filter ensures we only process emails that actually have attachments (PDFs). Emails without attachments are filtered out."
      }
    },
    {
      "id": "gdrive-upload-123-456-789-abcdef654321",
      "name": "Upload to Google Drive",
      "type": "n8n-nodes-base.googleDrive",
      "position": [
        896,
        304
      ]
    },
    {
      "id": "note3-4567-8901-cdef-234567890123",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        864,
        80
      ],
      "parameters": {
        "width": 300,
        "height": 180,
        "content": "## 📁 Google Drive Upload\nEach PDF attachment is uploaded to your Google Drive. Files are named using the original filename or a timestamp if not available.\n\n**Configure:** \n- Connect Google Drive cred"
      }
    },
    {
      "id": "gsheets-append-123-456-789-fedcba098765",
      "name": "Log to Google Sheets",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        1120,
        304
      ]
    },
    {
      "id": "note4-5678-9012-def0-345678901234",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        896,
        496
      ],
      "parameters": {
        "width": 320,
        "height": 240,
        "content": "## 📊 Google Sheets Logging\nRecords invoice details in a spreadsheet including:\n- Date/time received\n- Sender email\n- Subject line\n- PDF filename\n- Google Drive link\n- File and Email IDs\n\n**Configure:*"
      }
    },
    {
      "id": "gmail-mark-read-123-456-789-0987654321ab",
      "name": "Mark Email as Read",
      "type": "n8n-nodes-base.gmail",
      "position": [
        1344,
        304
      ]
    },
    {
      "id": "note5-6789-0123-ef01-456789012345",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1376,
        112
      ],
      "parameters": {
        "width": 280,
        "height": null,
        "content": "## ✅ Mark as Processed\nAfter successfully uploading the PDF and logging to sheets, the original email is marked as read so it won't be processed again.\n\n**Note:** Uses same Gmail credentials as trigge"
      }
    },
    {
      "id": "note6-7890-1234-f012-567890123456",
      "name": "Sticky Note5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -272,
        336
      ],
      "parameters": {
        "width": 400,
        "height": 424,
        "content": "## 🚀 Setup Instructions\n\n1. **Gmail OAuth2**: Connect your Gmail account in all Gmail nodes\n2. **Google Drive OAuth2**: Connect your Google Drive account\n3. **Google Sheets OAuth2**: Connect your Goog"
      }
    },
    {
      "id": "5f57d83d-03a6-4729-aa66-a8ad05d946d6",
      "name": "If",
      "type": "n8n-nodes-base.if",
      "position": [
        672,
        304
      ]
    }
  ],
  "connections": {
    "If": {
      "main": [
        [
          {
            "node": "Upload to Google Drive",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Gmail Trigger": {
      "main": [
        [
          {
            "node": "Has PDF Attachments?",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Has PDF Attachments?": {
      "main": [
        [
          {
            "node": "If",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Log to Google Sheets": {
      "main": [
        [
          {
            "node": "Mark Email as Read",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Upload to Google Drive": {
      "main": [
        [
          {
            "node": "Log to Google Sheets",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}