{
  "name": "Event ticketing backend: auto QR tickets with Google Sheets & Gmail",
  "nodes": [
    {
      "id": "06cc3525-a2a8-4b35-8436-73d03e43dbc7",
      "name": "Get Tickets",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        -240,
        -96
      ]
    },
    {
      "id": "4fe22443-1f46-4c85-8b93-670e2dfff603",
      "name": "Parse Barcode",
      "type": "n8n-nodes-base.code",
      "position": [
        -448,
        -96
      ]
    },
    {
      "id": "2276b656-ea51-4570-8896-d1fe28ebee45",
      "name": "Ticket Available?",
      "type": "n8n-nodes-base.if",
      "position": [
        -48,
        -96
      ]
    },
    {
      "id": "d5265744-f1a6-4590-9c45-462297c5b4c7",
      "name": "Parse Output",
      "type": "n8n-nodes-base.code",
      "position": [
        144,
        16
      ]
    },
    {
      "id": "2638bce7-9b67-491a-9bc1-8ffa2d08d4f8",
      "name": "Already Checked IN",
      "type": "n8n-nodes-base.respondToWebhook",
      "position": [
        320,
        16
      ]
    },
    {
      "id": "81b4773f-4728-4413-8950-12d79a27d257",
      "name": "Checked IN",
      "type": "n8n-nodes-base.respondToWebhook",
      "position": [
        320,
        -176
      ]
    },
    {
      "id": "8f9403c3-65b9-4a5b-956f-c31c1089c190",
      "name": "Update Ticket Status",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        144,
        -176
      ]
    },
    {
      "id": "b6b18e4b-f70e-4870-b649-83980feb360e",
      "name": "SCAN TICKET",
      "type": "n8n-nodes-base.webhook",
      "position": [
        -656,
        -96
      ]
    },
    {
      "id": "a77f808a-f8c8-4d68-9007-744aa8018245",
      "name": "Email exist?",
      "type": "n8n-nodes-base.if",
      "position": [
        -48,
        1168
      ]
    },
    {
      "id": "08943fee-59bc-4aac-b9cf-80662be21dca",
      "name": "Get Participant",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        -240,
        1168
      ]
    },
    {
      "id": "86af65a2-c014-4714-be6d-16083640acb4",
      "name": "Validate Input",
      "type": "n8n-nodes-base.code",
      "position": [
        -688,
        1328
      ]
    },
    {
      "id": "0bb8c7fa-59d8-4185-954f-3a0858924bc7",
      "name": "Validation Error",
      "type": "n8n-nodes-base.respondToWebhook",
      "position": [
        -240,
        1344
      ]
    },
    {
      "id": "76dbc60d-7078-4b6e-ad79-cbbcdde7a9e7",
      "name": "Valid Input?",
      "type": "n8n-nodes-base.if",
      "position": [
        -480,
        1328
      ]
    },
    {
      "id": "431640c5-e0a7-44e2-9b51-c11d0f6f6b6c",
      "name": "Already Registered",
      "type": "n8n-nodes-base.respondToWebhook",
      "position": [
        160,
        992
      ]
    },
    {
      "id": "b9f61154-8a8b-4ea9-ae62-a1b9b316af72",
      "name": "Tiket Booked",
      "type": "n8n-nodes-base.respondToWebhook",
      "position": [
        368,
        1184
      ]
    },
    {
      "id": "63255ef1-df60-41cf-a262-e45e61636139",
      "name": "Store Data",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        160,
        1184
      ]
    },
    {
      "id": "f93e5fa3-4e4f-4909-9fbe-fb148cc743d3",
      "name": "REGISTER",
      "type": "n8n-nodes-base.webhook",
      "position": [
        -912,
        1328
      ]
    },
    {
      "id": "dd84a672-34c0-422d-a178-0a181fd37882",
      "name": "Get Rows",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        -736,
        416
      ]
    },
    {
      "id": "5d549b2f-14ca-4f42-b96d-8d01051c0351",
      "name": "Filter Paid Not Sent",
      "type": "n8n-nodes-base.filter",
      "position": [
        -512,
        416
      ]
    },
    {
      "id": "0adcf4d7-d1e6-4f8a-945a-b7346ffd69fc",
      "name": "Generate Ticket Data",
      "type": "n8n-nodes-base.code",
      "position": [
        -752,
        640
      ]
    },
    {
      "id": "f9c1609a-b102-452f-972d-12625e9403c6",
      "name": "Generate QR Code",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -480,
        640
      ]
    },
    {
      "id": "43c28eec-ecaa-4de2-aab6-c7efa392b232",
      "name": "Build HTML Email",
      "type": "n8n-nodes-base.code",
      "position": [
        -256,
        560
      ]
    },
    {
      "id": "641a85a1-0f76-4894-bd17-c9715f39eea1",
      "name": "Send Email (Gmail)",
      "type": "n8n-nodes-base.gmail",
      "position": [
        0,
        384
      ]
    },
    {
      "id": "bcfc2a0f-474b-4b9a-a652-52715cdf7e29",
      "name": "Update Sheet (Register)",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        272,
        560
      ]
    },
    {
      "id": "207cd6d4-0812-4547-8b28-c5c3725636bd",
      "name": "Update Sheet (Tickets)",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        16,
        736
      ]
    },
    {
      "id": "f99c03de-9578-456f-8443-e5fa2840e88e",
      "name": "START",
      "type": "n8n-nodes-base.scheduleTrigger",
      "position": [
        -960,
        416
      ]
    },
    {
      "id": "75d7c162-962b-4a07-80db-43ed07565987",
      "name": "Parse Data",
      "type": "n8n-nodes-base.code",
      "position": [
        16,
        560
      ]
    },
    {
      "id": "0b3858e2-2c61-4f1d-b6e6-45a7e3ce3ea6",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1008,
        -352
      ],
      "parameters": {
        "width": 1552,
        "height": 608,
        "content": ""
      }
    },
    {
      "id": "7b512e89-2626-4a2b-b24e-a4688d9e120b",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1008,
        288
      ],
      "parameters": {
        "width": 1552,
        "height": 608,
        "content": "# Ticket Generator & Sender\n"
      }
    },
    {
      "id": "cc7ab6b0-47ea-4e08-8ba8-5cbc0e470e2c",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1008,
        928
      ],
      "parameters": {
        "width": 1552,
        "height": 608,
        "content": "\n"
      }
    },
    {
      "id": "34074899-d8b0-4ae0-89be-3ac61046fd03",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        576,
        288
      ],
      "parameters": {
        "width": 512,
        "height": 608,
        "content": "# Event Ticketing System - Complete Flow\n\nThis workflow manages the full lifecycle of event ticketing:\n1. **Registration** - Accepts participant registration via webhook\n2. **Ticket Generation** - Aut"
      }
    },
    {
      "id": "33452a6b-f2cf-4acc-bfe1-fb2506e26cd6",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        576,
        928
      ],
      "parameters": {
        "width": 512,
        "height": 608,
        "content": "# Setup Required\n\nYou need these credentials configured:\n\n1. **Google Sheets OAuth2** \n   - Used for reading/writing registration & ticket data\n   - Connect your Google account in n8n credentials\n\n2. "
      }
    },
    {
      "id": "160db932-0e42-4b39-b39d-2654179c1c78",
      "name": "Sticky Note5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -992,
        -336
      ],
      "parameters": {
        "width": 480,
        "height": 496,
        "content": "# How Ticket Scanner Works\n\n**Endpoint**: POST `/v1/scanner`\n\n**Flow**:\n1. Receives scanned QR data\n2. Parses ticket_id from barcode JSON\n3. Looks up ticket in Google Sheets\n4. Validates:\n   - Ticket "
      }
    },
    {
      "id": "84430c98-7876-4ea9-9908-7f59c7718752",
      "name": "Sticky Note6",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -992,
        944
      ],
      "parameters": {
        "width": 512,
        "height": 352,
        "content": "# Registration Endpoint\n\n**Endpoint**: POST `/v1/register`\n\n**Expected Input**:\n```json\n{\n  \"nama\": \"string\",\n  \"email\": \"string\", \n  \"no_hp\": \"string\",\n  \"jumlah_tiket\": number,\n  \"total_price\": numb"
      }
    },
    {
      "id": "9cd7ba10-a91c-4134-a481-94df3bfde3c3",
      "name": "Sticky Note8",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        576,
        -352
      ],
      "parameters": {
        "width": 512,
        "height": 608,
        "content": "# Automatic Ticket Generation\n\n**Trigger**: Runs every 1 minute\n\n**What it does**:\n1. Finds paid registrations where Email Sent = NO\n2. Generates unique ticket IDs for each ticket\n3. Creates QR codes "
      }
    }
  ],
  "connections": {
    "START": {
      "main": [
        [
          {
            "node": "Get Rows",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Rows": {
      "main": [
        [
          {
            "node": "Filter Paid Not Sent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "REGISTER": {
      "main": [
        [
          {
            "node": "Validate Input",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Parse Data": {
      "main": [
        [
          {
            "node": "Update Sheet (Register)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Store Data": {
      "main": [
        [
          {
            "node": "Tiket Booked",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Tickets": {
      "main": [
        [
          {
            "node": "Ticket Available?",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "SCAN TICKET": {
      "main": [
        [
          {
            "node": "Parse Barcode",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Email exist?": {
      "main": [
        [
          {
            "node": "Already Registered",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Store Data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Parse Output": {
      "main": [
        [
          {
            "node": "Already Checked IN",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Valid Input?": {
      "main": [
        [
          {
            "node": "Get Participant",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Validation Error",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Parse Barcode": {
      "main": [
        [
          {
            "node": "Get Tickets",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Validate Input": {
      "main": [
        [
          {
            "node": "Valid Input?",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Participant": {
      "main": [
        [
          {
            "node": "Email exist?",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Build HTML Email": {
      "main": [
        [
          {
            "node": "Send Email (Gmail)",
            "type": "main",
            "index": 0
          },
          {
            "node": "Parse Data",
            "type": "main",
            "index": 0
          },
          {
            "node": "Update Sheet (Tickets)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Generate QR Code": {
      "main": [
        [
          {
            "node": "Build HTML Email",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Ticket Available?": {
      "main": [
        [
          {
            "node": "Update Ticket Status",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Parse Output",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Filter Paid Not Sent": {
      "main": [
        [
          {
            "node": "Generate Ticket Data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Generate Ticket Data": {
      "main": [
        [
          {
            "node": "Generate QR Code",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Update Ticket Status": {
      "main": [
        [
          {
            "node": "Checked IN",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}