Ask patients for feedback the day after their visit
The day after a visit, each patient gets a WhatsApp message with a short feedback form.
How it works
- Read the Appointments sheet.
- Find yesterday's completed visits that haven't been asked yet.
- Send a WhatsApp template with your feedback form link.
- Mark each row as sent.
Diagram
Code
JavaScript used in the Code step — already included in the template below.
// Appointments sheet columns: date (YYYY-MM-DD) | time | patient | phone | doctor | status | feedback_sent
// Keeps yesterday's completed visits that haven't been asked for feedback.
const yesterday = new Date(Date.now() - 24 * 60 * 60 * 1000).toISOString().slice(0, 10);
return $input.all()
.map((item) => item.json)
.filter((a) => String(a.date).slice(0, 10) === yesterday)
.filter((a) => String(a.status).toLowerCase() === "done" && !a.feedback_sent && a.phone)
.map((a) => ({
json: {
row_number: a.row_number,
phone: String(a.phone).replace(/[^0-9]/g, ""),
patient: a.patient,
doctor: a.doctor,
},
}));Build it
Pick your tool — same automation, step by step.
Copy and paste straight into an n8n canvas (Ctrl+V), or download and use Import from File. Then connect your own credentials and replace every YOUR_… placeholder.
Show code (203 lines)
{
"name": "Ask patients for feedback the day after their visit (Flowngn)",
"nodes": [
{
"parameters": {
"content": "## Ask patients for feedback the day after their visit\nThe day after a visit, each patient gets a WhatsApp message with a short feedback form.\n\n**Setup**\n1. Open each node and connect your own credentials.\n2. Replace every YOUR_… placeholder.\n3. Test once, then activate.\n\nFree template from Flowngn",
"height": 260,
"width": 340
},
"id": "43ef734d-6128-488d-aff4-ce1dfd7659e4",
"name": "Setup notes",
"type": "n8n-nodes-base.stickyNote",
"typeVersion": 1,
"position": [
-420,
-60
]
},
{
"parameters": {
"rule": {
"interval": [
{
"triggerAtHour": 11
}
]
}
},
"id": "43ef734d-6128-488d-aff4-ce1dfd7659e4",
"name": "Every day 11:00",
"type": "n8n-nodes-base.scheduleTrigger",
"typeVersion": 1.2,
"position": [
0,
0
]
},
{
"parameters": {
"operation": "read",
"documentId": {
"__rl": true,
"value": "YOUR_SPREADSHEET_ID",
"mode": "id"
},
"sheetName": {
"__rl": true,
"value": "Appointments",
"mode": "name"
},
"options": {}
},
"id": "43ef734d-6128-488d-aff4-ce1dfd7659e4",
"name": "Read appointments",
"type": "n8n-nodes-base.googleSheets",
"typeVersion": 4.5,
"position": [
300,
0
]
},
{
"parameters": {
"jsCode": "// Appointments sheet columns: date (YYYY-MM-DD) | time | patient | phone | doctor | status | feedback_sent\n// Keeps yesterday's completed visits that haven't been asked for feedback.\nconst yesterday = new Date(Date.now() - 24 * 60 * 60 * 1000).toISOString().slice(0, 10);\n\nreturn $input.all()\n .map((item) => item.json)\n .filter((a) => String(a.date).slice(0, 10) === yesterday)\n .filter((a) => String(a.status).toLowerCase() === \"done\" && !a.feedback_sent && a.phone)\n .map((a) => ({\n json: {\n row_number: a.row_number,\n phone: String(a.phone).replace(/[^0-9]/g, \"\"),\n patient: a.patient,\n doctor: a.doctor,\n },\n }));"
},
"id": "43ef734d-6128-488d-aff4-ce1dfd7659e4",
"name": "Yesterday's visits",
"type": "n8n-nodes-base.code",
"typeVersion": 2,
"position": [
600,
0
]
},
{
"parameters": {
"operation": "sendTemplate",
"phoneNumberId": "YOUR_PHONE_NUMBER_ID",
"recipientPhoneNumber": "={{ $json.phone }}",
"template": "YOUR_FEEDBACK_TEMPLATE|ar",
"components": {
"component": [
{
"type": "body",
"bodyParameters": {
"parameter": [
{
"type": "text",
"text": "={{ $json.patient }}"
},
{
"type": "text",
"text": "={{ $json.doctor }}"
},
{
"type": "text",
"text": "YOUR_FEEDBACK_FORM_LINK"
}
]
}
}
]
}
},
"id": "43ef734d-6128-488d-aff4-ce1dfd7659e4",
"name": "Ask for feedback",
"type": "n8n-nodes-base.whatsApp",
"typeVersion": 1,
"position": [
900,
0
]
},
{
"parameters": {
"operation": "update",
"documentId": {
"__rl": true,
"value": "YOUR_SPREADSHEET_ID",
"mode": "id"
},
"sheetName": {
"__rl": true,
"value": "Appointments",
"mode": "name"
},
"columns": {
"mappingMode": "defineBelow",
"value": {
"row_number": "={{ $('Yesterday\\'s visits').item.json.row_number }}",
"feedback_sent": "={{ $now.toISODate() }}"
},
"matchingColumns": [
"row_number"
]
},
"options": {}
},
"id": "43ef734d-6128-488d-aff4-ce1dfd7659e4",
"name": "Mark as sent",
"type": "n8n-nodes-base.googleSheets",
"typeVersion": 4.5,
"position": [
1200,
0
]
}
],
"connections": {
"Every day 11:00": {
"main": [
[
{
"node": "Read appointments",
"type": "main",
"index": 0
}
]
]
},
"Read appointments": {
"main": [
[
{
"node": "Yesterday's visits",
"type": "main",
"index": 0
}
]
]
},
"Yesterday's visits": {
"main": [
[
{
"node": "Ask for feedback",
"type": "main",
"index": 0
}
]
]
},
"Ask for feedback": {
"main": [
[
{
"node": "Mark as sent",
"type": "main",
"index": 0
}
]
]
}
},
"pinData": {},
"settings": {
"executionOrder": "v1"
},
"meta": {
"templateCredsSetupCompleted": false
},
"tags": []
}In Make, create a new scenario and add these modules in order:
- Schedule the scenario: Every day 11:00
- Google Sheets › Search Rows
- Tools › Set variable / Iterator + Array aggregator (same logic as the Code step)
- WhatsApp Business Cloud › Send a Template Message
- Google Sheets › Update a Row
- Every module run uses Make operations — the free plan includes a monthly quota.
- Make's built-in functions (map, sum, formatDate…) can replace most Code steps; for complex logic use a code module.
- Module and step names can differ slightly as Make and Zapier update their apps.
In Zapier, create a new Zap and add these steps in order:
- Schedule by Zapier — Every day 11:00
- Google Sheets — Lookup Spreadsheet Rows (or Code by Zapier)
- Code by Zapier — Run JavaScript (paste the code from the Code section)
- WhatsApp — Send Template Message
- Google Sheets — Update Spreadsheet Row
- Zaps with more than two steps need a paid Zapier plan.
- Webhooks, Filters/Paths and Code by Zapier are premium features on some Zapier plans.
- Code by Zapier runs JavaScript: reuse the code shown above, reading inputs from inputData instead of $json.
- Module and step names can differ slightly as Make and Zapier update their apps.
Tips
- Pair it with the negative feedback alert flow so a manager calls unhappy patients the same day.
Related flows
Rebook missed clinic appointments on WhatsApp
Every evening, patients who missed today's appointment get a kind WhatsApp message offering a new time.
New patient forms to a sheet, with a reception alert
When a new patient fills your online form, save it to a sheet and alert reception on Telegram to call them.
Bosta delivery updates to customers on WhatsApp
Customers get a WhatsApp message when their Bosta shipment is picked up, out for delivery or delivered.