This workflow corresponds to n8n.io template #17699 — we link there as the canonical source.
This workflow follows the Datatable → Gmail recipe pattern — see all workflows that pair these two integrations.
The workflow JSON
Copy or download the full n8n JSON below. Paste it into a new n8n workflow, add your credentials, activate. Full import guide →
{
"id": "kTUEkgo4UvzUg5Q2",
"name": "Automate event reservations with Gmail and Discord",
"tags": [],
"nodes": [
{
"id": "6b259b13-b321-4a21-ba3a-6dbd46018f3e",
"name": "time_slots_v2",
"type": "n8n-nodes-base.dataTable",
"position": [
-2944,
176
],
"parameters": {
"filters": {
"conditions": []
},
"matchType": "allConditions",
"operation": "get",
"returnAll": true,
"dataTableId": {
"__rl": true,
"mode": "list",
"value": "J4lhpHmHfFHJg5Zq",
"cachedResultUrl": "/projects/jtGcCQwXqdPAPGot/datatables/J4lhpHmHfFHJg5Zq",
"cachedResultName": "time_slots_v2"
}
},
"typeVersion": 1.1,
"alwaysOutputData": true
},
{
"id": "e5f456fc-8a6e-450b-8fdd-ab44043aa8c6",
"name": "Send a message",
"type": "n8n-nodes-base.discord",
"position": [
16,
144
],
"parameters": {
"content": "={{ $('Build Availability Message').item.json.discord_message }}",
"guildId": {
"__rl": true,
"mode": "list",
"value": "1531972015546958004",
"cachedResultUrl": "https://discord.com/channels/1531972015546958004",
"cachedResultName": "QR\u4e88\u7d04\u7ba1\u7406\u30c6\u30b9\u30c8"
},
"options": {},
"resource": "message",
"channelId": {
"__rl": true,
"mode": "list",
"value": "1531972016465383489",
"cachedResultUrl": "https://discord.com/channels/1531972015546958004/1531972016465383489",
"cachedResultName": "\uff12"
}
},
"typeVersion": 2
},
{
"id": "42574af0-680e-4fea-8f1c-5f4172bc328b",
"name": "Update row(s)",
"type": "n8n-nodes-base.dataTable",
"position": [
-1136,
80
],
"parameters": {
"columns": {
"value": {
"ticket_id": "=Column\uff1aissued_at\nValue\uff1a\n{{ $('Generate Ticket').item.json.issued_at }}",
"party_size": 0
},
"schema": [
{
"id": "name",
"type": "string",
"display": true,
"removed": false,
"readOnly": false,
"required": false,
"displayName": "name",
"defaultMatch": false
},
{
"id": "email",
"type": "string",
"display": true,
"removed": false,
"readOnly": false,
"required": false,
"displayName": "email",
"defaultMatch": false
},
{
"id": "slot_id",
"type": "string",
"display": true,
"removed": false,
"readOnly": false,
"required": false,
"displayName": "slot_id",
"defaultMatch": false
},
{
"id": "party_size",
"type": "number",
"display": true,
"removed": false,
"readOnly": false,
"required": false,
"displayName": "party_size",
"defaultMatch": false
},
{
"id": "ticket_id",
"type": "string",
"display": true,
"removed": false,
"readOnly": false,
"required": false,
"displayName": "ticket_id",
"defaultMatch": false
},
{
"id": "reserved_at",
"type": "dateTime",
"display": true,
"removed": false,
"readOnly": false,
"required": false,
"displayName": "reserved_at",
"defaultMatch": false
}
],
"mappingMode": "defineBelow",
"matchingColumns": [],
"attemptToConvertTypes": false,
"convertFieldsToString": false
},
"filters": {
"conditions": [
{
"keyValue": "={{ $('Create Reservation').item.json.id }}"
}
]
},
"options": {},
"operation": "update",
"dataTableId": {
"__rl": true,
"mode": "list",
"value": "oQSxnyJA0fgv9GEm",
"cachedResultUrl": "/projects/jtGcCQwXqdPAPGot/datatables/oQSxnyJA0fgv9GEm",
"cachedResultName": "\u4e88\u7d04\u8005"
}
},
"typeVersion": 1.1
},
{
"id": "4222f711-58d9-4e23-a26c-fb3b60042877",
"name": "Update row(s)1",
"type": "n8n-nodes-base.dataTable",
"position": [
-1664,
80
],
"parameters": {
"columns": {
"value": {
"ticket_id": "={{ $('Generate Ticket').item.json.ticket_id }}"
},
"schema": [
{
"id": "name",
"type": "string",
"display": true,
"removed": true,
"readOnly": false,
"required": false,
"displayName": "name",
"defaultMatch": false
},
{
"id": "email",
"type": "string",
"display": true,
"removed": true,
"readOnly": false,
"required": false,
"displayName": "email",
"defaultMatch": false
},
{
"id": "slot_id",
"type": "string",
"display": true,
"removed": true,
"readOnly": false,
"required": false,
"displayName": "slot_id",
"defaultMatch": false
},
{
"id": "party_size",
"type": "number",
"display": true,
"removed": true,
"readOnly": false,
"required": false,
"displayName": "party_size",
"defaultMatch": false
},
{
"id": "ticket_id",
"type": "string",
"display": true,
"removed": false,
"readOnly": false,
"required": false,
"displayName": "ticket_id",
"defaultMatch": false
},
{
"id": "reserved_at",
"type": "dateTime",
"display": true,
"removed": true,
"readOnly": false,
"required": false,
"displayName": "reserved_at",
"defaultMatch": false
}
],
"mappingMode": "defineBelow",
"matchingColumns": [],
"attemptToConvertTypes": false,
"convertFieldsToString": false
},
"filters": {
"conditions": [
{
"keyValue": "={{ $('Create Reservation').item.json.id }}"
}
]
},
"options": {},
"matchType": "allConditions",
"operation": "update",
"dataTableId": {
"__rl": true,
"mode": "list",
"value": "oQSxnyJA0fgv9GEm",
"cachedResultUrl": "/projects/jtGcCQwXqdPAPGot/datatables/oQSxnyJA0fgv9GEm",
"cachedResultName": "\u4e88\u7d04\u8005"
}
},
"typeVersion": 1.1
},
{
"id": "1875515f-02d6-4929-82be-c19c2efb7edf",
"name": "Reservation Form",
"type": "n8n-nodes-base.formTrigger",
"position": [
-3392,
176
],
"parameters": {
"options": {
"path": "event-reservation"
},
"formTitle": "\u30a4\u30d9\u30f3\u30c8\u4e88\u7d04\u30d5\u30a9\u30fc\u30e0",
"formFields": {
"values": [
{
"fieldName": "name",
"fieldLabel": "\u304a\u540d\u524d",
"requiredField": true
},
{
"fieldName": "email",
"fieldType": "email",
"fieldLabel": "\u30e1\u30fc\u30eb\u30a2\u30c9\u30ec\u30b9",
"requiredField": true
},
{
"fieldName": "slot_id",
"fieldType": "dropdown",
"fieldLabel": "\u6642\u9593\u67a0",
"fieldOptions": {
"values": [
{
"option": "SLOT-A"
},
{
"option": "SLOT-B"
},
{
"option": "SLOT-C"
}
]
},
"requiredField": true
},
{
"fieldName": "party_size",
"fieldType": "number",
"fieldLabel": "\u4e88\u7d04\u4eba\u6570",
"requiredField": true
}
]
},
"formDescription": "\u3054\u5e0c\u671b\u306e\u6642\u9593\u67a0\u3092\u9078\u629e\u3057\u3066\u304f\u3060\u3055\u3044\u3002"
},
"typeVersion": 2.6
},
{
"id": "4337dace-d21b-406b-8d0e-e4c5903841ae",
"name": "Normalize Input",
"type": "n8n-nodes-base.set",
"position": [
-3168,
176
],
"parameters": {
"options": {},
"assignments": {
"assignments": [
{
"id": "a1",
"name": "name",
"type": "string",
"value": "={{ $json.name }}"
},
{
"id": "a2",
"name": "email",
"type": "string",
"value": "={{ $json.email }}"
},
{
"id": "a3",
"name": "slot_id",
"type": "string",
"value": "={{ $json.slot_id }}"
},
{
"id": "a4",
"name": "party_size",
"type": "number",
"value": "={{ Number($json.party_size) }}"
}
]
}
},
"typeVersion": 3.4
},
{
"id": "df67af5a-e578-4ad4-9967-c236adaa8e28",
"name": "Find Available Slot",
"type": "n8n-nodes-base.code",
"position": [
-2720,
176
],
"parameters": {
"jsCode": "// \u300c\u5165\u529b\u3092\u6574\u5f62\u300d\u30ce\u30fc\u30c9\u304b\u3089\u4e88\u7d04\u8005\u60c5\u5831\u3092\u53d6\u5f97\nconst form = $('Normalize Input').first().json;\n\n// \u30d5\u30a9\u30fc\u30e0\u3067\u9078\u629e\u3055\u308c\u305f\u5e0c\u671b\u67a0\nconst requestedSlotId = form.slot_id;\n\n// \u4e88\u7d04\u4eba\u6570\nconst partySize = Number(form.party_size);\n\n// \u300c\u6642\u9593\u67a0\u3092\u53d6\u5f97\u300d\u304b\u3089\u5c4a\u3044\u305f\u5168\u6642\u9593\u67a0\nconst slots = $input.all()\n .map(item => item.json)\n .sort((a, b) => Number(a.slot_order) - Number(b.slot_order));\n\n// \u5e0c\u671b\u67a0\u3092\u63a2\u3059\nconst requestedSlot = slots.find(\n slot => slot.slot_id === requestedSlotId\n);\n\n// \u5e0c\u671b\u67a0\u304c\u5b58\u5728\u3057\u306a\u3044\u5834\u5408\nif (!requestedSlot) {\n return [{\n json: {\n name: form.name,\n email: form.email,\n party_size: partySize,\n\n requested_slot_id: requestedSlotId,\n requested_slot_label: null,\n\n assigned_slot_id: null,\n assigned_slot_label: null,\n\n available: false,\n reassigned: false,\n reason: '\u6307\u5b9a\u3055\u308c\u305f\u6642\u9593\u67a0\u304c\u5b58\u5728\u3057\u307e\u305b\u3093',\n\n capacity: 0,\n reserved_count: 0,\n new_reserved_count: 0,\n remaining: 0,\n slot_status: null,\n },\n }];\n}\n\n// \u4e88\u7d04\u4eba\u6570\u3092\u78ba\u8a8d\nif (\n !Number.isInteger(partySize) ||\n partySize < 1 ||\n partySize > 5\n) {\n return [{\n json: {\n name: form.name,\n email: form.email,\n party_size: partySize,\n\n requested_slot_id: requestedSlotId,\n requested_slot_label: requestedSlot.slot_label,\n\n assigned_slot_id: null,\n assigned_slot_label: null,\n\n available: false,\n reassigned: false,\n reason: '\u4e88\u7d04\u4eba\u6570\u306f1\u540d\u304b\u30895\u540d\u3067\u5165\u529b\u3057\u3066\u304f\u3060\u3055\u3044',\n\n capacity: 0,\n reserved_count: 0,\n new_reserved_count: 0,\n remaining: 0,\n slot_status: null,\n },\n }];\n}\n\n// \u5e0c\u671b\u67a0\u4ee5\u964d\u3067\u4e88\u7d04\u53ef\u80fd\u306a\u6642\u9593\u67a0\u3092\u63a2\u3059\nconst selectedSlot = slots.find(slot => {\n const capacity = Number(slot.capacity);\n const reservedCount = Number(slot.reserved_count);\n const remaining = capacity - reservedCount;\n\n return (\n Number(slot.slot_order) >= Number(requestedSlot.slot_order) &&\n slot.status === 'open' &&\n remaining >= partySize\n );\n});\n\n// \u5e0c\u671b\u67a0\u4ee5\u964d\u306b\u7a7a\u304d\u304c\u306a\u3044\u5834\u5408\nif (!selectedSlot) {\n return [{\n json: {\n name: form.name,\n email: form.email,\n party_size: partySize,\n\n requested_slot_id: requestedSlotId,\n requested_slot_label: requestedSlot.slot_label,\n\n assigned_slot_id: null,\n assigned_slot_label: null,\n\n available: false,\n reassigned: false,\n reason: '\u5e0c\u671b\u6642\u9593\u4ee5\u964d\u306e\u67a0\u306f\u3059\u3079\u3066\u6e80\u5e2d\u3067\u3059',\n\n capacity: Number(requestedSlot.capacity),\n reserved_count: Number(requestedSlot.reserved_count),\n new_reserved_count: Number(requestedSlot.reserved_count),\n remaining: Math.max(\n 0,\n Number(requestedSlot.capacity) -\n Number(requestedSlot.reserved_count)\n ),\n slot_status: requestedSlot.status,\n },\n }];\n}\n\n// \u78ba\u5b9a\u67a0\u306e\u4eba\u6570\u3092\u8a08\u7b97\nconst capacity = Number(selectedSlot.capacity);\nconst reservedCount = Number(selectedSlot.reserved_count);\nconst newReservedCount = reservedCount + partySize;\nconst remaining = capacity - newReservedCount;\n\n// \u7d50\u679c\u3092\u5f8c\u7d9a\u30ce\u30fc\u30c9\u3078\u6e21\u3059\nreturn [{\n json: {\n name: form.name,\n email: form.email,\n party_size: partySize,\n\n requested_slot_id: requestedSlotId,\n requested_slot_label: requestedSlot.slot_label,\n\n assigned_slot_id: selectedSlot.slot_id,\n assigned_slot_label: selectedSlot.slot_label,\n\n // \u65e2\u5b58\u306e\u5f8c\u7d9a\u30ce\u30fc\u30c9\u3067\u3082\u4f7f\u3048\u308b\u3088\u3046\u306b\u6b8b\u3059\n slot_id: selectedSlot.slot_id,\n slot_label: selectedSlot.slot_label,\n\n available: true,\n\n // \u5e0c\u671b\u67a0\u3068\u78ba\u5b9a\u67a0\u304c\u9055\u3046\u304b\n reassigned: selectedSlot.slot_id !== requestedSlotId,\n\n capacity,\n reserved_count: reservedCount,\n new_reserved_count: newReservedCount,\n remaining,\n\n // \u4eca\u56de\u306e\u4e88\u7d04\u3067\u6e80\u5e2d\u306b\u306a\u3063\u305f\u3089closed\n slot_status:\n newReservedCount >= capacity\n ? 'closed'\n : 'open',\n\n reason:\n selectedSlot.slot_id === requestedSlotId\n ? '\u5e0c\u671b\u6642\u9593\u67a0\u3067\u4e88\u7d04\u53ef\u80fd\u3067\u3059'\n : '\u5e0c\u671b\u67a0\u304c\u6e80\u5e2d\u306e\u305f\u3081\u6b21\u306e\u7a7a\u304d\u67a0\u3078\u5909\u66f4\u3057\u307e\u3057\u305f',\n },\n}];"
},
"typeVersion": 2
},
{
"id": "24a5a112-39da-4a4a-af0d-0b76e778366a",
"name": "Slot Available?",
"type": "n8n-nodes-base.if",
"position": [
-2496,
176
],
"parameters": {
"options": {},
"conditions": {
"options": {
"version": 3,
"leftValue": "",
"caseSensitive": true,
"typeValidation": "strict"
},
"combinator": "and",
"conditions": [
{
"id": "c1",
"operator": {
"type": "boolean",
"operation": "true",
"singleValue": true
},
"leftValue": "={{ $json.available }}",
"rightValue": true
}
]
}
},
"typeVersion": 2.3
},
{
"id": "bdbaba3a-1afe-46bf-96e3-48b3ec27d30a",
"name": "Create Reservation",
"type": "n8n-nodes-base.dataTable",
"position": [
-2272,
80
],
"parameters": {
"columns": {
"value": {
"name": "={{ $json.name }}",
"email": "={{ $json.email }}",
"slot_id": "={{ $json.slot_id }}",
"party_size": "={{ $json.party_size }}",
"reserved_at": "={{ $now.toISO() }}"
},
"schema": [
{
"id": "name",
"type": "string",
"display": true,
"removed": false,
"readOnly": false,
"required": false,
"displayName": "name",
"defaultMatch": false
},
{
"id": "email",
"type": "string",
"display": true,
"removed": false,
"readOnly": false,
"required": false,
"displayName": "email",
"defaultMatch": false
},
{
"id": "slot_id",
"type": "string",
"display": true,
"removed": false,
"readOnly": false,
"required": false,
"displayName": "slot_id",
"defaultMatch": false
},
{
"id": "party_size",
"type": "number",
"display": true,
"removed": false,
"readOnly": false,
"required": false,
"displayName": "party_size",
"defaultMatch": false
},
{
"id": "ticket_id",
"type": "string",
"display": true,
"removed": false,
"readOnly": false,
"required": false,
"displayName": "ticket_id",
"defaultMatch": false
},
{
"id": "reserved_at",
"type": "dateTime",
"display": true,
"removed": false,
"readOnly": false,
"required": false,
"displayName": "reserved_at",
"defaultMatch": false
}
],
"mappingMode": "defineBelow",
"matchingColumns": [],
"attemptToConvertTypes": false,
"convertFieldsToString": false
},
"options": {},
"dataTableId": {
"__rl": true,
"mode": "id",
"value": "oQSxnyJA0fgv9GEm",
"cachedResultName": "\u4e88\u7d04\u8005"
}
},
"typeVersion": 1.1
},
{
"id": "f4e74dd2-f29d-4f48-98d7-c08b2cca91ba",
"name": "Update Slot Capacity",
"type": "n8n-nodes-base.dataTable",
"position": [
-2048,
80
],
"parameters": {
"columns": {
"value": {
"status": "={{ $('Find Available Slot').item.json.slot_status }}",
"reserved_count": "={{ $('Find Available Slot').item.json.new_reserved_count }}"
},
"schema": [
{
"id": "slot_id",
"type": "string",
"display": true,
"removed": true,
"readOnly": false,
"required": false,
"displayName": "slot_id",
"defaultMatch": false
},
{
"id": "slot_label",
"type": "string",
"display": true,
"removed": true,
"readOnly": false,
"required": false,
"displayName": "slot_label",
"defaultMatch": false
},
{
"id": "slot_order",
"type": "number",
"display": true,
"removed": true,
"readOnly": false,
"required": false,
"displayName": "slot_order",
"defaultMatch": false
},
{
"id": "capacity",
"type": "number",
"display": true,
"removed": true,
"readOnly": false,
"required": false,
"displayName": "capacity",
"defaultMatch": false
},
{
"id": "reserved_count",
"type": "number",
"display": true,
"removed": false,
"readOnly": false,
"required": false,
"displayName": "reserved_count",
"defaultMatch": false
},
{
"id": "status",
"type": "string",
"display": true,
"removed": false,
"readOnly": false,
"required": false,
"displayName": "status",
"defaultMatch": false
}
],
"mappingMode": "defineBelow",
"matchingColumns": [],
"attemptToConvertTypes": false,
"convertFieldsToString": false
},
"filters": {
"conditions": [
{
"keyName": "slot_id",
"keyValue": "={{ $('Find Available Slot').item.json.assigned_slot_id }}"
}
]
},
"options": {},
"matchType": "allConditions",
"operation": "update",
"dataTableId": {
"__rl": true,
"mode": "list",
"value": "J4lhpHmHfFHJg5Zq",
"cachedResultUrl": "/projects/jtGcCQwXqdPAPGot/datatables/J4lhpHmHfFHJg5Zq",
"cachedResultName": "time_slots_v2"
}
},
"typeVersion": 1.1
},
{
"id": "4294d6b2-752a-4aa5-ae9c-e635dec965e5",
"name": "Generate Ticket",
"type": "n8n-nodes-base.executeWorkflow",
"position": [
-1856,
80
],
"parameters": {
"options": {},
"workflowId": {
"__rl": true,
"mode": "id",
"value": "5QRvO7RKI0HzHnv2",
"cachedResultName": "\u30c1\u30b1\u30c3\u30c8\u767a\u884c"
},
"workflowInputs": {
"value": {
"name": "={{ $('Find Available Slot').item.json.name }}",
"email": "={{ $('Find Available Slot').item.json.email }}",
"slot_id": "={{ $('Find Available Slot').item.json.slot_id }}"
},
"schema": [
{
"id": "name",
"type": "string",
"display": true,
"required": false,
"displayName": "name",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "email",
"type": "string",
"display": true,
"required": false,
"displayName": "email",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "slot_id",
"type": "string",
"display": true,
"required": false,
"displayName": "slot_id",
"defaultMatch": false,
"canBeUsedToMatch": true
}
],
"mappingMode": "defineBelow"
}
},
"typeVersion": 1.3
},
{
"id": "a3f08f31-29dd-4087-b998-a233cc8982a6",
"name": "Generate QR Code",
"type": "n8n-nodes-base.httpRequest",
"position": [
-1504,
80
],
"parameters": {
"url": "={{\n'https://quickchart.io/qr?text=' +\nencodeURIComponent($('Generate Ticket').item.json.ticket_id) +\n'&size=350&format=png&margin=3&ecLevel=M'\n}}",
"options": {
"response": {
"response": {
"responseFormat": "file",
"outputPropertyName": "qr_ticket"
}
}
}
},
"typeVersion": 4.4
},
{
"id": "475c558e-1afe-4c1f-a70f-1a1c7fc1d8c1",
"name": "Send E-Ticket",
"type": "n8n-nodes-base.gmail",
"position": [
-1328,
80
],
"parameters": {
"sendTo": "={{ $('Create Reservation').item.json.email }}",
"message": "=<p>{{ $('Create Reservation').item.json.name }} \u69d8</p> <p>\u3054\u4e88\u7d04\u3042\u308a\u304c\u3068\u3046\u3054\u3056\u3044\u307e\u3059\u3002</p> <h2>\u4e88\u7d04\u304c\u78ba\u5b9a\u3057\u307e\u3057\u305f</h2> <p><strong>\u53c2\u52a0\u6642\u9593\uff1a</strong> {{ $('Find Available Slot').item.json.assigned_slot_label }} </p> <p><strong>\u53c2\u52a0\u4eba\u6570\uff1a</strong> {{ $('Create Reservation').item.json.party_size }}\u540d </p> <p><strong>\u30c1\u30b1\u30c3\u30c8\u756a\u53f7\uff1a</strong> {{ $('Generate Ticket').item.json.ticket_id }} </p> <p>\u5f53\u65e5\u306f\u6dfb\u4ed8\u3055\u308c\u305fQR\u30b3\u30fc\u30c9\u3001\u307e\u305f\u306f\u3053\u306e\u30e1\u30fc\u30eb\u753b\u9762\u3092\u3054\u63d0\u793a\u304f\u3060\u3055\u3044\u3002</p> <p>\u5ff5\u306e\u305f\u3081\u3001\u3053\u306e\u753b\u9762\u3092\u30b9\u30af\u30ea\u30fc\u30f3\u30b7\u30e7\u30c3\u30c8\u3067\u4fdd\u5b58\u3057\u3066\u304f\u3060\u3055\u3044\u3002</p>",
"options": {
"attachmentsUi": {
"attachmentsBinary": [
{
"property": "qr_ticket"
}
]
}
},
"subject": "=\u4e88\u7d04\u5b8c\u4e86\u30fb\u96fb\u5b50\u30c1\u30b1\u30c3\u30c8\u3010{{ $('Generate Ticket').item.json.ticket_id }}\u3011"
},
"typeVersion": 2.2
},
{
"id": "0924459d-b23c-449a-937b-184c3cc16900",
"name": "Send Reservation Notification",
"type": "n8n-nodes-base.discord",
"position": [
-944,
80
],
"parameters": {
"content": "=\u2705 \u65b0\u3057\u3044\u4e88\u7d04\u304c\u78ba\u5b9a\u3057\u307e\u3057\u305f\n\u304a\u540d\u524d: {{ $json.name }}\n\u6642\u9593\u67a0: {{ $json.slot_id }}\n\u30c1\u30b1\u30c3\u30c8ID: {{ $json.ticket_id }}",
"guildId": {
"__rl": true,
"mode": "list",
"value": "1531972015546958004",
"cachedResultUrl": "https://discord.com/channels/1531972015546958004",
"cachedResultName": "QR\u4e88\u7d04\u7ba1\u7406\u30c6\u30b9\u30c8"
},
"options": {},
"resource": "message",
"channelId": {
"__rl": true,
"mode": "list",
"value": "1531972016465383487",
"cachedResultUrl": "https://discord.com/channels/1531972015546958004/1531972016465383487",
"cachedResultName": "\u4e00\u822c"
}
},
"typeVersion": 2
},
{
"id": "18e5b56b-a80f-4436-96b5-a15dff6a10fa",
"name": "Reload Time Slots",
"type": "n8n-nodes-base.dataTable",
"position": [
-752,
80
],
"parameters": {
"operation": "get",
"returnAll": true,
"dataTableId": {
"__rl": true,
"mode": "list",
"value": "J4lhpHmHfFHJg5Zq",
"cachedResultUrl": "/projects/jtGcCQwXqdPAPGot/datatables/J4lhpHmHfFHJg5Zq",
"cachedResultName": "time_slots_v2"
}
},
"typeVersion": 1.1
},
{
"id": "bd84b583-6dee-4832-b90c-8d7e6ba9c16a",
"name": "Build Availability Message",
"type": "n8n-nodes-base.code",
"position": [
-576,
80
],
"parameters": {
"jsCode": "// Data Table\u304b\u3089\u53d6\u5f97\u3057\u305f\u5168\u6642\u9593\u67a0\nconst slots = $input.all()\n .map(item => item.json)\n .sort((a, b) => Number(a.slot_order) - Number(b.slot_order));\n\nif (slots.length === 0) {\n return [\n {\n json: {\n discord_message: '\u73fe\u5728\u3001\u6642\u9593\u67a0\u306e\u60c5\u5831\u3092\u53d6\u5f97\u3067\u304d\u307e\u305b\u3093\u3067\u3057\u305f\u3002'\n }\n }\n ];\n}\n\nconst lines = slots.map(slot => {\n const capacity = Number(slot.capacity ?? 0);\n const reservedCount = Number(slot.reserved_count ?? 0);\n\n // \u30de\u30a4\u30ca\u30b9\u8868\u793a\u3092\u9632\u6b62\n const available = Math.max(capacity - reservedCount, 0);\n\n if (slot.status === 'closed' || available === 0) {\n return `\ud83d\udd34 **${slot.slot_label}**\uff5c\u6e80\u5e2d`;\n }\n\n return `\ud83d\udfe2 **${slot.slot_label}**\uff5c\u6b8b\u308a **${available}\u540d**`;\n});\n\nconst openSlotCount = slots.filter(slot => {\n const capacity = Number(slot.capacity ?? 0);\n const reservedCount = Number(slot.reserved_count ?? 0);\n return slot.status === 'open' && capacity - reservedCount > 0;\n}).length;\n\nconst message = [\n '## \ud83d\udcc5 \u73fe\u5728\u306e\u4e88\u7d04\u7a7a\u304d\u72b6\u6cc1',\n '',\n ...lines,\n '',\n `\u4e88\u7d04\u53ef\u80fd\u306a\u6642\u9593\u67a0\uff1a**${openSlotCount}\u67a0**`,\n '',\n `\u6700\u7d42\u66f4\u65b0\uff1a${new Date().toLocaleString('ja-JP', {\n timeZone: 'Asia/Tokyo'\n })}`\n].join('\\n');\n\nreturn [\n {\n json: {\n discord_message: message\n }\n }\n];"
},
"typeVersion": 2
},
{
"id": "ec2b9c5b-7ba1-4644-869d-1fc0ae6e7baf",
"name": "Get Message Settings",
"type": "n8n-nodes-base.dataTable",
"position": [
-400,
80
],
"parameters": {
"filters": {
"conditions": [
{
"keyName": "setting_key",
"keyValue": "availability_message"
}
]
},
"operation": "get",
"dataTableId": {
"__rl": true,
"mode": "list",
"value": "UdxZ9jqTxJeK6Uol",
"cachedResultUrl": "/projects/jtGcCQwXqdPAPGot/datatables/UdxZ9jqTxJeK6Uol",
"cachedResultName": "workflow_settings"
}
},
"typeVersion": 1.1
},
{
"id": "dd5f2ee7-6bb0-44fe-952d-03112f345d1b",
"name": "Message Exists?",
"type": "n8n-nodes-base.if",
"position": [
-208,
80
],
"parameters": {
"options": {},
"conditions": {
"options": {
"version": 3,
"leftValue": "",
"caseSensitive": true,
"typeValidation": "strict"
},
"combinator": "and",
"conditions": [
{
"id": "b583656f-f12d-4477-a6c6-5b4aa309269d",
"operator": {
"type": "string",
"operation": "notEmpty",
"singleValue": true
},
"leftValue": "={{ $json.setting_value }}",
"rightValue": ""
}
]
}
},
"typeVersion": 2.3
},
{
"id": "465b2912-c7db-44b4-a555-eab37be87eea",
"name": "Update Discord Message",
"type": "n8n-nodes-base.httpRequest",
"position": [
16,
0
],
"parameters": {
"url": "={{ 'https://discord.com/api/v10/channels/' + $('Get Message Settings').item.json.channel_id + '/messages/' + $('Get Message Settings').item.json.setting_value }}",
"method": "PATCH",
"options": {},
"sendBody": true,
"authentication": "genericCredentialType",
"bodyParameters": {
"parameters": [
{
"name": "content",
"value": "={{ $('Build Availability Message').item.json.discord_message }}"
}
]
},
"genericAuthType": "httpHeaderAuth"
},
"credentials": {
"httpHeaderAuth": {
"name": "<your credential>"
}
},
"typeVersion": 4.4
},
{
"id": "b88a1a23-4b8b-4074-9d3d-05aef4938167",
"name": "Save Message ID",
"type": "n8n-nodes-base.dataTable",
"position": [
224,
144
],
"parameters": {
"columns": {
"value": {
"channel_id": "={{ $('Send a message').item.json.channel_id }}",
"setting_value": "={{ $('Send a message').item.json.id }}"
},
"schema": [
{
"id": "setting_key",
"type": "string",
"display": true,
"removed": false,
"readOnly": false,
"required": false,
"displayName": "setting_key",
"defaultMatch": false
},
{
"id": "setting_value",
"type": "string",
"display": true,
"removed": false,
"readOnly": false,
"required": false,
"displayName": "setting_value",
"defaultMatch": false
},
{
"id": "channel_id",
"type": "string",
"display": true,
"removed": false,
"readOnly": false,
"required": false,
"displayName": "channel_id",
"defaultMatch": false
}
],
"mappingMode": "defineBelow",
"matchingColumns": [],
"attemptToConvertTypes": false,
"convertFieldsToString": false
},
"filters": {
"conditions": [
{
"keyName": "setting_key",
"keyValue": "availability_message"
}
]
},
"options": {},
"operation": "update",
"dataTableId": {
"__rl": true,
"mode": "list",
"value": "UdxZ9jqTxJeK6Uol",
"cachedResultUrl": "/projects/jtGcCQwXqdPAPGot/datatables/UdxZ9jqTxJeK6Uol",
"cachedResultName": "workflow_settings"
}
},
"typeVersion": 1.1
},
{
"id": "e1274721-52bd-427d-8ae4-db92ab96d8b0",
"name": "Send Full Capacity Notification",
"type": "n8n-nodes-base.discord",
"position": [
-2272,
272
],
"parameters": {
"content": "=\u26a0\ufe0f \u4e88\u7d04\u3067\u304d\u307e\u305b\u3093\u3067\u3057\u305f\n\n\u304a\u540d\u524d: {{ $json.name }}\n\u5e0c\u671b\u6642\u9593\u67a0: {{ $json.requested_slot_label }}\n\u5e0c\u671b\u4eba\u6570: {{ $json.party_size }}\u540d\n\u7406\u7531: {{ $json.reason }}",
"guildId": {
"__rl": true,
"mode": "list",
"value": "1531972015546958004",
"cachedResultUrl": "https://discord.com/channels/1531972015546958004",
"cachedResultName": "QR\u4e88\u7d04\u7ba1\u7406\u30c6\u30b9\u30c8"
},
"options": {},
"resource": "message",
"channelId": {
"__rl": true,
"mode": "list",
"value": "1531972016465383488",
"cachedResultUrl": "https://discord.com/channels/1531972015546958004/1531972016465383488",
"cachedResultName": "\uff11"
}
},
"typeVersion": 2
},
{
"id": "3333ad34-ddbb-42ca-9446-9f7c82be388c",
"name": "Sticky Note",
"type": "n8n-nodes-base.stickyNote",
"position": [
-4080,
-592
],
"parameters": {
"width": 576,
"height": 1168,
"content": "Workflow Overview\n\nThis workflow automates the complete event reservation process using n8n.\n\nMain features:\n\u2022 Receives event reservations through an online form\n\u2022 Validates participant information\n\u2022 Automatically assigns the next available time slot when the requested slot is full\n\u2022 Stores reservation data in Data Tables\n\u2022 Updates slot capacity in real time\n\u2022 Generates a unique ticket ID\n\u2022 Creates a QR code for each reservation\n\u2022 Sends an e-ticket via Gmail\n\u2022 Notifies organizers through Discord\n\u2022 Keeps a live Discord availability board updated\n\nThe workflow is designed to minimize manual work while providing participants with an automated reservation experience.\n\n\n\n\nWho is this workflow for?\n\nThis workflow is designed for Japanese organizations and communities that manage scheduled events with limited capacity.\n\nTypical use cases include:\n\u2022 Universities\n\u2022 Workshops\n\u2022 Conferences\n\u2022 Community events\n\u2022 Open campus events\n\u2022 Club activities\n\nParticipants complete a Japanese reservation form, automatically receive an assigned time slot, a QR-based e-ticket by email, and organizers receive Discord notifications.\n\nThe workflow reduces manual work, prevents overbooking, and provides a smooth reservation experience for both participants and organizers."
},
"typeVersion": 1
},
{
"id": "a9b87f41-803c-4f76-8547-dac975b8c764",
"name": "Sticky Note1",
"type": "n8n-nodes-base.stickyNote",
"position": [
-3440,
-48
],
"parameters": {
"width": 192,
"height": 208,
"content": "Reservation Form\n\n\nReceives reservation requests from participants.\n"
},
"typeVersion": 1
},
{
"id": "ee3ba29b-d725-49e3-a8d9-ace924a43d5c",
"name": "Sticky Note2",
"type": "n8n-nodes-base.stickyNote",
"position": [
-3216,
-48
],
"parameters": {
"width": 192,
"height": 208,
"content": "Normalize Input\n\n\nFormats and validates the submitted form data."
},
"typeVersion": 1
},
{
"id": "5fde2812-99a4-497b-b50b-cd345469742b",
"name": "Sticky Note3",
"type": "n8n-nodes-base.stickyNote",
"position": [
-2736,
-80
],
"parameters": {
"width": 150,
"height": 240,
"content": "Find Available Slot\n\nChecks availability and automatically assigns the next available slot if necessary."
},
"typeVersion": 1
},
{
"id": "20811332-b586-4f2a-b133-ce589be303f6",
"name": "Sticky Note4",
"type": "n8n-nodes-base.stickyNote",
"position": [
-1888,
-176
],
"parameters": {
"width": 150,
"height": 240,
"content": " Generate Ticket\n\nCreates a unique ticket ID for the reservation."
},
"typeVersion": 1
},
{
"id": "4fcf8056-f2f7-4b07-bf5a-f0ae2a663159",
"name": "Sticky Note5",
"type": "n8n-nodes-base.stickyNote",
"position": [
-2512,
-80
],
"parameters": {
"width": 150,
"height": 240,
"content": " Slot Available?\n\n\nDetermines whether a reservation can be accepted."
},
"typeVersion": 1
},
{
"id": "107dd6ee-773c-4e28-887b-d2cf558015be",
"name": "Sticky Note6",
"type": "n8n-nodes-base.stickyNote",
"position": [
-2304,
-176
],
"parameters": {
"width": 150,
"height": 240,
"content": "Create Reservation\n\nStores participant information in the reservation database."
},
"typeVersion": 1
},
{
"id": "6feea7fa-8eaa-4e1c-a866-02d2777d463a",
"name": "Sticky Note7",
"type": "n8n-nodes-base.stickyNote",
"position": [
-2080,
-176
],
"parameters": {
"width": 150,
"height": 240,
"content": "Update Slot Capacity\n\nUpdates the remaining capacity for the assigned time slot.\n"
},
"typeVersion": 1
},
{
"id": "1fd01286-02cc-4d92-852b-cc1e55134d1c",
"name": "Sticky Note8",
"type": "n8n-nodes-base.stickyNote",
"position": [
-1536,
-176
],
"parameters": {
"width": 150,
"height": 240,
"content": "Generate QR Code\n\nCreates a QR code containing the ticket ID.\n"
},
"typeVersion": 1
},
{
"id": "94bcda8c-0c03-42ac-8583-97b24ed185d5",
"name": "Sticky Note9",
"type": "n8n-nodes-base.stickyNote",
"position": [
-1360,
-176
],
"parameters": {
"width": 150,
"height": 240,
"content": "Send E-Ticket\n\nSends the participant an email containing their QR ticket."
},
"typeVersion": 1
},
{
"id": "51fda9e8-5be1-47ba-af93-62efa76756cc",
"name": "Sticky Note10",
"type": "n8n-nodes-base.stickyNote",
"position": [
-960,
-176
],
"parameters": {
"width": 150,
"height": 240,
"content": "Send Reservation Notification\n\nNotifies administrators in Discord."
},
"typeVersion": 1
},
{
"id": "3ca24427-b90a-482c-a8d6-81c4d1cd61a3",
"name": "Sticky Note11",
"type": "n8n-nodes-base.stickyNote",
"position": [
-784,
-176
],
"parameters": {
"width": 150,
"height": 240,
"content": "Reload Time Slots\n\nRetrieves the latest slot information."
},
"typeVersion": 1
},
{
"id": "04276a05-0faa-42f2-a06f-3620fdd884b6",
"name": "Sticky Note12",
"type": "n8n-nodes-base.stickyNote",
"position": [
-608,
-176
],
"parameters": {
"width": 150,
"height": 240,
"content": "Build Availability Message\n\nBuilds a live availability summary."
},
"typeVersion": 1
},
{
"id": "34505b5d-366e-44e7-9d08-115d0018a909",
"name": "Sticky Note13",
"type": "n8n-nodes-base.stickyNote",
"position": [
-432,
-176
],
"parameters": {
"width": 150,
"height": 240,
"content": "Get Message Settings\n\nRetrieves the stored Discord message ID."
},
"typeVersion": 1
},
{
"id": "b33fcae3-9374-47e1-b9c9-99607e2d9748",
"name": "Sticky Note14",
"type": "n8n-nodes-base.stickyNote",
"position": [
-2960,
-144
],
"parameters": {
"width": 150,
"height": 304,
"content": "time_slots_v2\n\nRetrieves the current time slot information from the Data Table, including capacity, reservation count, and availability status."
},
"typeVersion": 1
},
{
"id": "62383681-9b68-42cf-83f5-fa7e9aaa70a2",
"name": "Sticky Note15",
"type": "n8n-nodes-base.stickyNote",
"position": [
208,
304
],
"parameters": {
"width": 150,
"height": 336,
"content": "Save Message ID\n\nStores the Discord message ID in the Data Table so the same message can be updated instead of creating duplicate messages."
},
"typeVersion": 1
},
{
"id": "45c040eb-1888-4d44-99b2-97db3f586152",
"name": "Sticky Note16",
"type": "n8n-nodes-base.stickyNote",
"position": [
-16,
-256
],
"parameters": {
"width": 150,
"height": 240,
"content": "Update Discord Message / Send a Message\n\nUpdates the existing Discord message or creates a new one."
},
"typeVersion": 1
},
{
"id": "74d2d074-196a-456a-9743-9bf285b1e2a6",
"name": "Sticky Note17",
"type": "n8n-nodes-base.stickyNote",
"position": [
-2288,
448
],
"parameters": {
"width": 150,
"height": 416,
"content": "Send Full Capacity Notification\n\nNotifies administrators through Discord when all available time slots are fully booked and no further reservations can be accepted."
},
"typeVersion": 1
},
{
"id": "94c29aa0-d17e-48fd-970c-51cc3b939d7a",
"name": "Sticky Note18",
"type": "n8n-nodes-base.stickyNote",
"position": [
-240,
-176
],
"parameters": {
"width": 150,
"height": 240,
"content": "Message Exists?\n\nChecks whether the availability message already exists."
},
"typeVersion": 1
},
{
"id": "80bc8e27-0b88-42c5-becf-f994104ff193",
"name": "Sticky Note19",
"type": "n8n-nodes-base.stickyNote",
"position": [
-1168,
-224
],
"parameters": {
"width": 150,
"height": 288,
"content": "Update row(s)\n\nUpdates the reservation record by saving the generated ticket ID and other reservation details in the Data Table."
},
"typeVersion": 1
},
{
"id": "386c080e-e14d-4ea9-acdc-352a91d0ec38",
"name": "Sticky Note20",
"type": "n8n-nodes-base.stickyNote",
"position": [
0,
304
],
"parameters": {
"width": 150,
"height": 240,
"content": "Send Full Capacity Notification\n\nNotifies administrators when no reservation can be accepted."
},
"typeVersion": 1
},
{
"id": "1cb4abe1-2a46-4338-bee5-dcf23c3308c9",
"name": "Sticky Note21",
"type": "n8n-nodes-base.stickyNote",
"position": [
-1712,
-176
],
"parameters": {
"width": 150,
"height": 240,
"content": "Update Discord Message / Send a Message\n\nUpdates the existing Discord message or creates a new one."
},
"typeVersion": 1
}
],
"active": false,
"settings": {
"binaryMode": "separate",
"executionOrder": "v1"
},
"versionId": "e5b4a592-013d-40e9-b557-4112f6bcd190",
"nodeGroups": [],
"connections": {
"Send E-Ticket": {
"main": [
[
{
"node": "Update row(s)",
"type": "main",
"index": 0
}
]
]
},
"Update row(s)": {
"main": [
[
{
"node": "Send Reservation Notification",
"type": "main",
"index": 0
}
]
]
},
"time_slots_v2": {
"main": [
[
{
"node": "Find Available Slot",
"type": "main",
"index": 0
}
]
]
},
"Send a message": {
"main": [
[
{
"node": "Save Message ID",
"type": "main",
"index": 0
}
]
]
},
"Update row(s)1": {
"main": [
[
{
"node": "Generate QR Code",
"type": "main",
"index": 0
}
]
]
},
"Generate Ticket": {
"main": [
[
{
"node": "Update row(s)1",
"type": "main",
"index": 0
}
]
]
},
"Message Exists?": {
"main": [
[
{
"node": "Update Discord Message",
"type": "main",
"index": 0
}
],
[
{
"node": "Send a message",
"type": "main",
"index": 0
}
]
]
},
"Normalize Input": {
"main": [
[
{
"node": "time_slots_v2",
"type": "main",
"index": 0
}
]
]
},
"Slot Available?": {
"main": [
[
{
"node": "Create Reservation",
"type": "main",
"index": 0
}
],
[
{
"node": "Send Full Capacity Notification",
"type": "main",
"index": 0
}
]
]
},
"Generate QR Code": {
"main": [
[
{
"node": "Send E-Ticket",
"type": "main",
"index": 0
}
]
]
},
"Reservation Form": {
"main": [
[
{
"node": "Normalize Input",
"type": "main",
"index": 0
}
]
]
},
"Reload Time Slots": {
"main": [
[
{
"node": "Build Availability Message",
"type": "main",
"index": 0
}
]
]
},
"Create Reservation": {
"main": [
[
{
"node": "Update Slot Capacity",
"type": "main",
"index": 0
}
]
]
},
"Find Available Slot": {
"main": [
[
{
"node": "Slot Available?",
"type": "main",
"index": 0
}
]
]
},
"Get Message Settings": {
"main": [
[
{
"node": "Message Exists?",
"type": "main",
"index": 0
}
]
]
},
"Update Slot Capacity": {
"main": [
[
{
"node": "Generate Ticket",
"type": "main",
"index": 0
}
]
]
},
"Build Availability Message": {
"main": [
[
{
"node": "Get Message Settings",
"type": "main",
"index": 0
}
]
]
},
"Send Reservation Notification": {
"main": [
[
{
"node": "Reload Time Slots",
"type": "main",
"index": 0
}
]
]
}
}
}
Credentials you'll need
Each integration node will prompt for credentials when you import. We strip credential IDs before publishing — you'll add your own.
httpHeaderAuth
For the full experience including quality scoring and batch install features for each workflow upgrade to Pro
About this workflow
This workflow collects event reservations via an n8n form, checks capacity against n8n Data Tables, generates a ticket and QR code, emails an e-ticket with Gmail, and posts updates to Discord, including a continuously updated availability message. Receives a reservation…
Source: https://n8n.io/workflows/17699/ — original creator credit. Request a take-down →
Related workflows
Workflows that share integrations, category, or trigger type with this one. All free to copy and import.
This workflow accepts a suspected scam URL via an n8n form, enriches it with RDAP, certificate transparency, DNS/IP hosting data, urlscan.io results, and HTML fingerprints, then correlates findings ag
This workflow captures new client inquiries via an n8n form, logs them to an n8n data table, creates or updates a lead in Pipedrive, notifies a Slack channel, and emails a Cal.com booking link; when C
Fetches all open sprint tickets daily from your Jira project Analyzes each ticket for overdue days and blocked status Routes to the right escalation level: assignee email → team Google Chat alert → ma
What This Flow Does
This workflow listens for Stripe payment failures, looks up the customer in HighLevel, logs or updates the failure in an n8n Data Table, and—when not recently automated—creates a Stripe coupon and ema