n8nflow.net logo

Event Ticketing Backend: Auto QR Tickets with Google Sheets & Gmail

by Khairul MuhtadinUpdated: Last update 3 hours agoSource: n8n.io
Loading workflow viewer...

Getting Started

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?

  • Time Savings: Automates ticket generation & delivery. reduces manual processing for 200 attendees from ~3 hours to <5 minutes.
  • Cost Reduction: Removes dependency on paid ticketing platforms for basic events — save up to $150–$300/month for small organizations.
  • Error Prevention: Single-source truth in Google Sheets with QR-based check-in reduces double-checkin and human errors by >90%.
  • Scalability: Runs on a schedule and webhooks; scales from dozens to thousands of tickets (watch API/email quotas).

Ideal For

  • Event Organizers / Community Managers: Sell & distribute tickets for meetups, runs, and local events with immediate QR delivery.
  • Operations / Venue Staff: Fast, reliable check-in via mobile scanner POSTing to webhook for instant validation.
  • Small Agencies & SaaS Teams: Lightweight, low-cost ticketing backend that integrates with existing Google accounts.

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

  • Registration webhook: POST /v1/register
  • Scanner webhook (check-in): POST /v1/scanner

Event Metadata

  • Event: TABRAK_LARI
  • Event date: 15 November 2025
  • Event location: GOR Pontianak

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

  • Registration: Writes to Register sheet. A scheduled job picks up PAID rows where Email Sent = NO; for each row it generates one record per ticket, calls the QR API for an image, sends an email per ticket (multi-ticket support), then appends Tickets rows and marks Email Sent = YES by updating the Register sheet with combined ticket IDs.
  • Check-in: The scanner webhook accepts barcode JSON, extracts ticket_id, looks up the Tickets sheet, prevents duplicate check-ins by checking "Checked In" flag, and updates sheet with check-in timestamp on success.

Customization Options

Basic Adjustments

  • Email Template: Edit Build HTML Email node to change branding, copy, or layout.
  • Ticket ID Format: Change code in Generate Ticket Data to alter prefix or hash length.
  • Event Metadata: Change event_name, event_date, event_location in code nodes.

Advanced Enhancements

  • Payment Gateway Integration: Integrate with payment gateway (e.g., webhook from Stripe) to automatically set Payment Status = PAID — complexity: medium.
  • Cloud Storage for QR Images: Use cloud storage (S3) for QR images instead of base64-embedding — complexity: medium-high.
  • Batch Email Provider: Use batch email provider (SendGrid/Mailgun) for high-volume events to reduce Gmail quota risks — complexity: medium.

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)

  • Challenge: Manual QR generation and emailing takes ~3 hours.
  • Solution: After marking registrations as PAID, the scheduled job generates 200 QR tickets and emails them automatically.
  • Result: Ticket prep completed in <5 minutes; volunteer time reduced by ~3 hours.

Scenario 2: Regional Festival (2,000 tickets)

  • Challenge: High volume requires reliable delivery and check-in speed.
  • Solution: Use this workflow but replace Gmail with a transactional email provider (SendGrid) and host n8n on a scalable instance. Monitor Google Sheets and email provider quotas.
  • Result: Automated delivery scales; on-site check-in handled via the /v1/scanner endpoint with near-instant validation.

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