See llms.txt for all machine-readable content.

Back to Templates

Run a full ticketing service desk with web UI, email, and data tables

Quick overview

This workflow provides a lightweight ticketing API and demo web UI in n8n, using Webhooks for endpoints and n8n Data Tables for storage of tickets, messages, users, sessions, and audit events, plus an optional scheduled SLA monitor call and an email-sending endpoint.

How it works

  1. Serves a demo ticketing web UI over an unauthenticated GET webhook that returns an HTML page configured to call the workflow’s API endpoints.
  2. Accepts login requests via a POST webhook, validates the username/password against the users Data Table, creates a time-limited session token in the sessions Data Table, and returns the token and user profile.
  3. Creates tickets via a POST webhook, verifies the Bearer session token, generates a ticket ID and metadata, saves the ticket in the tickets Data Table, writes a “ticket_created” event to the audit Data Table, and returns the created ticket.
  4. Lists all tickets and fetches individual ticket details via GET webhooks, verifying the Bearer session token and returning records from the tickets Data Table.
  5. Adds and lists ticket messages via POST/GET webhooks, verifying the Bearer session token, storing messages in the messages Data Table, logging “message_added” audit events, and returning the message list sorted by timestamp.
  6. Updates tickets via a PATCH webhook, verifies the Bearer session token, updates status/priority/assignee/tags/category in the tickets Data Table, logs a “ticket_updated” audit event, and returns the update summary.
  7. Provides admin-only user management via GET/POST webhooks that require an admin session, upserting users into the users Data Table and returning the current user list.
  8. Runs an SLA monitor every 15 minutes via a Schedule Trigger that calls an external HTTP endpoint, and exposes a separate secure webhook that sends email using the Email Send node.

Setup

  1. Create the required n8n Data Tables named ticketing_tickets, ticketing_ticket_messages, ticketing_ticket_audit, ticketing_ticket_users, and ticketing_ticket_sessions with columns matching the fields used in the workflow.
  2. Create an initial admin user row in ticketing_ticket_users (for example username "admin" with a valid password_hash and status "active") so you can log in and manage users.
  3. Update the demo UI HTML (the YOUR_API_HOST placeholders) to point to your n8n webhook base URL (and path prefix, if you use one) so the front-end calls the correct API endpoints.
  4. Configure credentials for the Email Send node (SMTP or other supported email transport) and set the header authentication on the ticketing-email-secure webhook.
  5. Configure HTTP header auth credentials and replace the YOUR_API_HOST URL for the SLA monitor HTTP Request so it can successfully call your /jobs/sla endpoint.