إعادة حجز مواعيد العيادة الفائتة على واتساب

كل مساء، يصل المرضى الذين فاتهم موعد اليوم رسالة واتساب لطيفة تعرض عليهم موعدًا جديدًا.

سهل توفّر ~5 ساعة شهريًا العيادات واللياقةبواسطة فريق Flowngn

تعمل مع n8n · Make · Zapier

كيف تعمل

المشغّل: جدول زمني — كل يوم الساعة 20:00
  1. اقرأ جدول Appointments.
  2. ابحث عن مواعيد اليوم المسجلة "no-show" التي لم يُتواصل معها.
  3. أرسل قالب واتساب يعرض إعادة الحجز مع نفس الطبيب.
  4. علّم الصف حتى لا يُراسَل المريض مرتين.

المخطط

Every day 20:00Schedule TriggerGRead appointmentsGoogle Sheets{ }Today's no-showsCodeWOffer a new timeWhatsApp Business CloudGMark as sentGoogle Sheets
مشغّل تطبيق كود

الكود

كود JavaScript المستخدم في خطوات Code، وهو مضمَّن بالفعل في القالب بالأسفل.

Today's no-shows · عقدة Code
// Appointments sheet columns: date (YYYY-MM-DD) | time | patient | phone | doctor | status | rebook_sent
// Keeps today's no-shows that haven't had a rebooking message yet.
const today = new Date().toISOString().slice(0, 10);

return $input.all()
  .map((item) => item.json)
  .filter((a) => String(a.date).slice(0, 10) === today)
  .filter((a) => String(a.status).toLowerCase() === "no-show" && !a.rebook_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,
      time: a.time,
    },
  }));

ابنِها بأداتك

اختر أداتك — نفس الأتمتة، خطوة بخطوة.

انسخه والصقه مباشرة في مساحة عمل n8n (Ctrl+V)، أو حمّله واستخدم Import from File. بعد ذلك اربط حساباتك واستبدل كل قيمة تبدأ بـ YOUR_.

ملف Workflow JSON
عرض الكود (199 سطر)
{
  "name": "إعادة حجز مواعيد العيادة الفائتة على واتساب (Flowngn)",
  "nodes": [
    {
      "parameters": {
        "content": "## إعادة حجز مواعيد العيادة الفائتة على واتساب\nكل مساء، يصل المرضى الذين فاتهم موعد اليوم رسالة واتساب لطيفة تعرض عليهم موعدًا جديدًا.\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": "2c52a72d-5332-4279-a57c-4e7c465d70f8",
      "name": "Setup notes",
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        -420,
        -60
      ]
    },
    {
      "parameters": {
        "rule": {
          "interval": [
            {
              "triggerAtHour": 20
            }
          ]
        }
      },
      "id": "2c52a72d-5332-4279-a57c-4e7c465d70f8",
      "name": "Every day 20: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": "2c52a72d-5332-4279-a57c-4e7c465d70f8",
      "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 | rebook_sent\n// Keeps today's no-shows that haven't had a rebooking message yet.\nconst today = new Date().toISOString().slice(0, 10);\n\nreturn $input.all()\n  .map((item) => item.json)\n  .filter((a) => String(a.date).slice(0, 10) === today)\n  .filter((a) => String(a.status).toLowerCase() === \"no-show\" && !a.rebook_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      time: a.time,\n    },\n  }));"
      },
      "id": "2c52a72d-5332-4279-a57c-4e7c465d70f8",
      "name": "Today's no-shows",
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        600,
        0
      ]
    },
    {
      "parameters": {
        "operation": "sendTemplate",
        "phoneNumberId": "YOUR_PHONE_NUMBER_ID",
        "recipientPhoneNumber": "={{ $json.phone }}",
        "template": "YOUR_REBOOK_TEMPLATE|ar",
        "components": {
          "component": [
            {
              "type": "body",
              "bodyParameters": {
                "parameter": [
                  {
                    "type": "text",
                    "text": "={{ $json.patient }}"
                  },
                  {
                    "type": "text",
                    "text": "={{ $json.doctor }}"
                  }
                ]
              }
            }
          ]
        }
      },
      "id": "2c52a72d-5332-4279-a57c-4e7c465d70f8",
      "name": "Offer a new time",
      "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": "={{ $('Today\\'s no-shows').item.json.row_number }}",
            "rebook_sent": "={{ $now.toISODate() }}"
          },
          "matchingColumns": [
            "row_number"
          ]
        },
        "options": {}
      },
      "id": "2c52a72d-5332-4279-a57c-4e7c465d70f8",
      "name": "Mark as sent",
      "type": "n8n-nodes-base.googleSheets",
      "typeVersion": 4.5,
      "position": [
        1200,
        0
      ]
    }
  ],
  "connections": {
    "Every day 20:00": {
      "main": [
        [
          {
            "node": "Read appointments",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Read appointments": {
      "main": [
        [
          {
            "node": "Today's no-shows",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Today's no-shows": {
      "main": [
        [
          {
            "node": "Offer a new time",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Offer a new time": {
      "main": [
        [
          {
            "node": "Mark as sent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "pinData": {},
  "settings": {
    "executionOrder": "v1"
  },
  "meta": {
    "templateCredsSetupCompleted": false
  },
  "tags": []
}

← افتحها في ساحة التجربة لتعديلها

نصائح

  • اجعل الرسالة ودودة دون لوم. اذكر اسم الطبيب فقط، لا سبب الزيارة.

أتمتات مشابهة