đź”§ Event ticketing backend: auto QR tickets with Google Sheets & Gmail

⚡ 427 views · 🔧 Miscellaneous

Description

Ticketing Backend automates registration, QR-ticket generation, email delivery, and check-in validation using Google Sheets, Gmail, and a webhook scanner — reducing manual ticket prep from ~3 hours to under 5 minutes for 200 attendees.

Screenshot 20251005 at 15.01.48.png

Why Use This Workflow?

Ideal For

How It Works

  1. Trigger (Registration): POST /v1/register receives registration payload (nama, email, no_hp, jumlah_tiket, total_price, payment_method).
  2. Data Collection (Registration): Validate input → check existing participant in Register sheet → append registration.
  3. Processing (Ticket Generation): Scheduled job (START runs every minute) finds rows with Payment Status = PAID and Email Sent = NO.
  4. Intelligence Layer: For each ticket: generate unique Ticket ID (TL-YYYYMMDD-XXXX-N-HASH), build QR payload JSON, create QR image via qrserver API, and build HTML email with embedded base64 QR.
  5. Output & Delivery: Send ticket email(s) via Gmail; write one Tickets row per generated ticket and mark Email Sent = YES in Register.
  6. Storage & Logging: All participant & ticket records persisted to Google Sheets; check-in events update row (Checked In = YES and Checkin TIme).

Core Endpoints

Event Metadata

Setup Guide

Prerequisites

RequirementTypePurpose
n8n instanceEssentialHost the workflow and webhooks
Google account (Sheets + Gmail)EssentialStore tickets & send emails
Google SheetEssentialRegister & Tickets data store
Public webhook URL / reverse proxyEssentialExpose /v1/register & /v1/scanner to scanners/clients
qrserver.com (public API)OptionalGenerate QR images (no credentials)

> Important: Make sure your n8n instance URL is publicly accessible or use a tunneling/reverse proxy so webhooks can receive POSTs.

Installation Steps

  1. Import the JSON into your [n8n instance(https://n8n.partnerlinks.io/khmuhtadin).
  2. Configure credentials:
    • Google Sheets OAuth2: Grant access to Google Drive & Sheets API (spreadsheets.readonly & spreadsheets).
    • Gmail OAuth2: Grant send email scope (Gmail send).
  3. Update environment-specific values:
    • Verify Google Sheet ID.
    • Set the public base URL for ticket scanner clients to POST /v1/scanner.
  4. Customize settings:
    • Event name/date/location (variables in Generate Ticket Data / Build HTML Email).
    • Email sender address and subject line in Gmail node.
  5. Test execution:
    • Use a sample POST to /v1/register with valid fields to create a registration.
    • Mark a row as PAID and Email Sent = NO to trigger scheduled ticket generation.
    • Simulate a scanner POST to /v1/scanner with the barcode JSON payload to test check-in.

Technical Details

Core Nodes

NodePurposeKey Configuration
REGISTER (Webhook)Accepts registration POSTsPath: /v1/register
Validate Input (Code)Server-side validationValidates nama, email, no_hp, jumlah_tiket, payment_method
Get Participant (Google Sheets)Check duplicate emailFilters Register tab by Email
Store Data (Google Sheets)Append registrationTab: Register (gid=0)
START (Schedule Trigger)Finds paid registrationsRuns every 1 minute
Get Rows (Google Sheets)Reads Register rowsReads full Register tab
Filter Paid Not Sent (Filter)Finds rows with Payment Status=PAID & Email Sent=NOFilter node conditions
Generate Ticket Data (Code)Generate ticket IDs & QR payloadsTicket ID format TL-YYYYMMDD-XXXX-N-HASH
Generate QR Code (HTTP Request)Calls qrserver.com to build PNGURL: https://api.qrserver.com/v1/create-qr-code/?size=300x300&data=…
Build HTML Email (Code)Builds ticket HTML & embeds Base64 QRTemplate contains ticket details & QR
Send Email (Gmail)Sends ticket emailTo: recipient Email; Subject configurable
Update Sheet (Tickets)Append ticket rowsTab: Tickets (gid=2010454173)
Parse Data (Code)Aggregates ticket IDs per emailUpdates Register with combined ticket IDs
SCAN TICKET (Webhook)Check-in endpointPath: /v1/scanner
Parse Barcode (Code)Parses incoming scanner payloadExpects JSON in body.barcode
Get Tickets (Google Sheets)Lookup ticket by Ticket IDFilters Tickets tab by Ticket ID
Ticket Available? (If)Validates existence & Checked In statusBranches to update or return error
Update Ticket Status (Google Sheets)Mark Checked In = YESSets Checkin TIme to scannedAt
Checked IN / Already Checked IN (RespondToWebhook)Respond payloads for scannerJSON responses with status & metadata

Workflow Logic

Customization Options

Basic Adjustments

Advanced Enhancements

Troubleshooting

ProblemCauseSolution
Invalid QR / scanner returns “Invalid QR code format”Scanner payload not sending barcode JSON or malformed JSONEnsure scanner POST body contains valid JSON string under body.barcode; validate payload in Parse Barcode node
Ticket exists but cannot updateGoogle Sheets API auth / permission errorReconnect Google Sheets OAuth2 credential; ensure the service account/user has edit access to the sheet
Emails not sentGmail OAuth2 credential missing or Gmail API quota reachedReauthorize Gmail credential; consider switching to SendGrid/Mailgun for large volumes
Duplicate check-in allowedLogic checking “Checked In” value mismatch (case/format)Normalize the Checked In field values and use strict comparisons in Ticket Available? node
Slow generation for many ticketsSequential QR calls and sendsUse parallel execution or a dedicated email service; increase worker resources for n8n instance

Use Case Examples

Scenario 1: Community Fun Run (200 attendees)

Scenario 2: Regional Festival (2,000 tickets)


Additional Information

Created by: Khmuhtadin Category: Event Automation, Ticketing Backend
Tags: google-sheets, gmail, qr-code, webhook, ticketing

Need custom workflows or help adapting this for your event? Contact us

Note: Import the JSON into your n8n instance to get started.

My Social: Threads LinkedIn Medium Workflow Collections portfolio

đź”— Nodes Used

Google Sheets, HTTP Request, Webhook, Gmail, Schedule Trigger, Filter

📥 Import

Download workflow.json and import into n8n: Workflow menu → Import from File

📖 Importing guide · 🔑 Credential setup