{"workflow":{"id":13733,"name":"Manage WhatsApp vehicle service reminders and bookings with WATI and Google Sheets","views":91,"recentViews":1,"totalViews":91,"createdAt":"2026-02-26T12:36:49.139Z","description":"Streamline your automotive service center's operations with this comprehensive automation. This workflow manages the entire customer lifecycle—from automated service reminders and instant appointment booking via WhatsApp to mileage tracking and full service history logs—all synchronized in real-time with Google Sheets and WATI.\n\n---\n\n## 🎯 What This Workflow Does\n\nThis template transforms WhatsApp into a self-service hub for vehicle owners and a management tool for garage staff:\n\n### ⏰ Automated Reminders\n\n**Service Due:**  \nEvery morning at 9 AM, the bot scans your database and identifies vehicles due for service based on either their next service date or mileage threshold, sending a personalized WhatsApp alert to the owner.\n\n**Appointment Prep:**  \nAt 8 AM daily, the system reminds owners of their confirmed appointments for the following day, reducing no-shows.\n\n---\n\n### 📅 Instant Booking & Confirmation\n\nWhen an owner replies with `book`, the bot dynamically generates available slots for the next 3 weekdays. Owners pick a slot (e.g., `confirm 1`), and the appointment is instantly logged in your **Appointments** sheet with a confirmation message sent back.\n\n---\n\n### 📏 Mileage & Status Management\n\nOwners can update their odometer reading anytime by sending `mileage &lt;km&gt;`. The bot automatically recalculates their next service point and warns them if they are approaching a critical maintenance interval.\n\n---\n\n### 📋 History & Staff Tools\n\n**Customer View:**  \nOwners can request their vehicle's full status card or a detailed history of their last 5 service records.\n\n**Staff Logging:**  \nGarage technicians can log completed work using a simple command (e.g., `logservice MH12... 52000 Oil Change 2500`), which automatically updates the service history and resets the reminder cycle.\n\n---\n\n## ✨ Key Features\n\n- **Intelligent Odometer Tracking:** Predicts service needs by comparing current mileage against individual service intervals.\n- **Dynamic Slot Generation:** Automatically avoids weekends and generates morning/afternoon options to simplify the booking experience.\n- **Command-Based Routing:** Uses an intuitive keyword system (`book`, `status`, `history`, `mileage`) to handle multiple customer requests simultaneously.\n- **Duplicate Prevention:** Tracks \"reminders sent\" to ensure customers aren't pestered with multiple alerts for the same service period.\n\n---\n\n## 💼 Perfect For\n\n- **Independent Garages:** Providing a \"dealership-level\" digital experience without expensive software.\n- **Fleet Managers:** Tracking maintenance schedules for corporate vehicles.\n- **Car Dealerships:** Automating follow-ups for post-purchase service packages.\n- **Motorcycle Repair Shops:** Managing quick oil changes and seasonal check-ups.\n\n---\n\n## 🔧 What You'll Need\n\n### Required Integrations\n\n- **WATI:** For WhatsApp messaging and handling incoming customer commands.\n- **Google Sheets:** To act as your 3-part database (`Vehicles`, `Appointments`, and `ServiceHistory`).\n\n---\n\n## ⚙️ Configuration Steps\n\n1. **Google Sheet Setup:** Create a sheet with three tabs:\n   - `Vehicles`\n   - `Appointments`\n   - `ServiceHistory`\n\n2. **Document ID:** Replace `YOUR_GOOGLE_SHEET_ID` in every Google Sheets node with your specific sheet's ID.\n\n3. **Credentials:** Connect your Google Sheets OAuth2 and WATI account credentials in n8n.\n\n---\n\nReady to automate your service bay? Import this template, connect your Google Sheet, and start sending intelligent reminders to your customers today!","workflow":{"meta":{"instanceId":"277842713620d9f5554de3b1518b865a152c8c4db680008bd8aec536fc18b4a8","templateCredsSetupCompleted":true},"nodes":[{"id":"6c067f10-854c-46ac-897c-4534d8cbeaae","name":"📋 Flow Overview","type":"n8n-nodes-base.stickyNote","position":[-1728,5696],"parameters":{"width":660,"height":720,"content":"## 🚗 WhatsApp Vehicle Service Reminder – Booking & History Tracking\n\n**How it works:**\n1. A scheduled trigger runs every morning and checks all vehicles in Google Sheets for upcoming or overdue service (by date or mileage)\n2. Personalised reminder messages are sent via WATI to each vehicle owner\n3. Owner replies *book* → bot shows available time slots → owner picks one → appointment logged in Sheets\n4. Owner can update their mileage anytime by sending *mileage <km>* — bot recalculates next service point\n5. A second schedule runs every morning and reminds owners of appointments due tomorrow\n6. Owner can send *history* to see past services or *status* to view their vehicle card\n7. Garage staff send *logservice* to record a completed service — resets the reminder cycle\n\n**Credentials needed:** WATI (wati - templates), Google Sheets OAuth2\n\n**Google Sheets — 3 tabs:**\n- **Vehicles** — one row per vehicle: phone, owner, reg, make, model, mileage, service schedule, status\n- **Appointments** — booked slots: vehicle, date, time slot, service type, status\n- **ServiceHistory** — completed services: date, mileage at service, work done, cost\n\n**Replace `YOUR_GOOGLE_SHEET_ID` in all Sheets nodes after import.**"},"typeVersion":1},{"id":"098a806a-3eda-4fc6-851b-f4e22fa976ab","name":"Sticky – Scheduled Reminder","type":"n8n-nodes-base.stickyNote","position":[-352,6240],"parameters":{"color":7,"width":1440,"height":336,"content":"### 1️⃣ Scheduled Service Reminder\n**Schedule Trigger – 9AM Daily** fires every morning.\n**Sheets – Read All Vehicles** fetches every row from the Vehicles tab.\n**Check Service Due Code** applies two checks per vehicle: (a) nextServiceDate ≤ today + 7 days, and (b) nextServiceMileage - currentMileage ≤ 500 km. Skips vehicles where reminderSent = Yes or status = Booked. Returns one item per due vehicle with a pre-built reminder message.\n**Sheets – Mark Reminder Sent** updates reminderSent = Yes and status = Overdue if past due date, preventing duplicate reminders on following days.\n**WATI – Send Service Reminder** sends the personalised reminder to the owner's WhatsApp with *book*, *status* and *history* reply options."},"typeVersion":1},{"id":"9e5ebd30-03bf-4aa3-841e-319d3245b5ab","name":"Sticky – Appointment Reminder","type":"n8n-nodes-base.stickyNote","position":[1248,6384],"parameters":{"color":7,"width":1200,"height":288,"content":"### 2️⃣ Day-Before Appointment Reminder\n**Schedule Trigger – 8AM Daily** fires separately every morning.\n**Sheets – Read Appointments** fetches all rows from the Appointments tab.\n**Check Tomorrow Appointments Code** filters for rows where appointmentDate = tomorrow and status = Confirmed. Returns one item per appointment due tomorrow.\n**WATI – Send Appointment Reminder** sends a reminder with the service time and a *cancel* option."},"typeVersion":1},{"id":"b70b22d5-8872-4138-b0c1-2582a07181c7","name":"Sticky – Inbound Routing","type":"n8n-nodes-base.stickyNote","position":[-1088,6640],"parameters":{"color":7,"width":672,"height":608,"content":"### 3️⃣ Inbound Reply Routing\n**Wati Trigger** receives all inbound WhatsApp messages from vehicle owners and garage staff.\n**Command Router Switch** detects the reply keyword and routes to the correct path:\n- `book` → show available booking slots\n- `mileage <km>` → update odometer reading\n- `history` → show past service records\n- `status` → show vehicle details card\n- `logservice <reg> <km> <work> <cost>` → garage staff logs a completed service\n- `confirm <number>` → owner confirms a slot selection\n- anything else → help card"},"typeVersion":1},{"id":"05706c60-7970-42c2-8b23-ece352f94839","name":"Sticky – Book & Confirm","type":"n8n-nodes-base.stickyNote","position":[-368,6640],"parameters":{"color":7,"width":1520,"height":608,"content":"### 4️⃣ Book Appointment & Confirm Slot\n**Sheets – Find Vehicle for Booking** reads Vehicles tab to get owner's vehicle details.\n**Parse Book & Generate Slots Code** finds the owner's vehicle by phone, generates 4 available time slots across the next 3 weekdays (Mon–Fri, 10AM and 2PM), and sends a numbered slot list.\n**WATI – Send Available Slots** sends the slot menu to the owner.\n\nWhen owner replies with *1*, *2*, *3* or *4*:\n**Sheets – Find Vehicle for Confirm** re-reads vehicle details.\n**Handle Slot Confirmation Code** maps the chosen number to the regenerated slot, creates a unique appointment ID, and builds a confirmation message.\n**Sheets – Log Appointment** appends a new row to the Appointments tab with status = Confirmed.\n**WATI – Confirm Appointment** sends the booking confirmation to the owner."},"typeVersion":1},{"id":"d89ab938-2d4f-45a1-bbbe-50359094498a","name":"Sticky – Mileage Update","type":"n8n-nodes-base.stickyNote","position":[1248,6800],"parameters":{"color":7,"width":1200,"height":336,"content":"### 5️⃣ Mileage Update\nOwner sends: *mileage 51650*\n**Sheets – Find Vehicle for Mileage** reads the owner's current vehicle record.\n**Parse Mileage Update Code** extracts the new km value, recalculates nextServiceMileage = lastServiceMileage + serviceIntervalKm, flags as Overdue if already past the service point, and builds a response showing km remaining to next service.\n**Sheets – Update Mileage** updates currentMileage, nextServiceMileage and status in Vehicles tab.\n**WATI – Send Mileage Ack** confirms the update and warns if service is due soon."},"typeVersion":1},{"id":"6fa7e405-9591-4182-acf0-854a75463146","name":"Sticky – History, Status & Log","type":"n8n-nodes-base.stickyNote","position":[-1088,7280],"parameters":{"color":7,"width":3136,"height":400,"content":"### 6️⃣ History · Status · Log Service\n**History path** — *Sheets – Read Service History* fetches the ServiceHistory tab. **Build History View Code** filters by phone, sorts newest-first, formats last 5 records with date, mileage, work done and cost. **WATI – Send History** delivers the service log card.\n\n**Status path** — *Sheets – Read Vehicle for Status* fetches the Vehicles tab. **Build Vehicle Status Code** builds a full vehicle card showing reg, model, current mileage, next service date and km, and current status badge. **WATI – Send Vehicle Status** delivers the card.\n\n**Log Service path** (garage staff) — *Parse Log Service Code* parses: *logservice MH12AB3456 52000 Oil change 2500*. **Sheets – Append Service Record** writes a new row to ServiceHistory. **WATI – Confirm Service Logged** confirms to the staff member.\n\n**Help fallback** — *WATI – Send Help* delivers the command menu when no keyword matches."},"typeVersion":1},{"id":"ab162e9b-6076-4f71-a377-1ccd4f0190db","name":"Schedule Trigger – 8AM Daily","type":"n8n-nodes-base.scheduleTrigger","position":[1328,6544],"parameters":{"rule":{"interval":[{"field":"cronExpression","expression":"0 8 * * *"}]}},"typeVersion":1.2},{"id":"b36cb999-aa78-4eaf-b0d9-e583f15c40ee","name":"Schedule Trigger – 9AM Daily1","type":"n8n-nodes-base.scheduleTrigger","position":[-272,6400],"parameters":{"rule":{"interval":[{"field":"cronExpression","expression":"0 9 * * *"}]}},"typeVersion":1.2},{"id":"f3e0ef52-c8d8-46a5-a0a6-f580f5b21bb4","name":"Sheets – Read All Vehicles1","type":"n8n-nodes-base.googleSheets","position":[-32,6400],"parameters":{"options":{},"sheetName":{"__rl":true,"mode":"list","value":"gid=0","cachedResultUrl":"https://docs.google.com/spreadsheets/d/1eTlVJbSiz8P8PpjaqXgkRsZF8oeBTH_4kDtC5oaoTpI/edit#gid=0","cachedResultName":"Vehicles Tab"},"documentId":{"__rl":true,"mode":"list","value":"1eTlVJbSiz8P8PpjaqXgkRsZF8oeBTH_4kDtC5oaoTpI","cachedResultUrl":"https://docs.google.com/spreadsheets/d/1eTlVJbSiz8P8PpjaqXgkRsZF8oeBTH_4kDtC5oaoTpI/edit?usp=drivesdk","cachedResultName":"Vehicles - Wati"}},"credentials":{"googleSheetsOAuth2Api":{"id":"Kz2DdSp11rxqwlFt","name":"Google Sheets account - Deepanshi"}},"typeVersion":4.5},{"id":"72f5f0fe-639f-456d-8faa-6662aa89efa7","name":"Check Service Due1","type":"n8n-nodes-base.code","position":[208,6400],"parameters":{"jsCode":"const allRows = $input.all();\nconst now     = new Date();\nconst todayMs = now.getTime();\nconst sevenDaysMs = 7 * 24 * 60 * 60 * 1000;\n\nconst due = [];\nfor (const r of allRows) {\n  const v = r.json;\n  if ((v.reminderSent || '').toLowerCase() === 'yes') continue;\n  if ((v.status      || '').toLowerCase() === 'booked') continue;\n  if (!v.phone) continue;\n\n  let isDue = false; let urgency = 'normal';\n\n  if (v.nextServiceDate) {\n    try {\n      const diff = new Date(v.nextServiceDate).getTime() - todayMs;\n      if (diff <= sevenDaysMs) { isDue = true; urgency = diff < 0 ? 'overdue' : diff <= 2*86400000 ? 'critical' : 'normal'; }\n    } catch(e) {}\n  }\n  const curKm  = parseFloat(v.currentMileage || 0);\n  const nextKm = parseFloat(v.nextServiceMileage || 0);\n  if (nextKm > 0 && (nextKm - curKm) <= 500) { isDue = true; if (curKm >= nextKm) urgency = 'overdue'; }\n\n  if (!isDue) continue;\n\n  const urgencyLine = { overdue:'⚠️ *OVERDUE* — Please book immediately!', critical:'🔴 *Due in 1–2 days* — Book now!', normal:'🔔 Service due soon' }[urgency];\n  const dateStr  = v.nextServiceDate ? new Date(v.nextServiceDate).toLocaleDateString('en-IN',{day:'numeric',month:'short',year:'numeric'}) : 'Not set';\n  const kmLine   = nextKm > 0 ? `🛣️ Next service: *${parseInt(nextKm).toLocaleString()} km*  (now: *${parseInt(curKm).toLocaleString()} km*)` : '';\n\n  const msg = [\n    `🔧 *Service Reminder — ${v.vehicleReg || 'Your Vehicle'}*`,\n    `👤 Hi *${v.ownerName || 'Owner'}!*`, '',\n    `🚗 ${v.make||''} ${v.model||''} ${v.year||''} · *${v.vehicleReg||''}*`,\n    urgencyLine, '',\n    `📅 Date due: *${dateStr}*`, kmLine, '',\n    '─────────────────────',\n    'Reply *book* → schedule an appointment',\n    'Reply *status* → view vehicle details',\n    'Reply *history* → view past services'\n  ].filter(Boolean).join('\\n');\n\n  due.push({ json: { phone: v.phone, vehicleReg: v.vehicleReg, ownerName: v.ownerName, urgency, reminderMsg: msg } });\n}\nif (due.length === 0) return [{ json: { message: 'No vehicles due today', count: 0 } }];\nreturn due;\n"},"typeVersion":2},{"id":"34bca1ba-c9a7-4885-a88c-7105d48d1c09","name":"Sheets – Mark Reminder Sent1","type":"n8n-nodes-base.googleSheets","position":[448,6400],"parameters":{"columns":{"value":{"phone":"={{ $json.phone }}","status":"={{ $json.urgency === 'overdue' ? 'Overdue' : 'Active' }}","reminderSent":"Yes"},"schema":[{"id":"phone","type":"string","display":true,"required":true,"displayName":"phone","defaultMatch":true,"canBeUsedToMatch":true}],"mappingMode":"defineBelow","matchingColumns":["phone"]},"options":{},"operation":"update","sheetName":{"__rl":true,"mode":"list","value":"gid=0","cachedResultUrl":"https://docs.google.com/spreadsheets/d/1eTlVJbSiz8P8PpjaqXgkRsZF8oeBTH_4kDtC5oaoTpI/edit#gid=0","cachedResultName":"Vehicles Tab"},"documentId":{"__rl":true,"mode":"list","value":"1eTlVJbSiz8P8PpjaqXgkRsZF8oeBTH_4kDtC5oaoTpI","cachedResultUrl":"https://docs.google.com/spreadsheets/d/1eTlVJbSiz8P8PpjaqXgkRsZF8oeBTH_4kDtC5oaoTpI/edit?usp=drivesdk","cachedResultName":"Vehicles - Wati"}},"credentials":{"googleSheetsOAuth2Api":{"id":"Kz2DdSp11rxqwlFt","name":"Google Sheets account - Deepanshi"}},"typeVersion":4.5},{"id":"a2cdb6c2-9e73-4b60-96db-c4562ab5a95f","name":"WATI – Send Service Reminder1","type":"n8n-nodes-wati.wati","position":[688,6400],"parameters":{"target":"={{ $json.phone }}","messageText":"={{ $('Check Service Due1').item.json.reminderMsg }}"},"credentials":{"watiApi":{"id":"LeAm3lDk4hC1D2Qy","name":"wati - templates"}},"typeVersion":1},{"id":"614f5338-f786-48ba-9e6c-51cbd2e67648","name":"Sheets – Read Appointments1","type":"n8n-nodes-base.googleSheets","position":[1568,6544],"parameters":{"options":{},"sheetName":{"__rl":true,"mode":"list","value":1767856248,"cachedResultUrl":"https://docs.google.com/spreadsheets/d/1eTlVJbSiz8P8PpjaqXgkRsZF8oeBTH_4kDtC5oaoTpI/edit#gid=1767856248","cachedResultName":"Appointments Tab"},"documentId":{"__rl":true,"mode":"list","value":"1eTlVJbSiz8P8PpjaqXgkRsZF8oeBTH_4kDtC5oaoTpI","cachedResultUrl":"https://docs.google.com/spreadsheets/d/1eTlVJbSiz8P8PpjaqXgkRsZF8oeBTH_4kDtC5oaoTpI/edit?usp=drivesdk","cachedResultName":"Vehicles - Wati"}},"credentials":{"googleSheetsOAuth2Api":{"id":"Kz2DdSp11rxqwlFt","name":"Google Sheets account - Deepanshi"}},"typeVersion":4.5},{"id":"ec881846-3be6-440e-add5-a1473362c946","name":"Check Tomorrow Appointments1","type":"n8n-nodes-base.code","position":[1808,6544],"parameters":{"jsCode":"const rows = $input.all();\nconst now  = new Date();\nconst tom  = new Date(now); tom.setDate(tom.getDate() + 1);\nconst tomStr = tom.toISOString().split('T')[0];\nconst due = rows.filter(r => (r.json.appointmentDate||'').split('T')[0] === tomStr && (r.json.status||'').toLowerCase() === 'confirmed');\nif (due.length === 0) return [{ json: { message: 'No appointments tomorrow' } }];\nreturn due.map(r => ({ json: {\n  phone: r.json.phone,\n  msg: `📅 *Appointment Reminder*\\n\\nYour service is *tomorrow!*\\n🚗 Reg: *${r.json.vehicleReg}*\\n🔧 ${r.json.serviceType || 'General Service'}\\n⏰ *${r.json.timeSlot}*\\n\\nPlease arrive 10 min early.\\nReply *cancel* to reschedule.`\n}}));\n"},"typeVersion":2},{"id":"5e448930-4b70-428e-9b98-572609aaa5b8","name":"WATI – Send Appointment Reminder1","type":"n8n-nodes-wati.wati","position":[2048,6544],"parameters":{"target":"={{ $json.phone }}","messageText":"={{ $json.msg }}"},"credentials":{"watiApi":{"id":"LeAm3lDk4hC1D2Qy","name":"wati - templates"}},"typeVersion":1},{"id":"8127d61b-a6dc-457b-b280-17a9dfabcf10","name":"Command Router1","type":"n8n-nodes-base.switch","position":[-768,6960],"parameters":{"rules":{"values":[{"outputKey":"Book","conditions":{"options":{"version":1,"leftValue":"","caseSensitive":true,"typeValidation":"strict"},"combinator":"and","conditions":[{"id":"04ad63ad-a94d-485a-8cec-276f54bd6610","operator":{"type":"string","operation":"equals"},"leftValue":"={{ $json.text.toLowerCase().trim() }}","rightValue":"book"}]},"renameOutput":true},{"outputKey":"Mileage","conditions":{"options":{"version":1,"leftValue":"","caseSensitive":true,"typeValidation":"strict"},"combinator":"and","conditions":[{"id":"a61c1ccb-883c-4a43-933d-a159ccd114fe","operator":{"type":"string","operation":"startsWith"},"leftValue":"={{ $json.text }}","rightValue":"mileage "}]},"renameOutput":true},{"outputKey":"History","conditions":{"options":{"version":1,"leftValue":"","caseSensitive":true,"typeValidation":"strict"},"combinator":"and","conditions":[{"id":"22f9ab06-51bd-42ca-89fd-6b072ab06a11","operator":{"type":"string","operation":"equals"},"leftValue":"={{ $json.text.toLowerCase().trim() }}","rightValue":"history"}]},"renameOutput":true},{"outputKey":"Status","conditions":{"options":{"version":1,"leftValue":"","caseSensitive":true,"typeValidation":"strict"},"combinator":"and","conditions":[{"id":"09718233-6de6-4e4f-86e7-40364b5c5231","operator":{"type":"string","operation":"equals"},"leftValue":"={{ $json.text.toLowerCase().trim() }}","rightValue":"status"}]},"renameOutput":true},{"outputKey":"Log Service","conditions":{"options":{"version":1,"leftValue":"","caseSensitive":true,"typeValidation":"strict"},"combinator":"and","conditions":[{"id":"c8f3eaa4-8eeb-474f-b458-e46ba539f449","operator":{"type":"string","operation":"startsWith"},"leftValue":"={{ $json.text }}","rightValue":"logservice "}]},"renameOutput":true},{"outputKey":"Confirm Slot","conditions":{"options":{"version":1,"leftValue":"","caseSensitive":true,"typeValidation":"strict"},"combinator":"and","conditions":[{"id":"11c3402f-7a1c-41d4-a854-a23a78952ee2","operator":{"type":"string","operation":"startsWith"},"leftValue":"={{ $json.text }}","rightValue":"confirm"}]},"renameOutput":true}]},"options":{"fallbackOutput":"extra"}},"typeVersion":3},{"id":"428decda-0588-46e9-9970-057826740182","name":"Sheets – Find Vehicle for Booking1","type":"n8n-nodes-base.googleSheets","position":[-304,6880],"parameters":{"options":{},"sheetName":{"__rl":true,"mode":"list","value":"gid=0","cachedResultUrl":"https://docs.google.com/spreadsheets/d/1eTlVJbSiz8P8PpjaqXgkRsZF8oeBTH_4kDtC5oaoTpI/edit#gid=0","cachedResultName":"Vehicles Tab"},"documentId":{"__rl":true,"mode":"list","value":"1eTlVJbSiz8P8PpjaqXgkRsZF8oeBTH_4kDtC5oaoTpI","cachedResultUrl":"https://docs.google.com/spreadsheets/d/1eTlVJbSiz8P8PpjaqXgkRsZF8oeBTH_4kDtC5oaoTpI/edit?usp=drivesdk","cachedResultName":"Vehicles - Wati"}},"credentials":{"googleSheetsOAuth2Api":{"id":"Kz2DdSp11rxqwlFt","name":"Google Sheets account - Deepanshi"}},"typeVersion":4.5},{"id":"e26ecfe3-40b1-428e-b861-32bd3d1bd180","name":"Parse Book & Generate Slots1","type":"n8n-nodes-base.code","position":[-112,6880],"parameters":{"jsCode":"const phone   =  $('Wati Trigger').first().json.waId|| $('Wati Trigger1').item.json.from;\nconst allRows = $input.all();\nconst vehicle = allRows.find(r => (r.json.phone||'') === phone);\nif (!vehicle) return [{ json: { phone, bookingMsg: '⚠️ No vehicle found. Contact the service centre to register.' }}];\nconst v = vehicle.json;\nconst now = new Date();\nconst slots = [];\nlet day = new Date(now); day.setDate(day.getDate() + 1);\nconst times = ['10:00 AM', '02:00 PM'];\nwhile (slots.length < 4) {\n  const dow = day.getDay();\n  if (dow !== 0 && dow !== 6) {\n    for (const t of times) {\n      if (slots.length < 4) {\n        const label = day.toLocaleDateString('en-IN',{weekday:'short',day:'numeric',month:'short'});\n        slots.push({ label: `${slots.length+1}\\ufe0f\\u20e3  ${label} – ${t}`, date: day.toISOString().split('T')[0], time: t });\n      }\n    }\n  }\n  day = new Date(day); day.setDate(day.getDate() + 1);\n}\nconst msg = [`🔧 *Book a Service Appointment*`,`🚗 ${v.make} ${v.model} · *${v.vehicleReg}*`,``,`📅 *Choose a slot:*`,...slots.map(s=>s.label),``,`Reply *1*, *2*, *3* or *4* to confirm.`].join('\\n');\nreturn [{ json: { phone, vehicleReg: v.vehicleReg, make: v.make, model: v.model, ownerName: v.ownerName, bookingMsg: msg }}];\n"},"typeVersion":2},{"id":"fc383e54-cff8-4905-8371-1dab9508b18f","name":"WATI – Send Available Slots1","type":"n8n-nodes-wati.wati","position":[112,6880],"parameters":{"target":"={{ $json.phone }}","messageText":"={{ $json.bookingMsg }}"},"credentials":{"watiApi":{"id":"LeAm3lDk4hC1D2Qy","name":"wati - templates"}},"typeVersion":1},{"id":"ae9f7c7b-0f8b-4f58-b4b0-f4e6dca6b701","name":"Sheets – Find Vehicle for Confirm1","type":"n8n-nodes-base.googleSheets","position":[-320,7072],"parameters":{"options":{},"sheetName":{"__rl":true,"mode":"list","value":"gid=0","cachedResultUrl":"https://docs.google.com/spreadsheets/d/1eTlVJbSiz8P8PpjaqXgkRsZF8oeBTH_4kDtC5oaoTpI/edit#gid=0","cachedResultName":"Vehicles Tab"},"documentId":{"__rl":true,"mode":"list","value":"1eTlVJbSiz8P8PpjaqXgkRsZF8oeBTH_4kDtC5oaoTpI","cachedResultUrl":"https://docs.google.com/spreadsheets/d/1eTlVJbSiz8P8PpjaqXgkRsZF8oeBTH_4kDtC5oaoTpI/edit?usp=drivesdk","cachedResultName":"Vehicles - Wati"}},"credentials":{"googleSheetsOAuth2Api":{"id":"Kz2DdSp11rxqwlFt","name":"Google Sheets account - Deepanshi"}},"typeVersion":4.5},{"id":"41ca15c3-f6f8-437f-90a0-55a7416fd471","name":"Handle Slot Confirmation1","type":"n8n-nodes-base.code","position":[-128,7072],"parameters":{"jsCode":"const phone    = $('Wati Trigger').item.json.waId || $('Wati Trigger1').item.json.from;\nconst text     = ($('Wati Trigger').item.json.text || '').trim();\nconst choice   = parseInt(text.replace(/^confirm\\s*/i,'').trim());\nconst allRows  = $input.all();\nconst vehicle  = allRows.find(r => (r.json.phone||'') === phone);\nif (!vehicle) return [{ json: { phone, confirmMsg: '⚠️ Vehicle not found. Contact the service centre.' }}];\nif (isNaN(choice) || choice < 1 || choice > 4) return [{ json: { phone, confirmMsg: '⚠️ Reply *confirm 1*, *confirm 2*, *confirm 3* or *confirm 4* to pick a slot.\\n\\nSend *book* to see slots again.' }}];\nconst v = vehicle.json;\nconst now = new Date();\nconst slots = [];\nlet day = new Date(now); day.setDate(day.getDate() + 1);\nconst times = ['10:00 AM', '02:00 PM'];\nwhile (slots.length < 4) {\n  const dow = day.getDay();\n  if (dow !== 0 && dow !== 6) {\n    for (const t of times) { if (slots.length < 4) { slots.push({ date: day.toISOString().split('T')[0], time: t }); } }\n  }\n  day = new Date(day); day.setDate(day.getDate() + 1);\n}\nconst chosen  = slots[choice - 1];\nconst apptId  = `APT-${phone}-${Date.now()}`;\nconst dateLabel = new Date(chosen.date).toLocaleDateString('en-IN',{weekday:'long',day:'numeric',month:'long'});\nconst confirmMsg = [`✅ *Appointment Confirmed!*`,``,`📅 *${dateLabel}*`,`⏰ Time: *${chosen.time}*`,`🚗 ${v.make} ${v.model} · *${v.vehicleReg}*`,`🔧 Full Service`,``,`We'll remind you the day before. See you then! 🙌`,``,`Reply *history* to view past services.`].join('\\n');\nreturn [{ json: { phone, vehicleReg: v.vehicleReg, ownerName: v.ownerName, apptId, appointmentDate: chosen.date, timeSlot: chosen.time, serviceType: 'Full Service', bookedAt: now.toISOString(), confirmMsg }}];\n"},"typeVersion":2},{"id":"f026b12e-50f9-40c1-947e-7fef003a86ef","name":"Sheets – Log Appointment1","type":"n8n-nodes-base.googleSheets","position":[112,7072],"parameters":{"columns":{"value":{"phone":"={{ $json.phone }}","apptId":"={{ $json.apptId }}","status":"Confirmed","bookedAt":"={{ $json.bookedAt }}","timeSlot":"={{ $json.timeSlot }}","vehicleReg":"={{ $json.vehicleReg }}","serviceType":"={{ $json.serviceType }}","appointmentDate":"={{ $json.appointmentDate }}"},"schema":[{"id":"apptId","type":"string","display":true,"required":false,"displayName":"apptId","defaultMatch":false,"canBeUsedToMatch":true},{"id":"phone","type":"string","display":true,"required":false,"displayName":"phone","defaultMatch":false,"canBeUsedToMatch":true},{"id":"vehicleReg","type":"string","display":true,"required":false,"displayName":"vehicleReg","defaultMatch":false,"canBeUsedToMatch":true},{"id":"serviceType","type":"string","display":true,"required":false,"displayName":"serviceType","defaultMatch":false,"canBeUsedToMatch":true},{"id":"appointmentDate","type":"string","display":true,"required":false,"displayName":"appointmentDate","defaultMatch":false,"canBeUsedToMatch":true},{"id":"timeSlot","type":"string","display":true,"required":false,"displayName":"timeSlot","defaultMatch":false,"canBeUsedToMatch":true},{"id":"bookedAt","type":"string","display":true,"required":false,"displayName":"bookedAt","defaultMatch":false,"canBeUsedToMatch":true},{"id":"status","type":"string","display":true,"required":false,"displayName":"status","defaultMatch":false,"canBeUsedToMatch":true}],"mappingMode":"defineBelow","matchingColumns":[],"attemptToConvertTypes":false,"convertFieldsToString":false},"options":{},"operation":"append","sheetName":{"__rl":true,"mode":"list","value":1767856248,"cachedResultUrl":"https://docs.google.com/spreadsheets/d/1eTlVJbSiz8P8PpjaqXgkRsZF8oeBTH_4kDtC5oaoTpI/edit#gid=1767856248","cachedResultName":"Appointments Tab"},"documentId":{"__rl":true,"mode":"list","value":"1eTlVJbSiz8P8PpjaqXgkRsZF8oeBTH_4kDtC5oaoTpI","cachedResultUrl":"https://docs.google.com/spreadsheets/d/1eTlVJbSiz8P8PpjaqXgkRsZF8oeBTH_4kDtC5oaoTpI/edit?usp=drivesdk","cachedResultName":"Vehicles - Wati"}},"credentials":{"googleSheetsOAuth2Api":{"id":"Kz2DdSp11rxqwlFt","name":"Google Sheets account - Deepanshi"}},"typeVersion":4.5},{"id":"dc0da2c5-52b5-481f-bd33-2925ed777e0e","name":"WATI – Confirm Appointment1","type":"n8n-nodes-wati.wati","position":[352,7072],"parameters":{"target":"={{ $('Handle Slot Confirmation1').item.json.phone }}","messageText":"={{ $('Handle Slot Confirmation1').item.json.confirmMsg }}"},"credentials":{"watiApi":{"id":"LeAm3lDk4hC1D2Qy","name":"wati - templates"}},"typeVersion":1},{"id":"2fbbebec-6194-457c-beaa-2aa7168bb226","name":"Sheets – Find Vehicle for Mileage1","type":"n8n-nodes-base.googleSheets","position":[1248,6960],"parameters":{"options":{},"sheetName":{"__rl":true,"mode":"list","value":"gid=0","cachedResultUrl":"https://docs.google.com/spreadsheets/d/1eTlVJbSiz8P8PpjaqXgkRsZF8oeBTH_4kDtC5oaoTpI/edit#gid=0","cachedResultName":"Vehicles Tab"},"documentId":{"__rl":true,"mode":"list","value":"1eTlVJbSiz8P8PpjaqXgkRsZF8oeBTH_4kDtC5oaoTpI","cachedResultUrl":"https://docs.google.com/spreadsheets/d/1eTlVJbSiz8P8PpjaqXgkRsZF8oeBTH_4kDtC5oaoTpI/edit?usp=drivesdk","cachedResultName":"Vehicles - Wati"}},"credentials":{"googleSheetsOAuth2Api":{"id":"Kz2DdSp11rxqwlFt","name":"Google Sheets account - Deepanshi"}},"typeVersion":4.5},{"id":"1251302e-c942-4ca4-bc8c-3ed8c7e01e3b","name":"Parse Mileage Update1","type":"n8n-nodes-base.code","position":[1488,6960],"parameters":{"jsCode":"const phone  = $('Wati Trigger').first().json.waId || $('Wati Trigger1').item.json.from;\nconst text   = ($('Wati Trigger').first().json.text || '').trim();\nconst newKm  = parseFloat(text.split(/\\s+/)[1] || '0');\nif (!newKm || newKm <= 0) return [{ json: { phone, milMsg: '⚠️ Format: *mileage <km>*\\nExample: *mileage 51650*' }}];\nconst allRows = $input.all();\nconst vehicle = allRows.find(r => (r.json.phone||'') === phone);\nif (!vehicle) return [{ json: { phone, milMsg: '⚠️ No vehicle registered. Contact the service centre.' }}];\nconst v          = vehicle.json;\nconst intervalKm = parseFloat(v.serviceIntervalKm || 5000);\nconst lastKm     = parseFloat(v.lastServiceMileage || 0);\nconst nextKm     = lastKm + intervalKm;\nconst kmLeft     = nextKm - newKm;\nconst isOverdue  = newKm >= nextKm;\nconst urgencyLine = isOverdue\n  ? `⚠️ *Overdue!* ${Math.abs(Math.round(kmLeft)).toLocaleString()} km past service point!`\n  : kmLeft <= 500 ? `🔴 Only *${Math.round(kmLeft).toLocaleString()} km* left — book soon!`\n  : `✅ Next service in *${Math.round(kmLeft).toLocaleString()} km*`;\nconst milMsg = [`📏 *Mileage Updated*`,`🚗 ${v.make} ${v.model} · ${v.vehicleReg}`,``,`🛣️ Current: *${newKm.toLocaleString()} km*`,`🛣️ Next service at: *${nextKm.toLocaleString()} km*`,urgencyLine,``,isOverdue || kmLeft <= 500 ? `Reply *book* to schedule now 🔧` : `Keep it up! 🚗`].join('\\n');\nreturn [{ json: { phone, vehicleReg: v.vehicleReg, currentMileage: newKm, nextServiceMileage: nextKm, newStatus: isOverdue ? 'Overdue' : 'Active', milMsg }}];\n"},"typeVersion":2},{"id":"c143ac45-2b4d-446c-aef7-b3cbc2fe9a72","name":"Sheets – Update Mileage1","type":"n8n-nodes-base.googleSheets","position":[1728,6960],"parameters":{"columns":{"value":{"phone":"={{ $json.phone }}","status":"={{ $json.newStatus }}","currentMileage":"={{ $json.currentMileage }}","nextServiceMileage":"={{ $json.nextServiceMileage }}"},"schema":[{"id":"phone","type":"string","display":true,"required":true,"displayName":"phone","defaultMatch":true,"canBeUsedToMatch":true}],"mappingMode":"defineBelow","matchingColumns":["phone"]},"options":{},"operation":"update","sheetName":{"__rl":true,"mode":"list","value":"gid=0","cachedResultUrl":"https://docs.google.com/spreadsheets/d/1eTlVJbSiz8P8PpjaqXgkRsZF8oeBTH_4kDtC5oaoTpI/edit#gid=0","cachedResultName":"Vehicles Tab"},"documentId":{"__rl":true,"mode":"list","value":"1eTlVJbSiz8P8PpjaqXgkRsZF8oeBTH_4kDtC5oaoTpI","cachedResultUrl":"https://docs.google.com/spreadsheets/d/1eTlVJbSiz8P8PpjaqXgkRsZF8oeBTH_4kDtC5oaoTpI/edit?usp=drivesdk","cachedResultName":"Vehicles - Wati"}},"credentials":{"googleSheetsOAuth2Api":{"id":"Kz2DdSp11rxqwlFt","name":"Google Sheets account - Deepanshi"}},"typeVersion":4.5},{"id":"4584eeb8-67fb-4381-a479-9e78ee415a0a","name":"WATI – Send Mileage Ack1","type":"n8n-nodes-wati.wati","position":[1968,6960],"parameters":{"target":"={{ $('Parse Mileage Update1').item.json.phone }}","messageText":"={{ $('Parse Mileage Update1').item.json.milMsg }}"},"credentials":{"watiApi":{"id":"LeAm3lDk4hC1D2Qy","name":"wati - templates"}},"typeVersion":1},{"id":"aadfe8c1-4654-499c-9f5e-b3803bb85c30","name":"Sheets – Read Service History1","type":"n8n-nodes-base.googleSheets","position":[-368,7440],"parameters":{"options":{},"sheetName":{"__rl":true,"mode":"list","value":1494347229,"cachedResultUrl":"https://docs.google.com/spreadsheets/d/1eTlVJbSiz8P8PpjaqXgkRsZF8oeBTH_4kDtC5oaoTpI/edit#gid=1494347229","cachedResultName":"ServiceHistory Tab"},"documentId":{"__rl":true,"mode":"list","value":"1eTlVJbSiz8P8PpjaqXgkRsZF8oeBTH_4kDtC5oaoTpI","cachedResultUrl":"https://docs.google.com/spreadsheets/d/1eTlVJbSiz8P8PpjaqXgkRsZF8oeBTH_4kDtC5oaoTpI/edit?usp=drivesdk","cachedResultName":"Vehicles - Wati"}},"credentials":{"googleSheetsOAuth2Api":{"id":"Kz2DdSp11rxqwlFt","name":"Google Sheets account - Deepanshi"}},"typeVersion":4.5},{"id":"b7ef0826-3c2d-4ea7-926f-220e52d138e9","name":"Build History View1","type":"n8n-nodes-base.code","position":[-128,7440],"parameters":{"jsCode":"const phone   = $('Wati Trigger').item.json.waId || $('Wati Trigger1').item.json.from;\nconst records = $input.all().filter(r => (r.json.phone||'') === phone)\n  .sort((a,b) => new Date(b.json.serviceDate) - new Date(a.json.serviceDate)).slice(0,5);\nif (records.length === 0) return [{ json: { phone, histMsg: '🔧 *No service history found.*\\n\\nOnce your vehicle is serviced, records appear here.' }}];\nconst lines = [`📋 *Service History*`,``];\nfor (const r of records) {\n  const dt   = r.json.serviceDate ? new Date(r.json.serviceDate).toLocaleDateString('en-IN',{day:'numeric',month:'short',year:'numeric'}) : '—';\n  const km   = r.json.mileageAtService ? parseInt(r.json.mileageAtService).toLocaleString() + ' km' : '—';\n  const cost = r.json.cost ? `₹${parseFloat(r.json.cost).toLocaleString()}` : '—';\n  lines.push(`🔧 *${dt}* · ${km}`);\n  lines.push(`   ${r.json.serviceType || 'Service'}: ${r.json.workDone || '—'}`);\n  lines.push(`   Cost: ${cost}`); lines.push('');\n}\nlines.push('─────────────────────'); lines.push('Reply *book* to schedule your next service.');\nreturn [{ json: { phone, histMsg: lines.join('\\n') } }];\n"},"typeVersion":2},{"id":"06766d32-7353-4d05-910e-af4f0abd4270","name":"WATI – Send History1","type":"n8n-nodes-wati.wati","position":[112,7440],"parameters":{"target":"={{ $json.phone }}","messageText":"={{ $json.histMsg }}"},"credentials":{"watiApi":{"id":"LeAm3lDk4hC1D2Qy","name":"wati - templates"}},"typeVersion":1},{"id":"83ce8cd4-ba27-4a32-8cd7-13bdb9a0bb9a","name":"Sheets – Read Vehicle for Status1","type":"n8n-nodes-base.googleSheets","position":[368,7424],"parameters":{"options":{},"sheetName":{"__rl":true,"mode":"list","value":"gid=0","cachedResultUrl":"https://docs.google.com/spreadsheets/d/1eTlVJbSiz8P8PpjaqXgkRsZF8oeBTH_4kDtC5oaoTpI/edit#gid=0","cachedResultName":"Vehicles Tab"},"documentId":{"__rl":true,"mode":"list","value":"1eTlVJbSiz8P8PpjaqXgkRsZF8oeBTH_4kDtC5oaoTpI","cachedResultUrl":"https://docs.google.com/spreadsheets/d/1eTlVJbSiz8P8PpjaqXgkRsZF8oeBTH_4kDtC5oaoTpI/edit?usp=drivesdk","cachedResultName":"Vehicles - Wati"}},"credentials":{"googleSheetsOAuth2Api":{"id":"Kz2DdSp11rxqwlFt","name":"Google Sheets account - Deepanshi"}},"typeVersion":4.5},{"id":"6eded368-9e59-4a4d-875f-81431eed645f","name":"Build Vehicle Status1","type":"n8n-nodes-base.code","position":[608,7424],"parameters":{"jsCode":"const phone   = $('Wati Trigger').item.json.waId || $('Wati Trigger1').item.json.from;\nconst v = $input.all().find(r => (r.json.phone||'') === phone);\nif (!v) return [{ json: { phone, statusMsg: '⚠️ No vehicle registered.\\nContact the service centre.' }}];\nconst rec    = v.json;\nconst nextDt = rec.nextServiceDate ? new Date(rec.nextServiceDate).toLocaleDateString('en-IN',{day:'numeric',month:'short',year:'numeric'}) : 'Not set';\nconst lastDt = rec.lastServiceDate ? new Date(rec.lastServiceDate).toLocaleDateString('en-IN',{day:'numeric',month:'short',year:'numeric'}) : 'Not yet serviced';\nconst badge  = {active:'✅',overdue:'🔴',booked:'📅'}[(rec.status||'active').toLowerCase()] || '✅';\nconst msg = [`🚗 *Vehicle Status*`,``,`🔵 *${rec.make||''} ${rec.model||''} ${rec.year||''}*`,`🔵 Reg: *${rec.vehicleReg||'—'}*`,`🔵 Owner: ${rec.ownerName||'—'}`,``,`${badge} Status: *${rec.status||'Active'}*`,`🛣️ Current: *${parseInt(rec.currentMileage||0).toLocaleString()} km*`,``,`🔧 *Next Service*`,`   📅 Date: *${nextDt}*`,`   🛣️ At: *${parseInt(rec.nextServiceMileage||0).toLocaleString()} km*`,``,`🔧 *Last Service*`,`   📅 ${lastDt}`,``,`─────────────────────`,`Reply *book* to schedule · *history* for records`].join('\\n');\nreturn [{ json: { phone, statusMsg: msg } }];\n"},"typeVersion":2},{"id":"96aa6941-f598-4459-bf77-31b0746ddbaf","name":"WATI – Send Vehicle Status1","type":"n8n-nodes-wati.wati","position":[832,7440],"parameters":{"target":"={{ $json.phone }}","messageText":"={{ $json.statusMsg }}"},"credentials":{"watiApi":{"id":"LeAm3lDk4hC1D2Qy","name":"wati - templates"}},"typeVersion":1},{"id":"2c703e1e-f31e-4482-bdb8-20be1333076f","name":"Parse Log Service1","type":"n8n-nodes-base.code","position":[1088,7408],"parameters":{"jsCode":"const phone = $json.waId || $json.from;\nconst text  = ($json.text || '').replace(/^logservice\\s+/i,'').trim();\nconst parts = text.split(/\\s+/);\nif (parts.length < 4) return [{ json: { phone, errMsg: '⚠️ Format: *logservice <reg> <km> <work> <cost>*\\nExample: *logservice MH12AB3456 52000 Oil change 2500*' }}];\nconst reg    = parts[0].toUpperCase();\nconst km     = parseFloat(parts[1]) || 0;\nconst cost   = parseFloat(parts[parts.length-1]) || 0;\nconst work   = parts.slice(2,parts.length-1).join(' ');\nconst now    = new Date();\nconst nextDt = new Date(now); nextDt.setDate(nextDt.getDate() + 180);\nreturn [{ json: { phone, reg, km, cost, work, historyId: `SH-${reg}-${now.getTime()}`, serviceDate: now.toISOString().split('T')[0], recordedAt: now.toISOString(), nextServiceDate: nextDt.toISOString().split('T')[0], logMsg: `✅ *Service Logged*\\n🚗 ${reg}\\n🛣️ At ${km.toLocaleString()} km\\n🔧 ${work}\\n💰 ₹${cost.toLocaleString()}` }}];\n"},"typeVersion":2},{"id":"57d19ea9-6445-47f5-acac-29d2736ca072","name":"Sheets – Append Service Record1","type":"n8n-nodes-base.googleSheets","position":[1328,7408],"parameters":{"columns":{"value":{"cost":"={{ $json.cost }}","phone":"={{ $json.phone }}","workDone":"={{ $json.work }}","historyId":"={{ $json.historyId }}","recordedAt":"={{ $json.recordedAt }}","vehicleReg":"={{ $json.reg }}","serviceDate":"={{ $json.serviceDate }}","serviceType":"Full Service","mileageAtService":"={{ $json.km }}"},"schema":[{"id":"historyId","type":"string","display":true,"required":false,"displayName":"historyId","defaultMatch":false,"canBeUsedToMatch":true},{"id":"phone","type":"string","display":true,"required":false,"displayName":"phone","defaultMatch":false,"canBeUsedToMatch":true},{"id":"vehicleReg","type":"string","display":true,"required":false,"displayName":"vehicleReg","defaultMatch":false,"canBeUsedToMatch":true},{"id":"serviceDate","type":"string","display":true,"required":false,"displayName":"serviceDate","defaultMatch":false,"canBeUsedToMatch":true},{"id":"mileageAtService","type":"string","display":true,"required":false,"displayName":"mileageAtService","defaultMatch":false,"canBeUsedToMatch":true},{"id":"serviceType","type":"string","display":true,"required":false,"displayName":"serviceType","defaultMatch":false,"canBeUsedToMatch":true},{"id":"workDone","type":"string","display":true,"required":false,"displayName":"workDone","defaultMatch":false,"canBeUsedToMatch":true},{"id":"cost","type":"string","display":true,"required":false,"displayName":"cost","defaultMatch":false,"canBeUsedToMatch":true},{"id":"recordedAt","type":"string","display":true,"required":false,"displayName":"recordedAt","defaultMatch":false,"canBeUsedToMatch":true}],"mappingMode":"defineBelow","matchingColumns":[],"attemptToConvertTypes":false,"convertFieldsToString":false},"options":{},"operation":"append","sheetName":{"__rl":true,"mode":"list","value":1494347229,"cachedResultUrl":"https://docs.google.com/spreadsheets/d/1eTlVJbSiz8P8PpjaqXgkRsZF8oeBTH_4kDtC5oaoTpI/edit#gid=1494347229","cachedResultName":"ServiceHistory Tab"},"documentId":{"__rl":true,"mode":"list","value":"1eTlVJbSiz8P8PpjaqXgkRsZF8oeBTH_4kDtC5oaoTpI","cachedResultUrl":"https://docs.google.com/spreadsheets/d/1eTlVJbSiz8P8PpjaqXgkRsZF8oeBTH_4kDtC5oaoTpI/edit?usp=drivesdk","cachedResultName":"Vehicles - Wati"}},"credentials":{"googleSheetsOAuth2Api":{"id":"Kz2DdSp11rxqwlFt","name":"Google Sheets account - Deepanshi"}},"typeVersion":4.5},{"id":"feed07d9-1360-4c53-a786-8fbfba09dcec","name":"WATI – Confirm Service Logged1","type":"n8n-nodes-wati.wati","position":[1568,7408],"parameters":{"target":"={{ $('Parse Log Service1').item.json.phone }}","messageText":"={{ $('Parse Log Service1').item.json.errMsg }}"},"credentials":{"watiApi":{"id":"LeAm3lDk4hC1D2Qy","name":"wati - templates"}},"typeVersion":1},{"id":"aa67610d-ef92-4bb0-b4db-6f51a121c13d","name":"WATI – Send Help1","type":"n8n-nodes-wati.wati","position":[1792,7360],"parameters":{"target":"={{ $json.waId }}","messageText":"🚗 *Vehicle Service Bot*\n\nCommands:\n\n*status* — Your vehicle details\n*book* — Book a service appointment\n*confirm <n>* — Confirm slot 1, 2, 3 or 4\n*history* — View past service records\n*mileage <km>* — Update your odometer\n  e.g. *mileage 51650*\n\n*Garage staff only:*\n*logservice <reg> <km> <work> <cost>*\n  e.g. *logservice MH12AB3456 52000 Oil change 2500*"},"credentials":{"watiApi":{"id":"LeAm3lDk4hC1D2Qy","name":"wati - templates"}},"typeVersion":1},{"id":"162d1d59-73c0-4b86-8b54-b7b362261dc5","name":"Wati Trigger","type":"n8n-nodes-wati.watiTrigger","position":[-1040,7040],"webhookId":"ceb8d7d4-0ea8-4491-9bec-89f94a3feb35","parameters":{"event":"messageReceived"},"credentials":{"watiApi":{"id":"LeAm3lDk4hC1D2Qy","name":"wati - templates"}},"typeVersion":1,"alwaysOutputData":true}],"pinData":{"Wati Trigger":[{"id":"69a03cbabb5da6b3803a7141","data":null,"text":"confirm","type":"text","waId":"917024935915","owner":false,"created":"2026-02-26T12:29:46.7900513Z","sourceId":null,"ticketId":"699d5bece335b461449f4b91","avatarUrl":null,"eventType":"message","forwarded":false,"listReply":null,"sourceUrl":null,"timestamp":"1772108985","assignedId":null,"senderName":"Deepanshi Singhal","sourceType":7,"buttonReply":null,"operatorName":null,"statusString":"SENT","operatorEmail":null,"conversationId":"699d5becb12153808a3300f0","messageContact":null,"replyContextId":"","whatsappMessageId":"wamid.HBgMOTE3MDI0OTM1OTE1FQIAEhggQUM2QjU0NTYwQ0Y1RUU0Njk0MDE4NEJFQzg1MEY5OEYA","frequentlyForwarded":false,"interactiveButtonReply":null}]},"connections":{"Wati Trigger":{"main":[[{"node":"Command Router1","type":"main","index":0}]]},"Command Router1":{"main":[[{"node":"Sheets – Find Vehicle for Booking1","type":"main","index":0}],[{"node":"Sheets – Find Vehicle for Mileage1","type":"main","index":0}],[{"node":"Sheets – Read Service History1","type":"main","index":0}],[{"node":"Sheets – Read Vehicle for Status1","type":"main","index":0}],[{"node":"Parse Log Service1","type":"main","index":0}],[{"node":"Sheets – Find Vehicle for Confirm1","type":"main","index":0}],[{"node":"WATI – Send Help1","type":"main","index":0}]]},"Check Service Due1":{"main":[[{"node":"Sheets – Mark Reminder Sent1","type":"main","index":0}]]},"Parse Log Service1":{"main":[[{"node":"Sheets – Append Service Record1","type":"main","index":0}]]},"Build History View1":{"main":[[{"node":"WATI – Send History1","type":"main","index":0}]]},"Build Vehicle Status1":{"main":[[{"node":"WATI – Send Vehicle Status1","type":"main","index":0}]]},"Parse Mileage Update1":{"main":[[{"node":"Sheets – Update Mileage1","type":"main","index":0}]]},"Handle Slot Confirmation1":{"main":[[{"node":"Sheets – Log Appointment1","type":"main","index":0}]]},"Sheets – Update Mileage1":{"main":[[{"node":"WATI – Send Mileage Ack1","type":"main","index":0}]]},"Sheets – Log Appointment1":{"main":[[{"node":"WATI – Confirm Appointment1","type":"main","index":0}]]},"Check Tomorrow Appointments1":{"main":[[{"node":"WATI – Send Appointment Reminder1","type":"main","index":0}]]},"Parse Book & Generate Slots1":{"main":[[{"node":"WATI – Send Available Slots1","type":"main","index":0}]]},"Sheets – Read All Vehicles1":{"main":[[{"node":"Check Service Due1","type":"main","index":0}]]},"Sheets – Read Appointments1":{"main":[[{"node":"Check Tomorrow Appointments1","type":"main","index":0}]]},"Schedule Trigger – 8AM Daily":{"main":[[{"node":"Sheets – Read Appointments1","type":"main","index":0}]]},"Sheets – Mark Reminder Sent1":{"main":[[{"node":"WATI – Send Service Reminder1","type":"main","index":0}]]},"Schedule Trigger – 9AM Daily1":{"main":[[{"node":"Sheets – Read All Vehicles1","type":"main","index":0}]]},"Sheets – Read Service History1":{"main":[[{"node":"Build History View1","type":"main","index":0}]]},"Sheets – Append Service Record1":{"main":[[{"node":"WATI – Confirm Service Logged1","type":"main","index":0}]]},"Sheets – Read Vehicle for Status1":{"main":[[{"node":"Build Vehicle Status1","type":"main","index":0}]]},"Sheets – Find Vehicle for Booking1":{"main":[[{"node":"Parse Book & Generate Slots1","type":"main","index":0}]]},"Sheets – Find Vehicle for Confirm1":{"main":[[{"node":"Handle Slot Confirmation1","type":"main","index":0}]]},"Sheets – Find Vehicle for Mileage1":{"main":[[{"node":"Parse Mileage Update1","type":"main","index":0}]]}}},"lastUpdatedBy":1,"workflowInfo":{"nodeCount":39,"nodeTypes":{"n8n-nodes-base.code":{"count":8},"n8n-nodes-wati.wati":{"count":9},"n8n-nodes-base.switch":{"count":1},"n8n-nodes-base.stickyNote":{"count":7},"n8n-nodes-wati.watiTrigger":{"count":1},"n8n-nodes-base.googleSheets":{"count":11},"n8n-nodes-base.scheduleTrigger":{"count":2}}},"status":"published","readyToDemo":null,"user":{"name":"Jitesh Dugar","username":"jiteshdugar","bio":"AI Automation Specialist - OpenAI, CRM & Automation Expert with a solid understanding of various tools that include Zapier, Make, Zoho CRM, Hubspot, Google Sheets, Airtable, Pipedrive, Google Analytics, and more.","verified":true,"links":["https://www.linkedin.com/in/jiteshdugar"],"avatar":"https://gravatar.com/avatar/edaa3abb99806b0586dced559d0a5417f24a507e7c4464a63960f0638a4b1b90?r=pg&d=retro&size=200"},"nodes":[{"id":18,"icon":"file:googleSheets.svg","name":"n8n-nodes-base.googleSheets","codex":{"data":{"alias":["CSV","Sheet","Spreadsheet","GS"],"resources":{"generic":[{"url":"https://n8n.io/blog/love-at-first-sight-ricardos-n8n-journey/","icon":"❤️","label":"Love at first sight: Ricardo’s n8n journey"},{"url":"https://n8n.io/blog/why-business-process-automation-with-n8n-can-change-your-daily-life/","icon":"🧬","label":"Why business process automation with n8n can change your daily life"},{"url":"https://n8n.io/blog/automatically-adding-expense-receipts-to-google-sheets-with-telegram-mindee-twilio-and-n8n/","icon":"🧾","label":"Automatically Adding Expense Receipts to Google Sheets with Telegram, Mindee, Twilio, and n8n"},{"url":"https://n8n.io/blog/supercharging-your-conference-registration-process-with-n8n/","icon":"🎫","label":"Supercharging your conference registration process with n8n"},{"url":"https://n8n.io/blog/creating-triggers-for-n8n-workflows-using-polling/","icon":"⏲","label":"Creating triggers for n8n workflows using polling"},{"url":"https://n8n.io/blog/no-code-ecommerce-workflow-automations/","icon":"store","label":"6 e-commerce workflows to power up your Shopify s"},{"url":"https://n8n.io/blog/migrating-community-metrics-to-orbit-using-n8n/","icon":"📈","label":"Migrating Community Metrics to Orbit using n8n"},{"url":"https://n8n.io/blog/automate-google-apps-for-productivity/","icon":"💡","label":"15 Google apps you can combine and automate to increase productivity"},{"url":"https://n8n.io/blog/your-business-doesnt-need-you-to-operate/","icon":" 🖥️","label":"Hey founders! Your business doesn't need you to operate"},{"url":"https://n8n.io/blog/how-honest-burgers-use-automation-to-save-100k-per-year/","icon":"🍔","label":"How Honest Burgers Use Automation to Save $100k per year"},{"url":"https://n8n.io/blog/how-a-digital-strategist-uses-n8n-for-online-marketing/","icon":"💻","label":"How a digital strategist uses n8n for online marketing"},{"url":"https://n8n.io/blog/why-this-product-manager-loves-workflow-automation-with-n8n/","icon":"🧠","label":"Why this Product Manager loves workflow automation with n8n"},{"url":"https://n8n.io/blog/sending-automated-congratulations-with-google-sheets-twilio-and-n8n/","icon":"🙌","label":"Sending Automated Congratulations with Google Sheets, Twilio, and n8n "},{"url":"https://n8n.io/blog/how-a-membership-development-manager-automates-his-work-and-investments/","icon":"📈","label":"How a Membership Development Manager automates his work and investments"},{"url":"https://n8n.io/blog/aws-workflow-automation/","label":"7 no-code workflow automations for Amazon Web Services"}],"primaryDocumentation":[{"url":"https://docs.n8n.io/integrations/builtin/app-nodes/n8n-nodes-base.googlesheets/"}],"credentialDocumentation":[{"url":"https://docs.n8n.io/integrations/builtin/credentials/google/oauth-single-service/"}]},"categories":["Data & Storage","Productivity"],"nodeVersion":"1.0","codexVersion":"1.0"}},"group":"[\"input\",\"output\"]","defaults":{"name":"Google Sheets"},"iconData":{"type":"file","fileBuffer":"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaH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cyeiIvPjwvZz48L3N2Zz4="},"displayName":"Google Sheets","typeVersion":5,"nodeCategories":[{"id":3,"name":"Data & Storage"},{"id":4,"name":"Productivity"}]},{"id":112,"icon":"fa:map-signs","name":"n8n-nodes-base.switch","codex":{"data":{"alias":["Router","If","Path","Filter","Condition","Logic","Branch","Case"],"resources":{"generic":[{"url":"https://n8n.io/blog/2021-the-year-to-automate-the-new-you-with-n8n/","icon":"☀️","label":"2021: The Year to Automate the New You with n8n"},{"url":"https://n8n.io/blog/how-to-get-started-with-crm-automation-and-no-code-workflow-ideas/","icon":"👥","label":"How to get started with CRM automation (with 3 no-code workflow ideas"},{"url":"https://n8n.io/blog/build-your-own-virtual-assistant-with-n8n-a-step-by-step-guide/","icon":"👦","label":"Build your own virtual assistant with n8n: A step by step guide"},{"url":"https://n8n.io/blog/automation-for-maintainers-of-open-source-projects/","icon":"🏷️","label":"How to automatically manage contributions to open-source projects"}],"primaryDocumentation":[{"url":"https://docs.n8n.io/integrations/builtin/core-nodes/n8n-nodes-base.switch/"}]},"categories":["Core Nodes"],"nodeVersion":"1.0","codexVersion":"1.0","subcategories":{"Core Nodes":["Flow"]}}},"group":"[\"transform\"]","defaults":{"name":"Switch","color":"#506000"},"iconData":{"icon":"map-signs","type":"icon"},"displayName":"Switch","typeVersion":3,"nodeCategories":[{"id":9,"name":"Core Nodes"}]},{"id":565,"icon":"fa:sticky-note","name":"n8n-nodes-base.stickyNote","codex":{"data":{"alias":["Comments","Notes","Sticky"],"categories":["Core Nodes"],"nodeVersion":"1.0","codexVersion":"1.0","subcategories":{"Core Nodes":["Helpers"]}}},"group":"[\"input\"]","defaults":{"name":"Sticky Note","color":"#FFD233"},"iconData":{"icon":"sticky-note","type":"icon"},"displayName":"Sticky Note","typeVersion":1,"nodeCategories":[{"id":9,"name":"Core Nodes"}]},{"id":834,"icon":"file:code.svg","name":"n8n-nodes-base.code","codex":{"data":{"alias":["cpde","Javascript","JS","Python","Script","Custom Code","Function"],"details":"The Code node allows you to execute JavaScript in your workflow.","resources":{"primaryDocumentation":[{"url":"https://docs.n8n.io/integrations/builtin/core-nodes/n8n-nodes-base.code/"}]},"categories":["Development","Core Nodes"],"nodeVersion":"1.0","codexVersion":"1.0","subcategories":{"Core Nodes":["Helpers","Data Transformation"]}}},"group":"[\"transform\"]","defaults":{"name":"Code"},"iconData":{"type":"file","fileBuffer":"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTEyIiBoZWlnaHQ9IjUxMiIgdmlld0JveD0iMCAwIDUxMiA1MTIiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+CjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMF8xMTcxXzQ0MSkiPgo8cGF0aCBkPSJNMTcwLjI4MyA0OEgxOTYuNUMyMDMuMTI3IDQ4IDIwOC41IDQyLjYyNzQgMjA4LjUgMzZWMTJDMjA4LjUgNS4zNzI1OCAyMDMuMTI3IDAgMTk2LjUgMEgxNzAuMjgzQzEyNi4xIDAgOTAuMjgzIDM1LjgxNzIgOTAuMjgzIDgwVjE3NkM5MC4yODMgMjA2LjkyOCA2NS4yMTA5IDIzMiAzNC4yODMgMjMySDIzQzE2LjM3MjYgMjMyIDExIDIzNy4zNzIgMTEgMjQ0VjI2OEMxMSAyNzQuNjI3IDE2LjM3MjQgMjgwIDIyLjk5OTYgMjgwTDM0LjI4MyAyODBDNjUuMjEwOSAyODAgOTAuMjgzIDMwNS4wNzIgOTAuMjgzIDMzNlY0NDBDOTAuMjgzIDQ3OS43NjQgMTIyLjUxOCA1MTIgMTYyLjI4MyA1MTJIMTk2LjVDMjAzLjEyNyA1MTIgMjA4LjUgNTA2LjYyNyAyMDguNSA1MDBWNDc2QzIwOC41IDQ2OS4zNzMgMjAzLjEyNyA0NjQgMTk2LjUgNDY0SDE2Mi4yODNDMTQ5LjAyOCA0NjQgMTM4LjI4MyA0NTMuMjU1IDEzOC4yODMgNDQwVjMzNkMxMzguMjg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NzIgMzg3LjE2MSAwIDM0Mi45NzkgMEgzMTdDMzEwLjM3MyAwIDMwNSA1LjM3MjU4IDMwNSAxMlYzNloiIGZpbGw9IiNGRjk5MjIiLz4KPC9nPgo8ZGVmcz4KPGNsaXBQYXRoIGlkPSJjbGlwMF8xMTcxXzQ0MSI+CjxyZWN0IHdpZHRoPSI1MTIiIGhlaWdodD0iNTEyIiBmaWxsPSJ3aGl0ZSIvPgo8L2NsaXBQYXRoPgo8L2RlZnM+Cjwvc3ZnPgo="},"displayName":"Code","typeVersion":2,"nodeCategories":[{"id":5,"name":"Development"},{"id":9,"name":"Core Nodes"}]},{"id":839,"icon":"fa:clock","name":"n8n-nodes-base.scheduleTrigger","codex":{"data":{"alias":["Time","Scheduler","Polling","Cron","Interval"],"resources":{"generic":[],"primaryDocumentation":[{"url":"https://docs.n8n.io/integrations/builtin/core-nodes/n8n-nodes-base.scheduletrigger/"}]},"categories":["Core Nodes"],"nodeVersion":"1.0","codexVersion":"1.0"}},"group":"[\"trigger\",\"schedule\"]","defaults":{"name":"Schedule Trigger","color":"#31C49F"},"iconData":{"icon":"clock","type":"icon"},"displayName":"Schedule Trigger","typeVersion":1,"nodeCategories":[{"id":9,"name":"Core Nodes"}]}],"categories":[{"id":40,"name":"Support Chatbot"},{"id":47,"name":"AI Chatbot"}],"image":[]}}