{
  "name": "Automate Gmail inbox organization with rule-based categorization and smart actions",
  "nodes": [
    {
      "id": "a81015eb-1a7b-4832-8506-f84835713f21",
      "name": "New Email Received",
      "type": "n8n-nodes-base.gmailTrigger",
      "position": [
        -1380,
        100
      ]
    },
    {
      "id": "9ab80617-5aa2-4c1a-9d5a-aab0c4387a45",
      "name": "Categorize Email by Content",
      "type": "n8n-nodes-base.switch",
      "position": [
        -1080,
        100
      ]
    },
    {
      "id": "ab60dc70-310e-4e7f-97d5-21a29d2c771d",
      "name": "Apply Work Label",
      "type": "n8n-nodes-base.gmail",
      "position": [
        -780,
        -60
      ]
    },
    {
      "id": "6d74ae5c-fd8b-4b6f-8cb8-7500dd88e091",
      "name": "Apply Shopping Label",
      "type": "n8n-nodes-base.gmail",
      "position": [
        -780,
        100
      ]
    },
    {
      "id": "f365dfaf-18b3-46e4-9d3a-bebefa47e422",
      "name": "Apply Newsletter Label",
      "type": "n8n-nodes-base.gmail",
      "position": [
        -780,
        240
      ]
    },
    {
      "id": "1b9ca166-9430-427f-9179-0ca6fcca702c",
      "name": "Mark Work Email as Important",
      "type": "n8n-nodes-base.gmail",
      "position": [
        -480,
        -60
      ]
    },
    {
      "id": "814ee0b2-f75a-49aa-9fb4-87424b73d199",
      "name": "Archive Newsletter Email",
      "type": "n8n-nodes-base.gmail",
      "position": [
        -480,
        240
      ]
    },
    {
      "id": "266c2c00-6ec6-42b6-bf45-24717edc1bb9",
      "name": "Main Workflow Explanation",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -2020,
        -400
      ],
      "parameters": {
        "width": 450,
        "height": 1000,
        "content": "# 📧 Gmail Smart Email Organizer\n\n## What This Workflow Does\nAutomatically organizes your Gmail inbox by categorizing incoming emails and applying appropriate labels and actions based on sender and sub"
      }
    },
    {
      "id": "5f96a973-6add-441e-a509-b4e94e33342e",
      "name": "Step 1 - Email Detection",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1400,
        -380
      ],
      "parameters": {
        "width": 300,
        "height": 260,
        "content": "## Step 1: Email Detection\n\n**Gmail Trigger** monitors your inbox and triggers the workflow when new emails arrive.\n\n**Polling**: Every minute\n**Setup**: Requires Gmail OAuth2 connection"
      }
    },
    {
      "id": "0ea0e02b-fdfd-434d-a731-7c665bff1701",
      "name": "Step 2 - Smart Categorization",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -880,
        -420
      ],
      "parameters": {
        "width": 300,
        "height": 280,
        "content": "## Step 2: Smart Categorization\n\n**Switch Node** analyzes email content using multiple conditions:\n- Sender domain/email\n- Subject keywords\n- Common patterns\n\n**Routes to**: Work, Shopping, Newsletter"
      }
    },
    {
      "id": "277ab3e7-95a6-4df3-ac77-e5cf37df1c55",
      "name": "Step 3 - Automated Actions",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -360,
        -380
      ],
      "parameters": {
        "width": 350,
        "height": 260,
        "content": "## Step 3: Automated Actions\n\n**Gmail Nodes** perform category-specific actions:\n\n🔹 **Work Emails**: Add 'Work' label + Mark as Important\n🔹 **Shopping**: Add 'Shopping' label\n🔹 **Newsletter**: Add 'Ne"
      }
    }
  ],
  "connections": {
    "Apply Work Label": {
      "main": [
        [
          {
            "node": "Mark Work Email as Important",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "New Email Received": {
      "main": [
        [
          {
            "node": "Categorize Email by Content",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Apply Newsletter Label": {
      "main": [
        [
          {
            "node": "Archive Newsletter Email",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Categorize Email by Content": {
      "main": [
        [
          {
            "node": "Apply Work Label",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Apply Shopping Label",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Apply Newsletter Label",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}