Build pack: Missed-call responder build pack
Everything from the video: the prompt that writes the reply (or your call-back script), the importable n8n workflow with both paths, and the setup checklist.
Watch the build: full video · 60-second version
- prompt
The missed-call 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 business. [OWNER] was on a job and missed a call. The caller: {{ $json.name }}. Their voicemail: "{{ $json.voicemail }}". The code checked the customer list: {{ $json.said }}. If the code said route reply, write a short, warm email in [OWNER]'s voice, first person: sorry I missed your call, I was on a job; say back what they need in plain words; say they can pick a time with the link below or just reply. Sign it [OWNER]. If the code said route owner, write instead what [OWNER] should say on the call back: greet them by name, what they said, and the first question to ask. Read the voicemail: if it sounds like an emergency (water pouring or flooding, a gas smell, sewage, no water or no heat), or they sound angry, complain about past work, or mention a bill, say route owner: the owner calls those back. No prices, times, dates or numbers: the booking link is added from the sheet. Answer as JSON: {"route": "reply or owner", "why": "under 12 words", "intro": "under 45 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 missed call answered in seconds (code finds the caller on your customer list, AI writes back in your voice with your booking link; emergencies, new numbers and anything odd come to you with a call-back script drafted)", "nodes": [ { "name": "Missed call", "type": "n8n-nodes-base.formTrigger", "typeVersion": 2.2, "position": [ 0, 0 ], "parameters": { "formTitle": "[BUSINESS]", "formDescription": "Missed call + voicemail (your phone system sends these).", "formFields": { "values": [ { "fieldLabel": "Caller's number", "requiredField": true, "placeholder": "The number that called" }, { "fieldLabel": "Voicemail", "fieldType": "textarea" } ] }, "options": { "appendAttribution": false, "path": "missed-call", "respondWithOptions": { "values": { "formSubmittedText": "Voicemail received." } } } } }, { "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=Customers!A2:E2000&ranges=Settings!A2:B20&ranges=Callbacks!A2:F2000", "authentication": "predefinedCredentialType", "nodeCredentialType": "googleDriveOAuth2Api", "options": {} } }, { "name": "Find the caller", "type": "n8n-nodes-base.code", "typeVersion": 2, "position": [ 0, 448 ], "parameters": { "mode": "runOnceForAllItems", "language": "javaScript", "jsCode": "const T = s => String(s ?? '').trim();\nconst digits = s => { let d = T(s).replace(/\\D/g, ''); if (d.length === 11 && d[0] === '1') d = d.slice(1); return d; };\nconst F = $('Missed call').first().json;\nconst phone = digits(F[\"Caller's number\"]), vm = T(F[\"Voicemail\"]).replace(/\\s+/g, ' ').slice(0, 400);\nif (phone.length !== 10) return [];\nconst shown = `(${phone.slice(0, 3)}) ${phone.slice(3, 6)}-${phone.slice(6)}`;\nconst vr = $('Read the sheet').first().json.valueRanges || [];\nconst people = (vr[0] || {}).values || [], settings = (vr[1] || {}).values || [], log = (vr[2] || {}).values || [];\nconst today = $now.setZone('America/New_York').toFormat('MM/dd/yyyy');\nif (log.some(r => T(r[0]) === today && digits(r[3]) === phone)) return [];\nconst set = Object.fromEntries(settings.map(r => [T(r[0]).toLowerCase(), T(r[1])]));\nconst r = people.find(x => digits(x[0]) === phone);\nconst c = r ? { name: T(r[1]), email: T(r[2]).toLowerCase(), street: T(r[3]), last: T(r[4]) } : null;\nconst esc = s => s.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\$&');\nconst words = T(set['urgent words']).toLowerCase().split(',').map(T).filter(Boolean);\nconst low = vm.toLowerCase(), hit = words.find(x => new RegExp('\\\\b' + esc(x) + '\\\\b').test(low)) || '';\nconst link = T(set['booking link']), line = T(set['booking line']) || 'Pick a time that suits you:';\nlet why = '';\nif (hit) why = `urgent: the voicemail says \"${hit}\"`;\nelse if (!c) why = 'a number not on your customer list';\nelse if (!/^[^@\\s]+@[^@\\s]+\\.[^@\\s]+$/.test(c.email)) why = 'no email on file for this customer';\nelse if (!vm) why = 'no message left, worth a call';\nelse if (!link) why = 'no booking link on the Settings tab';\nconst name = c && c.name ? c.name : 'a new caller';\nconst facts = c ? `${c.name}, ${shown}, ${c.street || 'street not on file'}, last job: ${c.last || 'none'}` : `${shown}, not on your customer list`;\nreturn [{ json: { name, phone: shown, email: c ? c.email : '', voicemail: vm || 'none', facts, link, line,\n want: why ? 'owner' : 'reply', why, said: why ? `${why}, route owner (write the call-back script)` : `${facts}; a customer we can email, route reply` } }];" } }, { "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 business. [OWNER] was on a job and missed a call. The caller: {{ $json.name }}. Their voicemail: \"{{ $json.voicemail }}\". The code checked the customer list: {{ $json.said }}. If the code said route reply, write a short, warm email in [OWNER]'s voice, first person: sorry I missed your call, I was on a job; say back what they need in plain words; say they can pick a time with the link below or just reply. Sign it [OWNER]. If the code said route owner, write instead what [OWNER] should say on the call back: greet them by name, what they said, and the first question to ask. Read the voicemail: if it sounds like an emergency (water pouring or flooding, a gas smell, sewage, no water or no heat), or they sound angry, complain about past work, or mention a bill, say route owner: the owner calls those back. No prices, times, dates or numbers: the booking link is added from the sheet. Answer as JSON: {\"route\": \"reply or owner\", \"why\": \"under 12 words\", \"intro\": \"under 45 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:F: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 = [\"reply\", \"owner\"];\nconst m = String(b.route ?? '').trim().toLowerCase();\nout.route = MOODS.includes(m) ? m : \"owner\";\nconst c = $('Find the caller').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 call'); }\nelse if (ai !== 'reply') { out.route = 'owner'; out.why = 'the reply did not match the customer list, nothing was sent'; }\nif (out.route !== 'owner' && /[\\d$%]/.test(out.intro)) { out.route = 'owner'; out.why = 'the reply had a price, time or number in it, 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 === 'reply') { 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": "Who answers?", "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": "reply", "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": "Sorry I missed your call", "message": "={{ $('Check the reply').item.json.body.intro + '\\n\\n' + $('Find the caller').item.json.line + '\\n' + $('Find the caller').item.json.link }}", "options": { "appendAttribution": false, "senderName": "[BUSINESS]" } } }, { "name": "Log the reply", "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/Callbacks!A:F: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'), $('Find the caller').item.json.name, $('Find the caller').item.json.phone, $('Find the caller').item.json.voicemail.slice(0, 120), 'Replied: booking link 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": "Missed call: call them back", "message": "={{ 'Why it came to you: ' + $('Check the reply').item.json.body.why + '\\n\\nThe caller: ' + $('Find the caller').item.json.facts + '\\n\\nVoicemail: ' + $('Find the caller').item.json.voicemail + '\\n\\nCall-back script, drafted:\\n' + $('Check the reply').item.json.body.intro + '\\n\\nNothing was sent to the caller. It is on your Callbacks 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/Callbacks!A:F: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'), $('Find the caller').item.json.name, $('Find the caller').item.json.phone, $('Find the caller').item.json.voicemail.slice(0, 120), 'Call: ' + $('Check the reply').item.json.body.why ]] }) }}", "options": {} } } ], "connections": { "Missed call": { "main": [ [ { "node": "Read the sheet", "type": "main", "index": 0 } ] ] }, "Read the sheet": { "main": [ [ { "node": "Find the caller", "type": "main", "index": 0 } ] ] }, "Find the caller": { "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": "Who answers?", "type": "main", "index": 0 } ] ] }, "Who answers?": { "main": [ [ { "node": "Send the reply", "type": "main", "index": 0 } ], [ { "node": "Tell the owner", "type": "main", "index": 0 } ] ] }, "Send the reply": { "main": [ [ { "node": "Log the reply", "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 getting your customer list into the sheet and your phone system pointed at the trigger.
1. Make a Google Sheet with tabs Customers, Settings, Callbacks and Queue. Customers columns, in this order: Phone, Name, Email, Street, Last job. Settings rows, name in column A and value in column B: 'Booking link', 'Booking line' (the sentence above the link) and 'Urgent words' (comma-separated, e.g. pouring, flooding, burst, gas, sewage, no water, no heat). Callbacks columns: Date, Time, Name, Phone, Voicemail, Status. 2. Import the workflow into n8n and put the sheet ID into 'Read the sheet', 'Queue for Claude', 'Log the reply' and 'Log for the owner'. 3. The trigger. The demo uses a form with the caller's number and the voicemail text so you can test it by hand. In real use, point your phone system at it instead: most business phone apps (and Google Voice) can email each voicemail with a transcript, or post it to a webhook. Swap 'Missed call' for an n8n Webhook or Gmail trigger and map the number and transcript into the same two fields. 4. The rules live in 'Find the caller': the number is matched on digits only, so the same number written with brackets, dashes, spaces or a leading +1 is the same caller. A customer with an email and no urgent word gets the reply. Any urgent word, a number not on your list, a customer with no email, an empty voicemail or a missing booking link comes to you. The same number twice in one day is ignored. 5. Connect Gmail. In 'Check the reply' replace YOUR_ALERT_EMAIL with your address and put your test addresses in TEST_ADDRESSES. 6. 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. 7. What the code decides, not the AI: 'Find the caller' picks the path. The AI can only move a caller to you (an emergency the word list missed, an angry caller, a complaint about past work, a bill), never the other way. 'Check the reply' sends it to you if the AI's text has any digit, $ or %, so it can't promise a time or a price. The booking link comes from your sheet, and subjects are fixed text. 8. Want a text instead of an email? Add an SMS step (Twilio or your phone app's API) after 'Send the reply' with the same words. Keep the urgent path going to you: an emergency needs a person on the phone, not a link. 9. Test with your own addresses first: a normal job from a number on your list (you should get the reply), an emergency word (only the alert should arrive), and a number that isn't on your list. Before going live: the reply goes to the email on file for whatever number reaches the trigger, so protect the trigger first (form authentication, or an internal-only trigger such as your phone system 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 →