{
  "name": "Gmail to Zendesk ticket automation with Google Sheets logging",
  "nodes": [
    {
      "id": "b03d5eff-2f3b-4e15-a51e-23eb72c9e75c",
      "name": "Gmail Trigger",
      "type": "n8n-nodes-base.gmailTrigger",
      "position": [
        0,
        -192
      ]
    },
    {
      "id": "85a31be9-8035-4b6c-b929-ef4f67888658",
      "name": "Create Zendesk Ticket",
      "type": "n8n-nodes-base.zendesk",
      "position": [
        432,
        -192
      ]
    },
    {
      "id": "581ccd96-d11d-436d-86d4-a4162da65f32",
      "name": "Format Sheet Data",
      "type": "n8n-nodes-base.code",
      "position": [
        656,
        -192
      ]
    },
    {
      "id": "076cea59-4b20-40b8-ab61-61c23c0e5b42",
      "name": "Log to Google Sheets",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        880,
        -192
      ]
    },
    {
      "id": "033dae10-a4ed-435c-9fcf-67c911603189",
      "name": "Normalize Gmail Data",
      "type": "n8n-nodes-base.code",
      "position": [
        208,
        -192
      ]
    },
    {
      "id": "4543e98f-003c-43ab-8638-24c5e7e4f3e8",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -352,
        -240
      ],
      "parameters": {
        "width": 272,
        "height": 208,
        "content": "## Gmail Trigger\nListens for new emails from the configured Gmail account/label and emits each message once with headers, subject, body (plain/HTML), sender, recipients, timestamp, and attachment meta"
      }
    },
    {
      "id": "895dac87-ef0d-4285-9dcb-5573ad09a273",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        96,
        -480
      ],
      "parameters": {
        "width": 272,
        "height": 208,
        "content": "## Normalize Gmail Data\nTransforms the raw Gmail payload into a consistent schema (e.g., requesterEmail, subject, bodyText/bodyHtml, threadId, messageId, labels, attachments[]) to ensure reliable fiel"
      }
    },
    {
      "id": "6c123420-9b3e-403e-81cd-1f731406156e",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        352,
        -16
      ],
      "parameters": {
        "width": 272,
        "height": 224,
        "content": "## Create Zendesk Ticket (create: ticket)\nCreates a Zendesk ticket using normalized fields: requester (email), subject, description (plain text or HTML), optional priority/tags/group/assignee. Outputs"
      }
    },
    {
      "id": "c9671dc8-391d-4579-a6b9-853946c169b5",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        560,
        -496
      ],
      "parameters": {
        "width": 272,
        "height": 224,
        "content": "## Format Sheet Data\nBuilds a tidy row object combining Gmail and Zendesk outputs (e.g., timestamp, requesterEmail, subject, ticketId, ticketUrl, status, threadId, labels, workflowRunId). Ensures colu"
      }
    },
    {
      "id": "dff72fb5-c0cb-478e-b9a9-5bde17971ecf",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        800,
        -16
      ],
      "parameters": {
        "width": 272,
        "height": 224,
        "content": "## Log to Google Sheets \nWrites the row to the target spreadsheet—appending new records or updating existing ones using a unique key (e.g., messageId or ticketId). Confirms success and surfaces any wr"
      }
    }
  ],
  "connections": {
    "Gmail Trigger": {
      "main": [
        [
          {
            "node": "Normalize Gmail Data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Format Sheet Data": {
      "main": [
        [
          {
            "node": "Log to Google Sheets",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Normalize Gmail Data": {
      "main": [
        [
          {
            "node": "Create Zendesk Ticket",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Create Zendesk Ticket": {
      "main": [
        [
          {
            "node": "Format Sheet Data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}