{
  "name": "Route Gmail support emails to Zendesk with spam filtering and duplicate checks",
  "nodes": [
    {
      "id": "3ae5ec4d-60ad-42a0-8479-2b3d20c191a9",
      "name": "New Support Email Trigger",
      "type": "n8n-nodes-base.gmailTrigger",
      "position": [
        -160,
        16
      ]
    },
    {
      "id": "bec74235-dabc-44a0-91e0-bc86861ff2a5",
      "name": "Spam Detection & Filtering",
      "type": "n8n-nodes-base.code",
      "position": [
        304,
        16
      ]
    },
    {
      "id": "3c20ee8a-b80c-44d6-84fa-fed064265ec5",
      "name": "Extract & Normalize Email Data",
      "type": "n8n-nodes-base.set",
      "position": [
        736,
        16
      ]
    },
    {
      "id": "fb6264e5-fc17-488a-8b5c-a52cc38ddccf",
      "name": "Auto-Tag Ticket Based on Email Content",
      "type": "n8n-nodes-base.code",
      "position": [
        1008,
        -96
      ]
    },
    {
      "id": "f7c03701-9a47-44d1-a1d1-4bb07bee340a",
      "name": "Zendesk – Fetch Existing Tickets",
      "type": "n8n-nodes-base.zendesk",
      "position": [
        1008,
        80
      ]
    },
    {
      "id": "6481eb72-b926-4030-842a-a428d05e78f8",
      "name": "Merge Email With Existing Tickets",
      "type": "n8n-nodes-base.merge",
      "position": [
        1456,
        16
      ]
    },
    {
      "id": "aa789d1a-232d-458f-b75b-b3c9641843ce",
      "name": "Detect Duplicate Ticket by Subject",
      "type": "n8n-nodes-base.code",
      "position": [
        1648,
        16
      ]
    },
    {
      "id": "43b0a0d4-3dfa-4e87-9072-7476c677a857",
      "name": "Is This a New Ticket?",
      "type": "n8n-nodes-base.if",
      "position": [
        1840,
        16
      ]
    },
    {
      "id": "28ae617a-65fa-4418-bf8d-7bc8b0b21f26",
      "name": "Create Zendesk Support Ticket",
      "type": "n8n-nodes-base.zendesk",
      "position": [
        2256,
        32
      ]
    },
    {
      "id": "e1aeb752-3e5a-4551-bf2e-c58041665ca3",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -320,
        -144
      ],
      "parameters": {
        "width": 432,
        "height": 400,
        "content": "## Incoming Support Email Trigger\nThis section listens for new customer messages sent to the support inbox. Whenever a new email arrives, the workflow automatically starts, ensuring no customer reques"
      }
    },
    {
      "id": "dce28e0f-3cd2-4ce5-9ab4-99123d8a0a81",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        160,
        -144
      ],
      "parameters": {
        "width": 448,
        "height": 400,
        "content": "## Spam Detection & Early Filtering\nThis section checks the email subject, message content and sender domain to detect spam. Any suspicious or unwanted emails are stopped immediately, ensuring only ge"
      }
    },
    {
      "id": "140ce5ba-548e-4445-a947-caa3f90c51cc",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        656,
        -304
      ],
      "parameters": {
        "width": 576,
        "height": 560,
        "content": "## Prepare Email Data & Check Existing Tickets\nThis section cleans and structures incoming email data by extracting customer details, message content and tags. It then retrieves existing Zendesk ticke"
      }
    },
    {
      "id": "72c9bac5-55d5-4a3d-ae74-fbadc329a549",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1344,
        -144
      ],
      "parameters": {
        "width": 720,
        "height": 384,
        "content": "## Duplicate Detection & Validation\nIn this section, the incoming email is compared with existing Zendesk tickets. By checking normalized subjects and identifiers, the workflow determines whether the "
      }
    },
    {
      "id": "83d7aeb4-324c-4fef-afd8-89a0ba3e4cd2",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2128,
        -144
      ],
      "parameters": {
        "width": 432,
        "height": 384,
        "content": "## Zendesk Ticket Creation\nThis final section creates a new support ticket in Zendesk using the cleaned and validated data. The ticket includes customer details, message content, priority, tags and ex"
      }
    },
    {
      "id": "768133f1-3878-410d-afd9-72b310c06472",
      "name": "Sticky Note5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1056,
        -704
      ],
      "parameters": {
        "width": 624,
        "height": 720,
        "content": "## How It Works\nThis workflow automatically converts customer support emails into structured Zendesk tickets while keeping the support system clean and organized. It starts when a new email arrives in"
      }
    }
  ],
  "connections": {
    "Is This a New Ticket?": {
      "main": [
        [],
        [
          {
            "node": "Create Zendesk Support Ticket",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "New Support Email Trigger": {
      "main": [
        [
          {
            "node": "Spam Detection & Filtering",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Spam Detection & Filtering": {
      "main": [
        [
          {
            "node": "Extract & Normalize Email Data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Extract & Normalize Email Data": {
      "main": [
        [
          {
            "node": "Auto-Tag Ticket Based on Email Content",
            "type": "main",
            "index": 0
          },
          {
            "node": "Zendesk – Fetch Existing Tickets",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Merge Email With Existing Tickets": {
      "main": [
        [
          {
            "node": "Detect Duplicate Ticket by Subject",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Detect Duplicate Ticket by Subject": {
      "main": [
        [
          {
            "node": "Is This a New Ticket?",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Zendesk – Fetch Existing Tickets": {
      "main": [
        [
          {
            "node": "Merge Email With Existing Tickets",
            "type": "main",
            "index": 1
          }
        ]
      ]
    },
    "Auto-Tag Ticket Based on Email Content": {
      "main": [
        [
          {
            "node": "Merge Email With Existing Tickets",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}