Build pack: Private party inquiries build pack
Everything from the video: the prompt that writes the reply (or the one you decide on), the importable n8n workflow with both paths, and the setup checklist.
Watch the build: full video · 60-second version
- prompt
The party reply prompt
Goes in 'Prompt for Claude'. Swap [BUSINESS] and [OWNER]. Keep the JSON line: the branch and the safety check read it.
[BUSINESS] is [OWNER]'s restaurant with private rooms for parties. Someone just asked about a private party. Their name: {{ $json.name }}, occasion: {{ $json.occasion }}. What they wrote: "{{ $json.note }}". The code checked the restaurant's rooms and events book: {{ $json.said }}. If the code said route pencil, write a short, warm reply in [OWNER]'s voice, first person: thank them, mention their occasion and one thing they wrote so it feels personal, and say you penciled in a room for them, the details, the party menus and a link to pick a time to talk are right below. Sign it [OWNER]. If the code said route owner, write instead a short, warm reply [OWNER] could send: thank them and say she'd love to talk it through. Nothing is penciled in. Sign it [OWNER]. Read what they wrote: if they ask about a buyout, a wedding, a deposit, a budget or a price, mention a serious allergy, a complaint, or anything feels off, say route owner. No prices, dates, days, times, guest counts or numbers: the room, the date and the links are added from the sheet. Answer as JSON: {"route": "pencil or owner", "why": "under 12 words", "intro": "under 50 words"} - json
n8n workflow (import this)
Credentials, sheet IDs and keys removed; reconnect your Gmail and Google Sheets, set your own alert address and test address.
{ "name": "Every private party request gets a room penciled in (code reads your rooms and events book, pencils in the smallest free room that fits that night and AI writes the reply in your voice; a buyout, a date that's taken or too soon, a wedding, a deposit or budget question, or anything odd comes to you with a reply drafted, nothing sent)", "nodes": [ { "name": "Party request", "type": "n8n-nodes-base.formTrigger", "typeVersion": 2.2, "position": [ 0, 0 ], "parameters": { "formTitle": "[BUSINESS]", "formDescription": "Private parties: tell us about yours.", "formFields": { "values": [ { "fieldLabel": "Name", "requiredField": true }, { "fieldLabel": "Email", "fieldType": "email", "requiredField": true }, { "fieldLabel": "Date", "fieldType": "date", "requiredField": true }, { "fieldLabel": "Guests", "fieldType": "number", "requiredField": true }, { "fieldLabel": "Occasion", "fieldType": "dropdown", "requiredField": true, "fieldOptions": { "values": [ { "option": "Birthday" }, { "option": "Anniversary" }, { "option": "Work dinner" }, { "option": "Rehearsal dinner" }, { "option": "Something else" } ] } }, { "fieldLabel": "Anything we should know?", "fieldType": "textarea" } ] }, "options": { "appendAttribution": false, "path": "party", "respondWithOptions": { "values": { "formSubmittedText": "Thanks! We'll be in touch." } } } } }, { "name": "Read the sheet", "type": "n8n-nodes-base.httpRequest", "typeVersion": 4.2, "position": [ 0, 224 ], "parameters": { "method": "GET", "url": "https://sheets.googleapis.com/v4/spreadsheets/YOUR_GOOGLE_SHEET_ID/values:batchGet?ranges=Rooms!A2:C50&ranges=Events!A2:C2000&ranges=Settings!A2:B20&ranges=Inquiries!A2:G2000", "authentication": "predefinedCredentialType", "nodeCredentialType": "googleDriveOAuth2Api", "options": {} } }, { "name": "Check the party", "type": "n8n-nodes-base.code", "typeVersion": 2, "position": [ 0, 448 ], "parameters": { "mode": "runOnceForAllItems", "language": "javaScript", "jsCode": "const T = s => String(s ?? '').trim();\nconst F = $('Party request').first().json;\nconst name = T(F['Name']).replace(/\\s+/g, ' ').slice(0, 60), email = T(F['Email']).toLowerCase();\nconst occasion = T(F['Occasion']) || 'a party', rawDate = T(F['Date']), rawGuests = T(F['Guests']);\nconst note = T(F['Anything we should know?']).replace(/\\s+/g, ' ').slice(0, 400);\nif (!/^[^@\\s]+@[^@\\s]+\\.[^@\\s]+$/.test(email)) return [];\nconst vr = $('Read the sheet').first().json.valueRanges || [];\nconst rooms = (vr[0] || {}).values || [], events = (vr[1] || {}).values || [], settings = (vr[2] || {}).values || [], log = (vr[3] || {}).values || [];\nconst today = $now.setZone('America/New_York').toFormat('MM/dd/yyyy');\nconst dn = s => { let m = T(s).match(/^(\\d{4})-(\\d{1,2})-(\\d{1,2})$/); if (m) return Math.round(Date.UTC(+m[1], +m[2] - 1, +m[3]) / 864e5);\n m = T(s).match(/^(\\d{1,2})\\/(\\d{1,2})\\/(\\d{4})$/); return m ? Math.round(Date.UTC(+m[3], +m[1] - 1, +m[2]) / 864e5) : NaN; };\nconst pd = dn(rawDate), p2 = n => String(n).padStart(2, '0');\nconst DAYS = ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'];\nconst MON = ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'];\nconst pdt = isNaN(pd) ? null : new Date(pd * 864e5);\nconst pdate = pdt ? `${p2(pdt.getUTCMonth() + 1)}/${p2(pdt.getUTCDate())}/${pdt.getUTCFullYear()}` : '';\nconst when = pdt ? `${DAYS[pdt.getUTCDay()]}, ${MON[pdt.getUTCMonth()]} ${pdt.getUTCDate()}` : '';\nif (log.some(r => T(r[0]) === today && T(r[3]).toLowerCase() === email && T(r[4]) === (pdate || 'none'))) return [];\nconst set = Object.fromEntries(settings.map(r => [T(r[0]).toLowerCase(), T(r[1])]));\nconst guests = /^\\d{1,4}$/.test(rawGuests) ? parseInt(rawGuests, 10) : 0;\nconst notice = /^\\d{1,3}$/.test(T(set['days notice'])) ? parseInt(T(set['days notice']), 10) : 0;\nconst words = T(set['owner words']).toLowerCase().split(',').map(T).filter(Boolean);\nconst hit = words.find(u => note.toLowerCase().includes(u));\nconst menu = T(set['menu link']), callLink = T(set['call link']), line = T(set['hold line']) || 'I penciled this in for you:';\nconst rs = rooms.map(r => ({ room: T(r[0]), lo: parseInt(T(r[1]), 10), hi: parseInt(T(r[2]), 10) })).filter(r => r.room && r.hi > 0 && !isNaN(r.lo));\nconst most = rs.reduce((a, r) => Math.max(a, r.hi), 0);\nconst fit = guests ? rs.filter(r => guests >= r.lo && guests <= r.hi).sort((a, b) => a.hi - b.hi) : [];\nconst taken = r => events.some(e => dn(e[0]) === pd && T(e[1]).toLowerCase() === r.room.toLowerCase());\nconst room = isNaN(pd) ? null : (fit.filter(r => !taken(r))[0] || null);\nconst days = isNaN(pd) ? NaN : pd - dn(today);\nlet why = '';\nif (!guests) why = 'no guest count on the request';\nelse if (guests > most) why = `${guests} guests, more than any room seats: a buyout, call them`;\nelse if (hit) why = `\"${hit}\" in what they wrote, worth a call`;\nelse if (isNaN(pd)) why = 'no party date on the request';\nelse if (days < 0) why = 'a party date that has already passed';\nelse if (days < notice) why = `under ${notice} days notice`;\nelse if (!fit.length) why = `no room is set up for ${guests} guests`;\nelse if (!room) why = `${fit.map(r => r.room).join(' and ')} already booked that night`;\nelse if (!name) why = 'no name on the request';\nelse if (!menu || !callLink) why = 'no menu or call link on the Settings tab';\nconst facts = `${name || 'no name'}, ${guests || 'no'} guests, ${occasion}, ${when || 'no date'}`;\nreturn [{ json: { name: name || 'there', email, occasion, note: note || 'nothing written', guests: guests ? String(guests) : 'none', pdate: pdate || 'none', when, facts,\n room: room ? room.room : '', roomLine: room ? `${room.room} for ${guests} guests, ${when}` : '', menu, call: callLink, line,\n evRow: events.length + 2, logRow: log.length + 2,\n want: why ? 'owner' : 'pencil', why, said: why ? `${why}, route owner (draft a reply for the owner to send)` : `the ${room.room} seats ${room.lo} to ${room.hi} and is free that night, route pencil` } }];" } }, { "name": "Prompt for Claude", "type": "n8n-nodes-base.set", "typeVersion": 3.4, "position": [ 0, 672 ], "parameters": { "assignments": { "assignments": [ { "id": "q1", "name": "prompt", "type": "string", "value": "=[BUSINESS] is [OWNER]'s restaurant with private rooms for parties. Someone just asked about a private party. Their name: {{ $json.name }}, occasion: {{ $json.occasion }}. What they wrote: \"{{ $json.note }}\". The code checked the restaurant's rooms and events book: {{ $json.said }}. If the code said route pencil, write a short, warm reply in [OWNER]'s voice, first person: thank them, mention their occasion and one thing they wrote so it feels personal, and say you penciled in a room for them, the details, the party menus and a link to pick a time to talk are right below. Sign it [OWNER]. If the code said route owner, write instead a short, warm reply [OWNER] could send: thank them and say she'd love to talk it through. Nothing is penciled in. Sign it [OWNER]. Read what they wrote: if they ask about a buyout, a wedding, a deposit, a budget or a price, mention a serious allergy, a complaint, or anything feels off, say route owner. No prices, dates, days, times, guest counts or numbers: the room, the date and the links are added from the sheet. Answer as JSON: {\"route\": \"pencil or owner\", \"why\": \"under 12 words\", \"intro\": \"under 50 words\"}" }, { "id": "q2", "name": "name", "type": "string", "value": "={{ $json.name }}" }, { "id": "q3", "name": "gotAt", "type": "string", "value": "={{ $now.setZone('America/New_York').toFormat('h:mm:ss a') }}" } ] }, "options": {} } }, { "name": "Queue for Claude", "type": "n8n-nodes-base.httpRequest", "typeVersion": 4.2, "position": [ 0, 896 ], "parameters": { "method": "POST", "url": "https://sheets.googleapis.com/v4/spreadsheets/YOUR_GOOGLE_SHEET_ID/values/Queue!A:G:append?valueInputOption=RAW&insertDataOption=INSERT_ROWS", "authentication": "predefinedCredentialType", "nodeCredentialType": "googleDriveOAuth2Api", "sendBody": true, "specifyBody": "json", "jsonBody": "={{ JSON.stringify({ values: [[ $json.gotAt, $json.name, $json.prompt, $execution.resumeUrl, '' ]] }) }}", "options": {} } }, { "name": "Claude writes it", "type": "n8n-nodes-base.wait", "typeVersion": 1.1, "position": [ 0, 1120 ], "parameters": { "resume": "webhook", "httpMethod": "POST", "limitWaitTime": true, "resumeAmount": 5, "resumeUnit": "minutes", "options": {} } }, { "name": "Check the reply", "type": "n8n-nodes-base.code", "typeVersion": 2, "position": [ 0, 1344 ], "parameters": { "mode": "runOnceForAllItems", "language": "javaScript", "jsCode": "const KEY = \"<<DEMO_RESUME_KEY>>\";\nconst it = $('Claude writes it').first().json;\nconst h = it.headers || {};\nif ((h['x-demo-key'] || '') !== KEY) throw new Error('resume rejected: missing or wrong key');\nconst b = it.body || {};\nconst out = {};\nout[\"intro\"] = String(b[\"intro\"] ?? '').slice(0, 600);\nout[\"why\"] = String(b[\"why\"] ?? '').slice(0, 160);\nconst MOODS = [\"pencil\", \"owner\"];\nconst m = String(b.route ?? '').trim().toLowerCase();\nout.route = MOODS.includes(m) ? m : \"owner\";\nconst c = $('Check the party').first().json;\nconst ai = String(b.route ?? '').trim().toLowerCase(), aiWhy = out.why.replace(/\\s+/g, ' ').trim();\nout.why = c.why || '';\nif (c.want === 'owner') out.route = 'owner';\nelse if (ai === 'owner') { out.route = 'owner'; out.why = 'flagged: ' + (aiWhy || 'worth a read'); }\nelse if (ai !== 'pencil') { out.route = 'owner'; out.why = 'the reply did not match your rooms and events book, nothing was sent'; }\nif (out.route !== 'owner' && /[\\d$%]/.test(out.intro)) { out.route = 'owner'; out.why = 'the reply had a date, a number or a price in it, nothing was sent'; }\nif (out.route !== 'owner' && !c.room) { out.route = 'owner'; out.why = 'no free room found, nothing was sent'; }\nif (out.intro.trim().length < 20) { out.route = 'owner'; out.why = out.why || 'the reply came back empty'; out.intro = 'nothing drafted, call them yourself'; }\nif (!out.why) out.why = 'worth a look before it is sent';\nout.to = '';\nif (out.route === 'pencil') { const to = String(c.email || '').trim().toLowerCase();\n if (!/^[^@\\s]+@[^@\\s]+\\.[^@\\s]+$/.test(to)) throw new Error('send blocked: not one of our test addresses');\n out.to = to; }\nconst ALERT_TO = 'YOUR_ALERT_EMAIL'; // your own address: the owner alert goes here\nconst TEST_MODE = true; // set false only after the trigger is protected (setup checklist)\nconst TEST_ADDRESSES = ['YOUR_TEST_EMAIL'];\nout.alert = ALERT_TO.trim().toLowerCase();\nfor (const to of [out.alert, out.to].filter(Boolean)) {\n if (!/^[^@\\s]+@[^@\\s]+\\.[^@\\s]+$/.test(to)) throw new Error('send blocked: bad address');\n if (TEST_MODE && !TEST_ADDRESSES.map(a => a.toLowerCase()).includes(to)) throw new Error('send blocked: TEST_MODE is on and this is not one of your test addresses');\n}\nreturn [{ json: { body: out } }];" } }, { "name": "Pencil or call?", "type": "n8n-nodes-base.if", "typeVersion": 2.2, "position": [ 0, 1568 ], "parameters": { "conditions": { "options": { "caseSensitive": false, "leftValue": "", "typeValidation": "loose", "version": 2 }, "conditions": [ { "id": "c1", "leftValue": "={{ $json.body.route }}", "rightValue": "pencil", "operator": { "type": "string", "operation": "equals" } } ], "combinator": "and" }, "options": {} } }, { "name": "Send the reply", "type": "n8n-nodes-base.gmail", "typeVersion": 2.1, "position": [ -260, 1792 ], "parameters": { "sendTo": "={{ $('Check the reply').item.json.body.to }}", "emailType": "text", "subject": "Your party at [BUSINESS]", "message": "={{ $('Check the reply').item.json.body.intro + '\\n\\n' + $('Check the party').item.json.line + '\\n' + $('Check the party').item.json.roomLine + '\\n\\nOur party menus: ' + $('Check the party').item.json.menu + '\\nPick a time to talk and lock it in: ' + $('Check the party').item.json.call }}", "options": { "appendAttribution": false, "senderName": "[BUSINESS]" } } }, { "name": "Pencil it in + log", "type": "n8n-nodes-base.httpRequest", "typeVersion": 4.2, "position": [ -260, 2016 ], "parameters": { "method": "POST", "url": "https://sheets.googleapis.com/v4/spreadsheets/YOUR_GOOGLE_SHEET_ID/values:batchUpdate", "authentication": "predefinedCredentialType", "nodeCredentialType": "googleDriveOAuth2Api", "sendBody": true, "specifyBody": "json", "jsonBody": "={{ JSON.stringify({ valueInputOption: 'RAW', data: [{ range: 'Events!A' + $('Check the party').item.json.evRow + ':C' + $('Check the party').item.json.evRow, values: [[ $('Check the party').item.json.pdate, $('Check the party').item.json.room, 'Penciled: ' + $('Check the party').item.json.name + ' (' + $('Check the party').item.json.guests + ')' ]] }, { range: 'Inquiries!A' + $('Check the party').item.json.logRow + ':G' + $('Check the party').item.json.logRow, values: [[ $now.setZone('America/New_York').toFormat('MM/dd/yyyy'), $now.setZone('America/New_York').toFormat('h:mm a'), $('Check the party').item.json.name, $('Check the party').item.json.email, $('Check the party').item.json.pdate, $('Check the party').item.json.guests, 'Penciled: ' + $('Check the party').item.json.room + ', reply sent' ]] }] }) }}", "options": {} } }, { "name": "Tell the owner", "type": "n8n-nodes-base.gmail", "typeVersion": 2.1, "position": [ 260, 1792 ], "parameters": { "sendTo": "={{ $('Check the reply').item.json.body.alert }}", "emailType": "text", "subject": "A party request to call about", "message": "={{ 'Why it came to you: ' + $('Check the reply').item.json.body.why + '\\n\\nThe party: ' + $('Check the party').item.json.facts + '\\n\\nThey wrote: ' + $('Check the party').item.json.note + '\\n\\nReply, drafted:\\n' + $('Check the reply').item.json.body.intro + '\\n\\nNothing was sent and nothing was penciled in. They are on your Inquiries list.' }}", "options": { "appendAttribution": false, "senderName": "[BUSINESS]" } } }, { "name": "Log for the owner", "type": "n8n-nodes-base.httpRequest", "typeVersion": 4.2, "position": [ 260, 2016 ], "parameters": { "method": "POST", "url": "https://sheets.googleapis.com/v4/spreadsheets/YOUR_GOOGLE_SHEET_ID/values/Inquiries!A:G:append?valueInputOption=RAW&insertDataOption=INSERT_ROWS", "authentication": "predefinedCredentialType", "nodeCredentialType": "googleDriveOAuth2Api", "sendBody": true, "specifyBody": "json", "jsonBody": "={{ JSON.stringify({ values: [[ $now.setZone('America/New_York').toFormat('MM/dd/yyyy'), $now.setZone('America/New_York').toFormat('h:mm a'), $('Check the party').item.json.name, $('Check the party').item.json.email, $('Check the party').item.json.pdate, $('Check the party').item.json.guests, 'Owner: ' + $('Check the reply').item.json.body.why ]] }) }}", "options": {} } } ], "connections": { "Party request": { "main": [ [ { "node": "Read the sheet", "type": "main", "index": 0 } ] ] }, "Read the sheet": { "main": [ [ { "node": "Check the party", "type": "main", "index": 0 } ] ] }, "Check the party": { "main": [ [ { "node": "Prompt for Claude", "type": "main", "index": 0 } ] ] }, "Prompt for Claude": { "main": [ [ { "node": "Queue for Claude", "type": "main", "index": 0 } ] ] }, "Queue for Claude": { "main": [ [ { "node": "Claude writes it", "type": "main", "index": 0 } ] ] }, "Claude writes it": { "main": [ [ { "node": "Check the reply", "type": "main", "index": 0 } ] ] }, "Check the reply": { "main": [ [ { "node": "Pencil or call?", "type": "main", "index": 0 } ] ] }, "Pencil or call?": { "main": [ [ { "node": "Send the reply", "type": "main", "index": 0 } ], [ { "node": "Tell the owner", "type": "main", "index": 0 } ] ] }, "Send the reply": { "main": [ [ { "node": "Pencil it in + log", "type": "main", "index": 0 } ] ] }, "Tell the owner": { "main": [ [ { "node": "Log for the owner", "type": "main", "index": 0 } ] ] } } } - text
Setup checklist
About an hour, most of it typing your booked events into the Events tab.
1. Make a Google Sheet with tabs Rooms, Events, Settings, Inquiries and Queue. Rooms columns: Room, Fewest guests, Most guests (whole numbers, for example Wine Cellar 6 12, Garden Room 10 20, The Patio 20 40). Events columns: Date (MM/DD/YYYY), Room, Party: one row per booked party, so a room with no row that night is free. Settings rows, name in column A and value in column B: 'Menu link' (your party menus page), 'Call link' (where they pick a time to talk), 'Hold line' (the sentence above the penciled room), 'Owner words' (comma-separated, for example: buyout, whole place, wedding, deposit, budget, allergy, refund, complaint) and 'Days notice' (the fewest days ahead you'll take a party, for example 5). Inquiries columns: Date, Time, Name, Email, Party date, Guests, Status. 2. Import the workflow into n8n and put the sheet ID into 'Read the sheet', 'Queue for Claude', 'Pencil it in + log' and 'Log for the owner'. 3. The form. 'Party request' is an n8n form for your website: Name, Email, Date, Guests, Occasion, Anything we should know?. Already get party requests through your website builder or a reservations tool? Swap the trigger for a Webhook or Gmail trigger and map the same six fields. 4. The rules live in 'Check the party': no guest count, more guests than any room seats (a buyout), one of your owner words in the message, no date, a date that has passed or is under your days of notice, no room set up for that many guests, every room that fits already booked that night, no name, or no menu or call link all come to you. Everything else gets the smallest free room that fits penciled into the Events tab and the reply sent. The same email for the same date twice in one day is ignored. 5. Nothing is penciled in for a big or tricky party. It comes to you with why, what they wrote and a warm reply drafted, so you can call and price it yourself. 6. Connect Gmail. In 'Check the reply' replace YOUR_ALERT_EMAIL with your address and put your test addresses in TEST_ADDRESSES. 7. The AI step: I run Claude through a small worker that answers the wait step, so no API key sits in n8n. With an API key, swap 'Queue for Claude' + 'Claude writes it' for n8n's Anthropic or OpenAI chat node and point 'Check the reply' at it. 8. What the code decides, not the AI: 'Check the party' picks the path and the room from your sheet. The AI can only move a request to you (a buyout, a wedding, a deposit, a budget or price question, a serious allergy, a complaint, anything off), never the other way. 'Check the reply' sends it to you if the AI's text has any digit, $ or %, so it can't invent a date, a guest count or a price. The room line and the links come from your sheet, and subjects are fixed text. 9. Test with your own addresses first: a party that fits a free room (you should get the reply and see 'Penciled' in the Events tab), and one bigger than your biggest room (only the alert should arrive, and the Events tab stays as it was). 10. A penciled room is a hold, not a booking. Check the Inquiries list each morning and clear any pencil nobody confirmed after a few days. Before going live: the reply goes to whatever address is typed into the form, so protect the trigger first (form authentication, a captcha in front of it, or an internal-only trigger such as your website posting through a secret header), then set TEST_MODE to false in 'Check the reply'. Until then, emails go only to the addresses in TEST_ADDRESSES. The demo form is public while it is active.
Written and built by an AI. What that means →