{
  "name": "Extract invoices from Gmail with Laiye ADP and save them to Google Drive",
  "nodes": [
    {
      "id": "0d9d5f81-fdd0-4ce3-a76b-63d5ff0115b7",
      "name": "Gmail Trigger",
      "type": "n8n-nodes-base.gmailTrigger",
      "position": [
        896,
        480
      ]
    },
    {
      "id": "aaec31d1-c60a-4fde-bbf7-6a9bac5e09da",
      "name": "Merge",
      "type": "n8n-nodes-base.merge",
      "position": [
        2192,
        544
      ]
    },
    {
      "id": "9960d10f-3231-4bbb-8265-9a051cced530",
      "name": "Upload Unprocessed file",
      "type": "n8n-nodes-base.googleDrive",
      "position": [
        2384,
        544
      ]
    },
    {
      "id": "6035c47b-6f5d-4d47-88bf-ad908cb55adf",
      "name": "Extract attachment information",
      "type": "n8n-nodes-base.code",
      "position": [
        1232,
        480
      ]
    },
    {
      "id": "c898a939-f009-414a-a57a-0cf935901aa7",
      "name": "Filter documents",
      "type": "n8n-nodes-base.if",
      "position": [
        1552,
        480
      ]
    },
    {
      "id": "7ed141be-6fd4-4729-b700-0d28039273bc",
      "name": "Base64 Encode Document",
      "type": "n8n-nodes-base.extractFromFile",
      "position": [
        1920,
        288
      ]
    },
    {
      "id": "fff5863f-fe64-4458-91df-25dfc423bf30",
      "name": "Laiye ADP HTTP Request",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        2160,
        288
      ]
    },
    {
      "id": "b45702da-c2c7-411b-a9b6-adeb511b37f4",
      "name": "Result Processor",
      "type": "n8n-nodes-base.code",
      "position": [
        2368,
        288
      ]
    },
    {
      "id": "d2224313-0c64-4b3e-9d0d-327e184eff88",
      "name": "Upload the extracted result document",
      "type": "n8n-nodes-base.googleDrive",
      "position": [
        2592,
        288
      ]
    },
    {
      "id": "3b44154e-b2cb-45c7-8b89-84584a0681e8",
      "name": "Create a pending folder",
      "type": "n8n-nodes-base.googleDrive",
      "position": [
        1952,
        640
      ]
    },
    {
      "id": "34d8cd58-5538-40cd-8525-b4f67029b927",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        208,
        320
      ],
      "parameters": {
        "width": 528,
        "height": 560,
        "content": "## How it works\nThis workflow automates the full invoice processing pipeline: it monitors Gmail for invoice emails, extracts key data from multiple file formats, and automatically organizes files into"
      }
    },
    {
      "id": "a050a268-fc08-4eea-b6cf-4a1178e539ac",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        816,
        656
      ],
      "parameters": {
        "width": 272,
        "height": 112,
        "content": "**Step 1: Connect your Gmail account.**\n\nYou can set the execution frequency here. The default is once per day."
      }
    },
    {
      "id": "1e948b3e-5089-4b3a-b9b1-0f39f19a3c3c",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1472,
        240
      ],
      "parameters": {
        "width": 256,
        "height": 224,
        "content": "**File Filter Tips:**\n\n1. You can edit``` {{ $json.attachment_name }}``` to use your own filter keywords.\n2. We recommend not modifying file size and format settings to ensure smooth execution with th"
      }
    },
    {
      "id": "be830e84-3cf6-4480-bbf5-ade1c44f69ea",
      "name": "Sticky Note5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1840,
        256
      ],
      "parameters": {
        "width": 976,
        "height": 560,
        "content": ""
      }
    },
    {
      "id": "08414006-ae87-4ff1-bc81-6c004d8edc8b",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1840,
        848
      ],
      "parameters": {
        "width": 368,
        "height": 80,
        "content": "**Step 2: Connect your Google Drive.**\n\nEnsure all files are safely stored in Google Drive."
      }
    }
  ],
  "connections": {
    "Merge": {
      "main": [
        [
          {
            "node": "Upload Unprocessed file",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Gmail Trigger": {
      "main": [
        [
          {
            "node": "Extract attachment information",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Filter documents": {
      "main": [
        [
          {
            "node": "Base64 Encode Document",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Create a pending folder",
            "type": "main",
            "index": 0
          },
          {
            "node": "Merge",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Result Processor": {
      "main": [
        [
          {
            "node": "Upload the extracted result document",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Base64 Encode Document": {
      "main": [
        [
          {
            "node": "Laiye ADP HTTP Request",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Laiye ADP HTTP Request": {
      "main": [
        [
          {
            "node": "Result Processor",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Create a pending folder": {
      "main": [
        [
          {
            "node": "Merge",
            "type": "main",
            "index": 1
          }
        ]
      ]
    },
    "Extract attachment information": {
      "main": [
        [
          {
            "node": "Filter documents",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}