وكيل ذكي لأولياء الأمور على واتساب

يجيب أولياء الأمور عن الرسوم والمواعيد والفعاليات، ويخبرهم بغياب أبنائهم والرسوم المستحقة عليهم.

وكيل ذكيمتقدم توفّر ~20 ساعة شهريًا وكلاء الذكاء الاصطناعيبواسطة فريق Flowngn

تعمل مع n8n · Make · Zapier

كيف تعمل

المشغّل: واتساب — ولي أمر يرسل رسالة
  1. يسأل ولي الأمر سؤالًا على واتساب.
  2. يجيب الوكيل عن الأسئلة العامة من جدول معلومات المدرسة.
  3. لأسئلة الأبناء، يبحث فقط عن الأبناء المرتبطين برقم ولي الأمر.
  4. يحوّل الشكاوى ومخاوف السلامة وطلبات الاجتماع إلى المكتب.

ماذا يستطيع أن يفعل

على عكس الأتمتة الثابتة، يقرر الوكيل أي أدواته يستخدم وبأي ترتيب — ويتذكر المحادثة.

  • يجيب عن الرسوم ومواعيد الفصول والإجازات والمواصلات والفعاليات
  • يشارك غياب الطالب ورسومه المستحقة مع ولي أمره فقط
  • يرد باللهجات العربية أو الإنجليزية
  • ينبّه المكتب لأي أمر حساس

التعليمات (System prompt)

التعليمات التي تشكّل سلوك الوكيل. موجودة بالفعل داخل قالب n8n — انسخها إلى Make أو Zapier، وعدّل أجزاء YOUR_….

التعليمات (System prompt)
You are the WhatsApp assistant for YOUR_SCHOOL, talking to parents. Reply in the customer's language and dialect (Egyptian Arabic, Gulf Arabic, Modern Standard Arabic or English). Be warm and brief.

Today is {{ $now.toFormat('cccc d LLLL yyyy') }}. The parent's phone is {{ $('Get question').item.json.from }}.

Tools:
- "School info": fees, payment methods, term dates, holidays, uniform, transport, events and contacts. Answer general questions only from it.
- "My children": the children registered to THIS parent's phone (name, grade, class, teacher, absences this term, fees due). It only ever returns this parent's children.
- "Notify school": alerts the school office. Use it for complaints, health or safety concerns, bullying, fee disputes, meeting requests, and anything you can't answer.

Rules:
- If "My children" returns nothing, say the number isn't registered and ask them to contact the office; never share any child's details.
- Never discuss other students, staff personal details, or grades you don't have.
- Never promise exceptions, refunds or decisions; say the school will confirm.
- For anything urgent about a child's safety or health, use "Notify school" immediately and give them the office phone YOUR_OFFICE_PHONE.

قواعد الأمان

مدمجة في التعليمات والأدوات:

  • يعرض فقط الأبناء المسجلين برقم ولي الأمر
  • لا يتحدث أبدًا عن طلاب آخرين أو موظفين
  • يرسل مخاوف السلامة والصحة إلى المكتب فورًا

يستخدم مفتاح الذكاء الاصطناعي الخاص بك (Claude أو OpenAI أو غيرهما). التكلفة تعتمد على النموذج وطول المحادثة — والنموذج الصغير السريع يجعل معظم المحادثات بجزء من السنت.

المخطط

WIncoming messageWhatsApp Trigger{ }Get questionCodeParents agentAI AgentClaude modelAnthropic Chat Mo…◷MemorySimple MemoryGSchool infoGoogle Sheets ToolGMy childrenGoogle Sheets ToolTNotify schoolTelegram ToolWReply on WhatsAppWhatsApp Business Cloud
مشغّل تطبيق كود ذكاء اصطناعي أداة للوكيل

الكود

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

Get question · عقدة Code
// Keeps only text messages and pulls out who sent it and what they asked.
const msg = $input.first().json.messages?.[0];
if (!msg || msg.type !== "text") return [];

return [{ json: { from: msg.from, question: msg.text.body } }];

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

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

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

ملف Workflow JSON
عرض الكود (292 سطر)
{
  "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": "45820912-e7e8-476e-a2a7-16e2eb03a79c",
      "name": "Setup notes",
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        -420,
        -60
      ]
    },
    {
      "parameters": {
        "updates": [
          "messages"
        ]
      },
      "id": "45820912-e7e8-476e-a2a7-16e2eb03a79c",
      "name": "Incoming message",
      "type": "n8n-nodes-base.whatsAppTrigger",
      "typeVersion": 1,
      "position": [
        0,
        0
      ],
      "webhookId": "45820912-e7e8-476e-a2a7-16e2eb03a79c"
    },
    {
      "parameters": {
        "jsCode": "// Keeps only text messages and pulls out who sent it and what they asked.\nconst msg = $input.first().json.messages?.[0];\nif (!msg || msg.type !== \"text\") return [];\n\nreturn [{ json: { from: msg.from, question: msg.text.body } }];"
      },
      "id": "45820912-e7e8-476e-a2a7-16e2eb03a79c",
      "name": "Get question",
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        300,
        0
      ]
    },
    {
      "parameters": {
        "promptType": "define",
        "text": "={{ $json.question }}",
        "options": {
          "systemMessage": "=You are the WhatsApp assistant for YOUR_SCHOOL, talking to parents. Reply in the customer's language and dialect (Egyptian Arabic, Gulf Arabic, Modern Standard Arabic or English). Be warm and brief.\n\nToday is {{ $now.toFormat('cccc d LLLL yyyy') }}. The parent's phone is {{ $('Get question').item.json.from }}.\n\nTools:\n- \"School info\": fees, payment methods, term dates, holidays, uniform, transport, events and contacts. Answer general questions only from it.\n- \"My children\": the children registered to THIS parent's phone (name, grade, class, teacher, absences this term, fees due). It only ever returns this parent's children.\n- \"Notify school\": alerts the school office. Use it for complaints, health or safety concerns, bullying, fee disputes, meeting requests, and anything you can't answer.\n\nRules:\n- If \"My children\" returns nothing, say the number isn't registered and ask them to contact the office; never share any child's details.\n- Never discuss other students, staff personal details, or grades you don't have.\n- Never promise exceptions, refunds or decisions; say the school will confirm.\n- For anything urgent about a child's safety or health, use \"Notify school\" immediately and give them the office phone YOUR_OFFICE_PHONE."
        }
      },
      "id": "45820912-e7e8-476e-a2a7-16e2eb03a79c",
      "name": "Parents agent",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "typeVersion": 1.9,
      "position": [
        600,
        0
      ]
    },
    {
      "parameters": {
        "model": {
          "__rl": true,
          "value": "claude-sonnet-5",
          "mode": "list"
        },
        "options": {}
      },
      "id": "45820912-e7e8-476e-a2a7-16e2eb03a79c",
      "name": "Claude model",
      "type": "@n8n/n8n-nodes-langchain.lmChatAnthropic",
      "typeVersion": 1.3,
      "position": [
        260,
        220
      ]
    },
    {
      "parameters": {
        "sessionIdType": "customKey",
        "sessionKey": "={{ $('Get question').item.json.from }}",
        "contextWindowLength": 10
      },
      "id": "45820912-e7e8-476e-a2a7-16e2eb03a79c",
      "name": "Memory",
      "type": "@n8n/n8n-nodes-langchain.memoryBufferWindow",
      "typeVersion": 1.3,
      "position": [
        430,
        220
      ]
    },
    {
      "parameters": {
        "descriptionType": "manual",
        "toolDescription": "Returns school information: fees, term dates, holidays, transport, events, contacts.",
        "operation": "read",
        "documentId": {
          "__rl": true,
          "value": "YOUR_SPREADSHEET_ID",
          "mode": "id"
        },
        "sheetName": {
          "__rl": true,
          "value": "School info",
          "mode": "name"
        },
        "options": {}
      },
      "id": "45820912-e7e8-476e-a2a7-16e2eb03a79c",
      "name": "School info",
      "type": "n8n-nodes-base.googleSheetsTool",
      "typeVersion": 4.5,
      "position": [
        600,
        220
      ]
    },
    {
      "parameters": {
        "descriptionType": "manual",
        "toolDescription": "Returns the children registered to the parent who is messaging.",
        "operation": "read",
        "documentId": {
          "__rl": true,
          "value": "YOUR_SPREADSHEET_ID",
          "mode": "id"
        },
        "sheetName": {
          "__rl": true,
          "value": "Students",
          "mode": "name"
        },
        "filtersUI": {
          "values": [
            {
              "lookupColumn": "parent_phone",
              "lookupValue": "={{ $('Get question').item.json.from }}"
            }
          ]
        },
        "options": {}
      },
      "id": "45820912-e7e8-476e-a2a7-16e2eb03a79c",
      "name": "My children",
      "type": "n8n-nodes-base.googleSheetsTool",
      "typeVersion": 4.5,
      "position": [
        770,
        220
      ]
    },
    {
      "parameters": {
        "descriptionType": "manual",
        "toolDescription": "Alerts the school office about complaints, safety concerns, meeting requests and questions you can't answer.",
        "chatId": "YOUR_OFFICE_CHAT_ID",
        "text": "={{ $fromAI('message', \"What the office needs to know, including the parent's phone and child's name\", 'string') }}",
        "additionalFields": {
          "appendAttribution": false
        }
      },
      "id": "45820912-e7e8-476e-a2a7-16e2eb03a79c",
      "name": "Notify school",
      "type": "n8n-nodes-base.telegramTool",
      "typeVersion": 1.2,
      "position": [
        940,
        220
      ]
    },
    {
      "parameters": {
        "operation": "send",
        "phoneNumberId": "YOUR_PHONE_NUMBER_ID",
        "recipientPhoneNumber": "={{ $('Get question').item.json.from }}",
        "textBody": "={{ $json.output }}"
      },
      "id": "45820912-e7e8-476e-a2a7-16e2eb03a79c",
      "name": "Reply on WhatsApp",
      "type": "n8n-nodes-base.whatsApp",
      "typeVersion": 1,
      "position": [
        900,
        0
      ]
    }
  ],
  "connections": {
    "Incoming message": {
      "main": [
        [
          {
            "node": "Get question",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get question": {
      "main": [
        [
          {
            "node": "Parents agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Parents agent": {
      "main": [
        [
          {
            "node": "Reply on WhatsApp",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Claude model": {
      "ai_languageModel": [
        [
          {
            "node": "Parents agent",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Memory": {
      "ai_memory": [
        [
          {
            "node": "Parents agent",
            "type": "ai_memory",
            "index": 0
          }
        ]
      ]
    },
    "School info": {
      "ai_tool": [
        [
          {
            "node": "Parents agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "My children": {
      "ai_tool": [
        [
          {
            "node": "Parents agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Notify school": {
      "ai_tool": [
        [
          {
            "node": "Parents agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    }
  },
  "pinData": {},
  "settings": {
    "executionOrder": "v1"
  },
  "meta": {
    "templateCredsSetupCompleted": false
  },
  "tags": []
}

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

نصائح

  • احفظ أرقام أولياء الأمور بنفس صيغة واتساب: مفتاح الدولة دون + أو مسافات (مثل 201001234567).

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