Build pack: Tenant repair requests build pack
Everything from the video: the prompt that writes the tenant reply and the job line (or the reply you decide on), the importable n8n workflow with both paths, and the setup checklist.
Watch the build: full video · 60-second version
- prompt
The repair request 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 rental building. A tenant just reported a repair. Their name: {{ $json.name }}, unit: {{ $json.unit }}, problem: {{ $json.problem }}. What they wrote: "{{ $json.note }}". The code checked the landlord's units and repair list: {{ $json.said }}. If the code said route send, write two things. intro: a short, warm reply to the tenant in [OWNER]'s voice, first person: thank them, mention the problem in their words so it feels personal, and say it's sorted and who's coming is right below. Sign it [OWNER]. job: one plain line for the repair person saying what to fix and where in the home. If the code said route owner, write instead a short, warm reply [OWNER] could send: thank them and say she's on it and will call. Sign it [OWNER]. job: one plain line saying what's wrong. Read what they wrote: if it sounds like an emergency (water pouring, flooding, a gas smell, sparks, no heat, no water), damage they caused, pests or mold, rent, the lease or a deposit, or anything feels off, say route owner. No prices, dates, days, times or numbers in the intro: who's coming and when is added from the sheet. Answer as JSON: {"route": "send or owner", "why": "under 12 words", "intro": "under 50 words", "job": "under 15 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 addresses.
{ "name": "Every repair request sent to the right repair person (code checks the unit and the tenant's email against your Units tab and picks the repair person for the problem from your Vendors tab, AI writes the tenant reply in your voice and a one-line job for the work order; water pouring, gas, sparks, no heat, a unit or email that doesn't match, rent, lease, mold or pests, or anything odd comes to you with a reply drafted, nothing sent)", "nodes": [ { "name": "Repair request", "type": "n8n-nodes-base.formTrigger", "typeVersion": 2.2, "position": [ 0, 0 ], "parameters": { "formTitle": "[BUSINESS]", "formDescription": "Tenants: report a repair.", "formFields": { "values": [ { "fieldLabel": "Name", "requiredField": true }, { "fieldLabel": "Email", "fieldType": "email", "requiredField": true }, { "fieldLabel": "Unit", "requiredField": true }, { "fieldLabel": "Problem", "fieldType": "dropdown", "requiredField": true, "fieldOptions": { "values": [ { "option": "Plumbing" }, { "option": "Heating" }, { "option": "Electrical" }, { "option": "Appliance" }, { "option": "Doors and locks" }, { "option": "Something else" } ] } }, { "fieldLabel": "What's wrong?", "fieldType": "textarea", "requiredField": true } ] }, "options": { "appendAttribution": false, "path": "repair-request", "respondWithOptions": { "values": { "formSubmittedText": "Thanks! Check your email." } } } } }, { "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=Units!A2:D500&ranges=Vendors!A2:D50&ranges=Settings!A2:B20&ranges=Requests!A2:G2000", "authentication": "predefinedCredentialType", "nodeCredentialType": "googleDriveOAuth2Api", "options": {} } }, { "name": "Check the request", "type": "n8n-nodes-base.code", "typeVersion": 2, "position": [ 0, 448 ], "parameters": { "mode": "runOnceForAllItems", "language": "javaScript", "jsCode": "const T = s => String(s ?? '').trim();\nconst F = $('Repair request').first().json;\nconst name = T(F['Name']).replace(/\\s+/g, ' ').slice(0, 60), email = T(F['Email']).toLowerCase();\nconst unit = T(F['Unit']).toUpperCase().replace(/^(APT\\.?|UNIT|#)\\s*/, '').replace(/\\s+/g, '').slice(0, 12) || 'none';\nconst problem = T(F['Problem']) || 'none';\nconst note = T(F[\"What's wrong?\"]).replace(/\\s+/g, ' ').slice(0, 400);\nif (!/^[^@\\s]+@[^@\\s]+\\.[^@\\s]+$/.test(email)) return [];\nconst vr = $('Read the sheet').first().json.valueRanges || [];\nconst units = (vr[0] || {}).values || [], vendors = (vr[1] || {}).values || [], settings = (vr[2] || {}).values || [], log = (vr[3] || {}).values || [];\nconst today = $now.setZone('America/New_York').toFormat('MM/dd/yyyy');\nif (log.some(r => T(r[0]) === today && T(r[3]).toLowerCase() === email && T(r[5]).toLowerCase() === problem.toLowerCase())) return [];\nconst set = Object.fromEntries(settings.map(r => [T(r[0]).toLowerCase(), T(r[1])]));\nconst list = k => T(set[k]).toLowerCase().split(',').map(T).filter(Boolean);\nconst low = note.toLowerCase();\nconst urgent = list('urgent words').find(u => low.includes(u)), owner = list('owner words').find(u => low.includes(u));\nconst u = units.find(r => T(r[0]).toUpperCase().replace(/\\s+/g, '') === unit);\nconst onFile = u ? T(u[3]).toLowerCase() : '', address = u ? T(u[1]) : '';\nconst v = vendors.find(r => T(r[0]).toLowerCase() === problem.toLowerCase());\nconst vendor = v ? T(v[1]) : '', vendorEmail = v ? T(v[2]).toLowerCase() : '', told = v ? T(v[3]) : '';\nconst link = T(set['update link']), line = T(set['tenant line']) || 'I have sent this to:';\nlet why = '';\nif (urgent) why = '\"' + urgent + '\" in what they wrote: call them now';\nelse if (!u) why = unit === 'none' ? 'no unit given' : 'unit ' + unit + ' is not on your Units tab';\nelse if (!onFile || onFile !== email) why = 'the email is not the one on file for unit ' + unit;\nelse if (!vendor || !/^[^@\\s]+@[^@\\s]+\\.[^@\\s]+$/.test(vendorEmail)) why = problem === 'none' ? 'no problem picked' : 'no repair person for ' + problem + ' on your Vendors tab';\nelse if (owner) why = '\"' + owner + '\" in what they wrote, worth a call';\nelse if (!name) why = 'no name on the request';\nelse if (!link || !told) why = 'no update link or no line for the tenant on your sheet';\nconst facts = (name || 'no name') + ', unit ' + unit + ', ' + problem;\nreturn [{ json: { name: name || 'there', email, unit, problem, note: note || 'nothing written', facts, address,\n vendor, vendorEmail, vendorLine: vendor ? vendor + ' ' + told : '', who: vendor ? vendor + ' (' + problem + ')' : 'nobody on your Vendors tab for this', link, line,\n want: why ? 'owner' : 'send', why, said: why ? why + ', route owner (draft a reply for the owner to send)' : 'unit ' + unit + ' is on the list and ' + vendor + ' does ' + problem + ', route send' } }];" } }, { "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 rental building. A tenant just reported a repair. Their name: {{ $json.name }}, unit: {{ $json.unit }}, problem: {{ $json.problem }}. What they wrote: \"{{ $json.note }}\". The code checked the landlord's units and repair list: {{ $json.said }}. If the code said route send, write two things. intro: a short, warm reply to the tenant in [OWNER]'s voice, first person: thank them, mention the problem in their words so it feels personal, and say it's sorted and who's coming is right below. Sign it [OWNER]. job: one plain line for the repair person saying what to fix and where in the home. If the code said route owner, write instead a short, warm reply [OWNER] could send: thank them and say she's on it and will call. Sign it [OWNER]. job: one plain line saying what's wrong. Read what they wrote: if it sounds like an emergency (water pouring, flooding, a gas smell, sparks, no heat, no water), damage they caused, pests or mold, rent, the lease or a deposit, or anything feels off, say route owner. No prices, dates, days, times or numbers in the intro: who's coming and when is added from the sheet. Answer as JSON: {\"route\": \"send or owner\", \"why\": \"under 12 words\", \"intro\": \"under 50 words\", \"job\": \"under 15 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);\nout[\"job\"] = String(b[\"job\"] ?? '').slice(0, 200);\nconst MOODS = [\"send\", \"owner\"];\nconst m = String(b.route ?? '').trim().toLowerCase();\nout.route = MOODS.includes(m) ? m : \"owner\";\nconst c = $('Check the request').first().json;\nconst ai = String(b.route ?? '').trim().toLowerCase(), aiWhy = out.why.replace(/\\s+/g, ' ').trim();\nout.job = String(b.job ?? '').replace(/\\s+/g, ' ').trim().slice(0, 200);\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 !== 'send') { out.route = 'owner'; out.why = 'the reply did not match your units and repair list, nothing was sent'; }\nif (out.route !== 'owner' && /[\\d$%]/.test(out.intro)) { out.route = 'owner'; out.why = 'the reply had a day, a time or a price in it, nothing was sent'; }\nif (out.route !== 'owner' && (/[$%]/.test(out.job) || out.job.length < 5)) { out.route = 'owner'; out.why = 'the job line for the repair person looked wrong, 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.job) out.job = c.problem;\nif (!out.why) out.why = 'worth a look before it is sent';\nout.to = ''; out.vendorTo = '';\nif (out.route === 'send') { const to = String(c.email || '').trim().toLowerCase(), vt = String(c.vendorEmail || '').trim().toLowerCase();\n if (!/^[^@\\s]+@[^@\\s]+\\.[^@\\s]+$/.test(to) || !/^[^@\\s]+@[^@\\s]+\\.[^@\\s]+$/.test(vt)) throw new Error('send blocked: not one of our test addresses');\n out.to = to; out.vendorTo = vt; }\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, out.vendorTo].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": "Send 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": "send", "operator": { "type": "string", "operation": "equals" } } ], "combinator": "and" }, "options": {} } }, { "name": "Reply to the tenant", "type": "n8n-nodes-base.gmail", "typeVersion": 2.1, "position": [ -260, 1792 ], "parameters": { "sendTo": "={{ $('Check the reply').item.json.body.to }}", "emailType": "text", "subject": "Your repair request at [BUSINESS]", "message": "={{ $('Check the reply').item.json.body.intro + '\\n\\n' + $('Check the request').item.json.line + '\\n' + $('Check the request').item.json.vendorLine + '\\n\\nSomething changes or gets worse? ' + $('Check the request').item.json.link }}", "options": { "appendAttribution": false, "senderName": "[BUSINESS]" } } }, { "name": "Send the work order", "type": "n8n-nodes-base.gmail", "typeVersion": 2.1, "position": [ -260, 2016 ], "parameters": { "sendTo": "={{ $('Check the reply').item.json.body.vendorTo }}", "emailType": "text", "subject": "New repair job from [BUSINESS]", "message": "={{ 'Job: ' + $('Check the reply').item.json.body.job + '\\n\\nWhere: ' + $('Check the request').item.json.address + '\\nTenant: ' + $('Check the request').item.json.name + ', ' + $('Check the request').item.json.email + '\\nThey wrote: ' + $('Check the request').item.json.note + '\\n\\nPlease call the tenant to set a time and reply here when it is booked. Thanks, [OWNER]' }}", "options": { "appendAttribution": false, "senderName": "[BUSINESS]" } } }, { "name": "Log the job", "type": "n8n-nodes-base.httpRequest", "typeVersion": 4.2, "position": [ -260, 2240 ], "parameters": { "method": "POST", "url": "https://sheets.googleapis.com/v4/spreadsheets/YOUR_GOOGLE_SHEET_ID/values/Requests!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 request').item.json.name, $('Check the request').item.json.email, $('Check the request').item.json.unit, $('Check the request').item.json.problem, 'Sent to ' + $('Check the request').item.json.vendor ]] }) }}", "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 repair request to call about", "message": "={{ 'Why it came to you: ' + $('Check the reply').item.json.body.why + '\\n\\nThe tenant: ' + $('Check the request').item.json.facts + '\\n\\nThey wrote: ' + $('Check the request').item.json.note + '\\n\\nWho does this job: ' + $('Check the request').item.json.who + '\\n\\nReply, drafted:\\n' + $('Check the reply').item.json.body.intro + '\\n\\nNothing was sent to the tenant or a repair person. They are on your Requests 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/Requests!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 request').item.json.name, $('Check the request').item.json.email, $('Check the request').item.json.unit, $('Check the request').item.json.problem, 'Owner: ' + $('Check the reply').item.json.body.why ]] }) }}", "options": {} } } ], "connections": { "Repair request": { "main": [ [ { "node": "Read the sheet", "type": "main", "index": 0 } ] ] }, "Read the sheet": { "main": [ [ { "node": "Check the request", "type": "main", "index": 0 } ] ] }, "Check the request": { "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": "Send or call?", "type": "main", "index": 0 } ] ] }, "Send or call?": { "main": [ [ { "node": "Reply to the tenant", "type": "main", "index": 0 } ], [ { "node": "Tell the owner", "type": "main", "index": 0 } ] ] }, "Reply to the tenant": { "main": [ [ { "node": "Send the work order", "type": "main", "index": 0 } ] ] }, "Send the work order": { "main": [ [ { "node": "Log the job", "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 filling in your Units and Vendors tabs.
1. Make a Google Sheet with tabs Units, Vendors, Settings, Requests and Queue. Units columns: Unit, Address, Tenant, Email (the address each tenant uses with you). Vendors columns: Problem, Vendor, Email, Tenant is told: one row per problem type, for example Plumbing, your plumber, their email, and the line the tenant reads after the vendor's name ('will call you within one business day to set a time.'). Settings rows, name in column A and value in column B: 'Tenant line' (the sentence above the vendor), 'Update link' (where tenants report a change), 'Urgent words' (comma-separated, for example: pouring, flooding, burst, gas, smoke, sparks, fire, no heat, no water, sewage, carbon monoxide, locked out) and 'Owner words' (for example: rent, lease, deposit, mold, mice, rats, roaches, bed bugs, refund, lawyer, i broke). Requests columns: Date, Time, Name, Email, Unit, Problem, Status. 2. Import the workflow into n8n and put the sheet ID into 'Read the sheet', 'Queue for Claude', 'Log the job' and 'Log for the owner'. 3. The form. 'Repair request' is an n8n form for your tenant page: Name, Email, Unit, Problem, What's wrong?. Edit the Problem dropdown to match your Vendors tab. Already take requests in a property app? Swap the trigger for a Webhook and map the same five fields. 4. The rules live in 'Check the request': an urgent word, a unit that isn't on your Units tab, an email that isn't the one on file for that unit, a problem with no repair person on your Vendors tab, an owner word, no name, or no update link all come to you. Everything else goes to the repair person for that problem. The same email for the same problem twice in one day is ignored. 5. An emergency never gets a form letter. Water pouring, a gas smell or sparks comes to you with why, what they wrote, who does that job and a reply drafted, so you can call the tenant and the repair person now. 6. Connect Gmail. In 'Check the reply' replace YOUR_ALERT_EMAIL with your address and put your test addresses in TEST_ADDRESSES (your own address standing in for a tenant, and one standing in for a repair person). 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 request' picks the path and the repair person from your sheet. The AI can only move a request to you (an emergency, damage the tenant caused, pests or mold, rent or the lease, anything off), never the other way. 'Check the reply' sends it to you if the AI's reply to the tenant has any digit, $ or %, so it can't promise a day, a time or a price. Who's coming and when comes from your Vendors tab, and subjects are fixed text. 9. Test with your own addresses first: a dripping tap from a unit on your list (the tenant reply and the work order should arrive, and a 'Sent to' row on Requests), and one that says 'water pouring through the ceiling' (only your alert should arrive). 10. The work order is a heads-up, not a booking. Ask your repair people to reply when the visit is set, and check the Requests list each morning for anything still open. Before going live: the tenant reply goes to the email on file for the unit, but the form itself is public, so protect the trigger first (form authentication, a captcha in front of it, or an internal-only trigger such as your tenant portal 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 →