{
  "name": "Extract data from Gmail attachments to Google Sheets using DocuPipe",
  "nodes": [
    {
      "id": "2ca247ef-c2a6-4dfa-8d2e-44b9dcd660da",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -700,
        -260
      ],
      "parameters": {
        "width": 520,
        "height": 1020,
        "content": "## Gmail to DocuPipe to Google Sheets\n\nAutomatically extract structured data from Gmail attachments using [DocuPipe](https://docupipe.ai) AI and save results to Google Sheets.\n\n### Who is this for?\nTe"
      }
    },
    {
      "id": "87eed9b6-3b44-447b-8a66-788822214597",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -60,
        -120
      ],
      "parameters": {
        "width": 1200,
        "height": 380,
        "content": "## Scenario 1 - Upload Gmail Attachments to DocuPipe\nNew emails with attachments are detected via Gmail, labeled as \"Processing\", and the attachment is uploaded to DocuPipe for AI-powered extraction. "
      }
    },
    {
      "id": "6ce37a48-62c4-4a0c-ba2a-9f0d8cb7d26e",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -60,
        300
      ],
      "parameters": {
        "width": 1420,
        "height": 440,
        "content": "## Scenario 2 - Process Extraction Results & Save to Google Sheets\nWhen DocuPipe completes extraction, the webhook triggers this flow. The extracted data is fetched, processed into a flat row-friendly"
      }
    },
    {
      "id": "99eb2c64-4cc6-49fd-a740-39a307c4ce96",
      "name": "New Email with Attachment",
      "type": "n8n-nodes-base.gmailTrigger",
      "position": [
        0,
        60
      ]
    },
    {
      "id": "8080664f-a497-42a3-bbda-7f40e401a0e9",
      "name": "Label as Processing",
      "type": "n8n-nodes-base.gmail",
      "position": [
        240,
        60
      ]
    },
    {
      "id": "2c9bebea-a1e7-4326-b04b-9793dac52385",
      "name": "Upload Attachment & Extract Data",
      "type": "n8n-nodes-docupipe.docuPipe",
      "position": [
        480,
        60
      ]
    },
    {
      "id": "d8032eef-623b-4a70-abd8-e7371fc8fa26",
      "name": "Save Attachment to Drive",
      "type": "n8n-nodes-base.googleDrive",
      "position": [
        720,
        60
      ]
    },
    {
      "id": "27348bf8-b8d7-4847-b7cb-64846e5162f0",
      "name": "Extraction Complete",
      "type": "n8n-nodes-docupipe.docuPipeTrigger",
      "position": [
        0,
        480
      ]
    },
    {
      "id": "7dffada2-a8d6-450e-816d-283e25bdf835",
      "name": "Get Extracted Data",
      "type": "n8n-nodes-docupipe.docuPipe",
      "position": [
        260,
        480
      ]
    },
    {
      "id": "6a696708-42e0-4950-ab5b-2b852c48e51b",
      "name": "Process Extraction Result",
      "type": "n8n-nodes-base.code",
      "position": [
        520,
        480
      ]
    },
    {
      "id": "a9f73223-58ec-44de-9ed7-84816d88c196",
      "name": "Add Metadata",
      "type": "n8n-nodes-base.set",
      "position": [
        780,
        480
      ]
    },
    {
      "id": "7523e33e-7698-4123-82a7-67d6849a31fe",
      "name": "Append Row to Spreadsheet",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        1040,
        480
      ]
    }
  ],
  "connections": {
    "Add Metadata": {
      "main": [
        [
          {
            "node": "Append Row to Spreadsheet",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Extracted Data": {
      "main": [
        [
          {
            "node": "Process Extraction Result",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Extraction Complete": {
      "main": [
        [
          {
            "node": "Get Extracted Data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Label as Processing": {
      "main": [
        [
          {
            "node": "Upload Attachment & Extract Data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "New Email with Attachment": {
      "main": [
        [
          {
            "node": "Label as Processing",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Process Extraction Result": {
      "main": [
        [
          {
            "node": "Add Metadata",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Upload Attachment & Extract Data": {
      "main": [
        [
          {
            "node": "Save Attachment to Drive",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}