{
  "name": "Transform support tickets into AI documentation with GPT-4, PDFs and Google Drive",
  "nodes": [
    {
      "id": "61dc2aa7-ac6c-4397-bcbc-ad6014d1b117",
      "name": "Webhook - Receive Ticket",
      "type": "n8n-nodes-base.webhook",
      "position": [
        -2352,
        240
      ]
    },
    {
      "id": "3a08bb55-109b-4bce-ae0c-1a8bd6bd8233",
      "name": "📝 Sticky Note - Trigger Setup",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -2688,
        48
      ],
      "parameters": {
        "width": 468,
        "height": 804,
        "content": "## 🎯 STEP 1: TRIGGER\n\n**Purpose:** Captures incoming resolved support tickets\n\n**Options:**\n1. **Webhook** (Current) - Most flexible, works with any tool\n2. **IMAP Email** - For email-based tickets\n3."
      }
    },
    {
      "id": "01277a43-c6fa-4a85-bb95-5e6fa1b096ff",
      "name": "Extract Ticket Details",
      "type": "n8n-nodes-base.code",
      "position": [
        -2064,
        240
      ]
    },
    {
      "id": "8e5339a1-47ac-466a-a5ab-ae753c10864a",
      "name": "📝 Sticky Note - Data Extraction",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -2192,
        -528
      ],
      "parameters": {
        "width": 404,
        "height": 904,
        "content": "## 📋 STEP 2: DATA EXTRACTION\n\n**Purpose:** Normalizes ticket data from different sources\n\n**What this node does:**\n- Extracts ticket ID, subject, description\n- Gets customer and agent information\n- Re"
      }
    },
    {
      "id": "708ee78b-72c0-4a45-b334-8cdd845f9af8",
      "name": "AI Summarization (OpenAI)",
      "type": "@n8n/n8n-nodes-langchain.openAi",
      "position": [
        -1728,
        240
      ]
    },
    {
      "id": "aa238d8e-b227-4bf1-b3c7-218457f58e4c",
      "name": "📝 Sticky Note - AI Summarization",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1760,
        -560
      ],
      "parameters": {
        "width": 452,
        "height": 916,
        "content": "## 🤖 STEP 3: AI SUMMARIZATION\n\n**Purpose:** Generates professional case study documentation\n\n**Model Used:** GPT-4o (or gpt-3.5-turbo)\n\n**What the AI does:**\n- Analyzes the full ticket context\n- Ident"
      }
    },
    {
      "id": "6ce3cdf9-7619-4f8a-973a-a0021a22e13d",
      "name": "Format HTML Document",
      "type": "n8n-nodes-base.code",
      "position": [
        -1152,
        240
      ]
    },
    {
      "id": "7d4c30c8-8872-44fd-88d4-5f9b160a7799",
      "name": "📝 Sticky Note - HTML Formatting",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1296,
        -752
      ],
      "parameters": {
        "width": 436,
        "height": 1116,
        "content": "## 🎨 STEP 4: HTML FORMATTING\n\n**Purpose:** Creates professional, branded PDF-ready HTML\n\n**What this node does:**\n- Combines ticket data with AI summary\n- Applies professional styling and branding\n- C"
      }
    },
    {
      "id": "75a14225-69a2-4db7-8dd3-d3e03b172f4a",
      "name": "📝 Sticky Note - PDF Conversion",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -832,
        -272
      ],
      "parameters": {
        "width": 420,
        "height": 668,
        "content": "## 📄 STEP 5: PDF CONVERSION\n\n**Purpose:** Converts HTML to professional PDF document\n\n**Node:** HTML Extract/Convert node\n\n**Configuration:**\n- **Operation:** Convert HTML to PDF\n- **Input:** HTML con"
      }
    },
    {
      "id": "34506c7f-ea7b-4d6f-9213-940cd56d6d37",
      "name": "Check PDF Success",
      "type": "n8n-nodes-base.if",
      "position": [
        -240,
        240
      ]
    },
    {
      "id": "867a398d-8eca-4327-9555-6b153ba01c02",
      "name": "📝 Sticky Note - Error Check",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -368,
        -608
      ],
      "parameters": {
        "width": 372,
        "height": 980,
        "content": "## ⚠️ STEP 6: ERROR CHECK #1\n\n**Purpose:** Validates PDF was generated successfully\n\n**Logic:**\n- Checks if URL exists\n- Verifies PDF is not empty\n- Routes to error handler if failed\n\n**Condition:**\n-"
      }
    },
    {
      "id": "726984c8-2e34-4881-9c99-4b07de711263",
      "name": "Upload to Google Drive",
      "type": "n8n-nodes-base.googleDrive",
      "position": [
        560,
        112
      ]
    },
    {
      "id": "7eb6e69c-c2e4-4f9a-8b4b-e8e3a5cd8258",
      "name": "📝 Sticky Note - Drive Upload",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        400,
        -944
      ],
      "parameters": {
        "width": 420,
        "height": 1208,
        "content": "## ☁️ STEP 7: GOOGLE DRIVE UPLOAD\n\n**Purpose:** Saves PDF to organized cloud storage\n\n**Configuration:**\n- **Resource:** File\n- **Operation:** Upload\n- **Input:** Binary PDF data from previous node\n- "
      }
    },
    {
      "id": "56bcd853-4095-4b0c-9bb0-d24f22dd8ed9",
      "name": "Capture Drive URL",
      "type": "n8n-nodes-base.set",
      "position": [
        880,
        112
      ]
    },
    {
      "id": "ecfdb162-21d7-4126-95fb-939aa0392065",
      "name": "Check Upload Success",
      "type": "n8n-nodes-base.if",
      "position": [
        1264,
        112
      ]
    },
    {
      "id": "f6be4bde-7607-46a2-b720-e97dfeea3e77",
      "name": "📝 Sticky Note - Upload Check",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1024,
        -864
      ],
      "parameters": {
        "width": 388,
        "height": 1120,
        "content": "## ⚠️ STEP 8: ERROR CHECK #2\n\n**Purpose:** Validates Drive upload succeeded\n\n**Verification:**\n- Checks if file URL was returned\n- Confirms file ID is valid\n- Ensures upload completed\n\n**Condition:**\n"
      }
    },
    {
      "id": "d66117e3-612e-4d2e-8630-154076c8d07a",
      "name": "Update Google Sheets",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        1600,
        -96
      ]
    },
    {
      "id": "896eb68c-5576-4584-ace7-ad48a2826d28",
      "name": "📝 Sticky Note - Database",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1456,
        -1440
      ],
      "parameters": {
        "width": 420,
        "height": 1528,
        "content": "## STEP 9: DATABASE UPDATE\n\n**Purpose:** Tracks all documented tickets in centralized log\n\n**Database Option:** Google Sheets (can replace with Airtable, HubSpot, etc.)\n\n**Setup Instructions:**\n1. Cre"
      }
    },
    {
      "id": "3fbf74bf-4418-4109-94c2-196a3e760e69",
      "name": "Send Slack Notification",
      "type": "n8n-nodes-base.slack",
      "position": [
        2016,
        -96
      ]
    },
    {
      "id": "f92ee144-07fe-474a-b3d8-6047b8fe1db3",
      "name": "📝 Sticky Note - Slack",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1920,
        -1184
      ],
      "parameters": {
        "width": 420,
        "height": 1240,
        "content": "## 💬 STEP 10: SLACK NOTIFICATION\n\n**Purpose:** Notifies team that ticket is documented\n\n**Configuration:**\n- **Channel:** #support-team (or your channel)\n- **Format:** Rich markdown message\n- **Conten"
      }
    },
    {
      "id": "1259aa69-0636-4229-a0f9-072f024e068e",
      "name": "Error - PDF Failed",
      "type": "n8n-nodes-base.slack",
      "position": [
        208,
        464
      ]
    },
    {
      "id": "8ed1117f-2e16-4718-bc33-ea313098dc94",
      "name": "Error - Upload Failed",
      "type": "n8n-nodes-base.slack",
      "position": [
        1584,
        240
      ]
    },
    {
      "id": "bed85817-521b-4b79-9205-549d1a4f348b",
      "name": "📝 Sticky Note - Error Handling",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1504,
        224
      ],
      "parameters": {
        "width": 372,
        "height": 1308,
        "content": "\n\n\n\n\n\n\n\n\n\n\n\n\n## ERROR HANDLING\n\n**Purpose:** Catches and reports workflow failures\n\n**Error Scenarios Handled:**\n\n1. **PDF Generation Failed**\n   - Invalid HTML syntax\n   - Memory/timeout errors\n   - "
      }
    },
    {
      "id": "48380fdf-d2e4-4a0a-9f1d-dd7213df7061",
      "name": "📝 Sticky Note - Completion Guide",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2672,
        -800
      ],
      "parameters": {
        "width": 604,
        "height": 1228,
        "content": "## 🎉 WORKFLOW COMPLETE!\n\n**Congratulations!** Your automated support ticket documentation system is ready.\n\n**What You've Built:**\n✅ Automatic ticket capture from support tool\n✅ AI-powered intelligent"
      }
    },
    {
      "id": "df0d9c67-d252-45a0-91c5-ba6b73ec2b83",
      "name": "HTML to PDF",
      "type": "n8n-nodes-htmlcsstopdf.htmlcsstopdf",
      "position": [
        -704,
        240
      ]
    },
    {
      "id": "3e02523d-6776-466d-9233-2520e25c6647",
      "name": "HTTP Request",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        160,
        112
      ]
    },
    {
      "id": "b8cd13d5-994a-4c59-9c14-55f96cd44af4",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -2688,
        896
      ],
      "parameters": {
        "width": 480,
        "height": 1280,
        "content": "# Workflow Credentials Setup\n\n## Required Credentials\n\n### 1. OpenAI API\n- Get key from: https://platform.openai.com/api-keys\n- In n8n: Add credential → OpenAI API\n\n### 2. PDFMunk API\n- Get key from: "
      }
    },
    {
      "id": "1595445b-f5b9-47ce-a36d-9930bbd5083a",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        48,
        -528
      ],
      "parameters": {
        "width": 320,
        "height": 784,
        "content": "# PDF to Binary Conversion\n\n## Purpose\nDownloads PDF from PDFMunk URL and converts to binary data for Google Drive upload.\n\n## Configuration\n\n**Method:** GET\n\n**URL:** `{{ $json.pdf_url }}`\n\n**Authent"
      }
    }
  ],
  "connections": {
    "HTML to PDF": {
      "main": [
        [
          {
            "node": "Check PDF Success",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "HTTP Request": {
      "main": [
        [
          {
            "node": "Upload to Google Drive",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Capture Drive URL": {
      "main": [
        [
          {
            "node": "Check Upload Success",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Check PDF Success": {
      "main": [
        [
          {
            "node": "HTTP Request",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Error - PDF Failed",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Check Upload Success": {
      "main": [
        [
          {
            "node": "Update Google Sheets",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Error - Upload Failed",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Format HTML Document": {
      "main": [
        [
          {
            "node": "HTML to PDF",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Update Google Sheets": {
      "main": [
        [
          {
            "node": "Send Slack Notification",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Extract Ticket Details": {
      "main": [
        [
          {
            "node": "AI Summarization (OpenAI)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Upload to Google Drive": {
      "main": [
        [
          {
            "node": "Capture Drive URL",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Webhook - Receive Ticket": {
      "main": [
        [
          {
            "node": "Extract Ticket Details",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "AI Summarization (OpenAI)": {
      "main": [
        [
          {
            "node": "Format HTML Document",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}