{
  "name": "Gmail attachment manager with Google Drive upload and smart filtering",
  "nodes": [
    {
      "id": "fc56a7c7-e89d-46f6-88d1-a6b4c8ce7364",
      "name": "Mark read and archive email",
      "type": "n8n-nodes-base.gmail",
      "position": [
        -80,
        -80
      ]
    },
    {
      "id": "1327a765-2c40-40ef-929f-dfb0790cf048",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -928,
        -560
      ],
      "parameters": {
        "width": 1344,
        "height": 432,
        "content": "## Information\nTemplate created by Smultron Studio (https://smultronstudio.com/en) - feel free to reach out at hello@smultronstudio.com\n\n### Instructions (numbers refer to red cards):\n1. Configure cre"
      }
    },
    {
      "id": "f50f6e40-1b10-48da-9440-1cffe6f6d323",
      "name": "Send a message",
      "type": "n8n-nodes-base.slack",
      "position": [
        592,
        -336
      ]
    },
    {
      "id": "5c972c0f-dc9f-4056-a4b5-99bd62ea1a83",
      "name": "Trigger on incoming email with attachment",
      "type": "n8n-nodes-base.gmailTrigger",
      "position": [
        -864,
        80
      ]
    },
    {
      "id": "d4504562-3549-4d70-8b60-37e8c027adc7",
      "name": "Filter based on file type",
      "type": "n8n-nodes-base.filter",
      "position": [
        144,
        144
      ]
    },
    {
      "id": "75ebfebd-0d76-45e1-b722-6ebcc159460d",
      "name": "Treat different file types different",
      "type": "n8n-nodes-base.switch",
      "position": [
        368,
        128
      ]
    },
    {
      "id": "e653ee4e-cf13-4d51-b43b-79920f5add10",
      "name": "Decompress zip",
      "type": "n8n-nodes-base.compression",
      "position": [
        528,
        48
      ]
    },
    {
      "id": "faf61d9d-2e43-4c6c-b23c-08c85042e1fe",
      "name": "Post file to webhook",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        1056,
        272
      ]
    },
    {
      "id": "f96f3ca8-fa1a-4f0c-b0a3-e7b6d9527a72",
      "name": "Loop attachments",
      "type": "n8n-nodes-base.splitInBatches",
      "position": [
        -272,
        80
      ]
    },
    {
      "id": "febc18da-137c-4759-b21d-ec1910778a98",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -928,
        -112
      ],
      "parameters": {
        "width": 1904,
        "height": 560,
        "content": ""
      }
    },
    {
      "id": "9ebd9a7e-bc46-4d8c-81b9-c621394683a0",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        432,
        -560
      ],
      "parameters": {
        "width": 544,
        "height": 432,
        "content": "## Notification out\nNotify in Slack that files has been processed"
      }
    },
    {
      "id": "512d195b-ffab-42db-9c60-dd9f60cde8fe",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        720,
        64
      ],
      "parameters": {
        "width": 192,
        "height": 448,
        "content": "## 6. Upload file somewhere\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nConfigure or replace this node with some other destination for your files."
      }
    },
    {
      "id": "44de5019-f2fd-4c87-bc91-a3c789b18ae5",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        96,
        16
      ],
      "parameters": {
        "width": 192,
        "height": 496,
        "content": "## 4. Filter based on file type\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nIf you expect one or more file types, you can specify that here. \n\nOr if you only want to process a specific file type in emails with multiple attach"
      }
    },
    {
      "id": "3260063c-d547-418e-af65-2de4f80eaf35",
      "name": "Sticky Note5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        320,
        0
      ],
      "parameters": {
        "width": 368,
        "height": 512,
        "content": "## 5. Treat different file types separate\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nIf you expect multiple file types that requires different processing, build those paths here (like decompressing zip files). \n\nIf you fil"
      }
    },
    {
      "id": "79a0bfcf-c12a-4c78-af7a-7174a9f6c8e0",
      "name": "Sticky Note6",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -912,
        -16
      ],
      "parameters": {
        "width": 192,
        "height": 272,
        "content": "## 1. Trigger\nConfigure your credentials here"
      }
    },
    {
      "id": "f25b842d-2324-42f2-9f4a-847098d2669f",
      "name": "Sticky Note7",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -128,
        -176
      ],
      "parameters": {
        "width": 192,
        "height": 288,
        "content": "## 2. Archive\nConfigure your credentials here"
      }
    },
    {
      "id": "367f6c68-5b16-4062-8be8-8a5094b24c0a",
      "name": "Sticky Note8",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -704,
        -16
      ],
      "parameters": {
        "width": 208,
        "height": 272,
        "content": "## 3. Filter sender/receiver\n"
      }
    },
    {
      "id": "16094578-c919-4cd3-8a6b-4bf730426f11",
      "name": "Sticky Note9",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        544,
        -448
      ],
      "parameters": {
        "width": null,
        "height": 288,
        "content": "## 7. Slack notification\nConfigure your credentials here"
      }
    },
    {
      "id": "35253661-cf9c-414d-a0ad-b9f4bf9fa83a",
      "name": "Upload file to Google Drive",
      "type": "n8n-nodes-base.googleDrive",
      "position": [
        768,
        160
      ]
    },
    {
      "id": "44a5eaa9-181c-4871-9a66-00927e293dd0",
      "name": "Sticky Note10",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        992,
        176
      ],
      "parameters": {
        "width": 256,
        "height": 272,
        "content": "## 8. Example\nThis is a webhook example to replace the Google Drive node (6)"
      }
    },
    {
      "id": "95604855-1bf5-485c-bd31-65b4352b6cec",
      "name": "Filter based on sender or receiver",
      "type": "n8n-nodes-base.filter",
      "position": [
        -656,
        80
      ]
    },
    {
      "id": "87a1ecf3-63d8-4bb4-9426-f4c9afbc40e7",
      "name": "Split Out",
      "type": "n8n-nodes-base.splitOut",
      "position": [
        -448,
        80
      ]
    }
  ],
  "connections": {
    "Split Out": {
      "main": [
        [
          {
            "node": "Loop attachments",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Decompress zip": {
      "main": [
        [
          {
            "node": "Upload file to Google Drive",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Send a message": {
      "main": [
        []
      ]
    },
    "Loop attachments": {
      "main": [
        [
          {
            "node": "Mark read and archive email",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Filter based on file type",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Post file to webhook": {
      "main": [
        []
      ]
    },
    "Filter based on file type": {
      "main": [
        [
          {
            "node": "Treat different file types different",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Mark read and archive email": {
      "main": [
        [
          {
            "node": "Send a message",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Upload file to Google Drive": {
      "main": [
        [
          {
            "node": "Loop attachments",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Filter based on sender or receiver": {
      "main": [
        [
          {
            "node": "Split Out",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Treat different file types different": {
      "main": [
        [
          {
            "node": "Decompress zip",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Loop attachments",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Upload file to Google Drive",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Trigger on incoming email with attachment": {
      "main": [
        [
          {
            "node": "Filter based on sender or receiver",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}