وكيل ذكي لاشتراكات الجيم على واتساب

يجيب عن الحصص والباقات، ويحجز حصصًا تجريبية مجانية، ويسجّل طلبات التجميد والإلغاء.

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

تعمل مع n8n · Make · Zapier

كيف تعمل

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

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

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

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

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

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

التعليمات (System prompt)
You are the WhatsApp assistant for YOUR_GYM. 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 member's phone is {{ $('Get question').item.json.from }}.

Tools:
- "Classes & plans": our class timetable, coaches, membership plans, prices and opening hours. Always check it before answering.
- "My membership": this person's membership (plan, start, end, status, freezes used). It only returns the person who is messaging.
- "Book trial": books a free trial class for a new visitor. Use only after they confirm the class, date and their name.
- "Log request": logs a freeze, cancellation, plan change or personal-training request for the front desk.
- "Notify team": alerts our front desk about bookings, requests, complaints or anything you can't answer.

Rules:
- Never invent prices, offers, classes or coaches.
- Never give medical, injury or diet advice. Suggest they speak to a coach or a doctor.
- Never confirm a freeze or cancellation yourself; log it and say the front desk will confirm.

قواعد الأمان

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

  • لا يقدّم أبدًا نصائح طبية أو غذائية أو عن الإصابات
  • يعرض للعضو اشتراكه هو فقط
  • لا يؤكد التجميد أو الإلغاء بنفسه

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

المخطط

WIncoming messageWhatsApp Trigger{ }Get questionCodeGym agentAI AgentClaude modelAnthropic Chat Mo…◷MemorySimple MemoryGClasses & plansGoogle Sheets ToolGMy membershipGoogle Sheets ToolGBook trialGoogle Sheets ToolGLog requestGoogle Sheets ToolTNotify teamTelegram 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
عرض الكود (386 سطر)
{
  "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": "26069534-1e41-4be3-a6d6-09f4ff85e084",
      "name": "Setup notes",
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        -420,
        -60
      ]
    },
    {
      "parameters": {
        "updates": [
          "messages"
        ]
      },
      "id": "26069534-1e41-4be3-a6d6-09f4ff85e084",
      "name": "Incoming message",
      "type": "n8n-nodes-base.whatsAppTrigger",
      "typeVersion": 1,
      "position": [
        0,
        0
      ],
      "webhookId": "26069534-1e41-4be3-a6d6-09f4ff85e084"
    },
    {
      "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": "26069534-1e41-4be3-a6d6-09f4ff85e084",
      "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_GYM. 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 member's phone is {{ $('Get question').item.json.from }}.\n\nTools:\n- \"Classes & plans\": our class timetable, coaches, membership plans, prices and opening hours. Always check it before answering.\n- \"My membership\": this person's membership (plan, start, end, status, freezes used). It only returns the person who is messaging.\n- \"Book trial\": books a free trial class for a new visitor. Use only after they confirm the class, date and their name.\n- \"Log request\": logs a freeze, cancellation, plan change or personal-training request for the front desk.\n- \"Notify team\": alerts our front desk about bookings, requests, complaints or anything you can't answer.\n\nRules:\n- Never invent prices, offers, classes or coaches.\n- Never give medical, injury or diet advice. Suggest they speak to a coach or a doctor.\n- Never confirm a freeze or cancellation yourself; log it and say the front desk will confirm."
        }
      },
      "id": "26069534-1e41-4be3-a6d6-09f4ff85e084",
      "name": "Gym 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": "26069534-1e41-4be3-a6d6-09f4ff85e084",
      "name": "Claude model",
      "type": "@n8n/n8n-nodes-langchain.lmChatAnthropic",
      "typeVersion": 1.3,
      "position": [
        90,
        220
      ]
    },
    {
      "parameters": {
        "sessionIdType": "customKey",
        "sessionKey": "={{ $('Get question').item.json.from }}",
        "contextWindowLength": 10
      },
      "id": "26069534-1e41-4be3-a6d6-09f4ff85e084",
      "name": "Memory",
      "type": "@n8n/n8n-nodes-langchain.memoryBufferWindow",
      "typeVersion": 1.3,
      "position": [
        260,
        220
      ]
    },
    {
      "parameters": {
        "descriptionType": "manual",
        "toolDescription": "Returns the class timetable, coaches, membership plans, prices and opening hours.",
        "operation": "read",
        "documentId": {
          "__rl": true,
          "value": "YOUR_SPREADSHEET_ID",
          "mode": "id"
        },
        "sheetName": {
          "__rl": true,
          "value": "Classes",
          "mode": "name"
        },
        "options": {}
      },
      "id": "26069534-1e41-4be3-a6d6-09f4ff85e084",
      "name": "Classes & plans",
      "type": "n8n-nodes-base.googleSheetsTool",
      "typeVersion": 4.5,
      "position": [
        430,
        220
      ]
    },
    {
      "parameters": {
        "descriptionType": "manual",
        "toolDescription": "Returns the membership of the person who is messaging.",
        "operation": "read",
        "documentId": {
          "__rl": true,
          "value": "YOUR_SPREADSHEET_ID",
          "mode": "id"
        },
        "sheetName": {
          "__rl": true,
          "value": "Members",
          "mode": "name"
        },
        "filtersUI": {
          "values": [
            {
              "lookupColumn": "phone",
              "lookupValue": "={{ $('Get question').item.json.from }}"
            }
          ]
        },
        "options": {}
      },
      "id": "26069534-1e41-4be3-a6d6-09f4ff85e084",
      "name": "My membership",
      "type": "n8n-nodes-base.googleSheetsTool",
      "typeVersion": 4.5,
      "position": [
        600,
        220
      ]
    },
    {
      "parameters": {
        "descriptionType": "manual",
        "toolDescription": "Books a free trial class for a new visitor.",
        "operation": "append",
        "documentId": {
          "__rl": true,
          "value": "YOUR_SPREADSHEET_ID",
          "mode": "id"
        },
        "sheetName": {
          "__rl": true,
          "value": "Trials",
          "mode": "name"
        },
        "columns": {
          "mappingMode": "defineBelow",
          "value": {
            "booked_at": "={{ $now.toISO() }}",
            "phone": "={{ $('Get question').item.json.from }}",
            "name": "={{ $fromAI('name', \"Visitor's name\", 'string') }}",
            "class": "={{ $fromAI('class', \"Class name\", 'string') }}",
            "date": "={{ $fromAI('date', \"Class date and time\", 'string') }}"
          }
        },
        "options": {}
      },
      "id": "26069534-1e41-4be3-a6d6-09f4ff85e084",
      "name": "Book trial",
      "type": "n8n-nodes-base.googleSheetsTool",
      "typeVersion": 4.5,
      "position": [
        770,
        220
      ]
    },
    {
      "parameters": {
        "descriptionType": "manual",
        "toolDescription": "Logs a freeze, cancellation, plan change or personal-training request.",
        "operation": "append",
        "documentId": {
          "__rl": true,
          "value": "YOUR_SPREADSHEET_ID",
          "mode": "id"
        },
        "sheetName": {
          "__rl": true,
          "value": "Requests",
          "mode": "name"
        },
        "columns": {
          "mappingMode": "defineBelow",
          "value": {
            "date": "={{ $now.toISO() }}",
            "phone": "={{ $('Get question').item.json.from }}",
            "type": "={{ $fromAI('type', \"freeze, cancel, change plan or personal training\", 'string') }}",
            "details": "={{ $fromAI('details', \"Dates and details the member gave\", 'string') }}",
            "status": "pending"
          }
        },
        "options": {}
      },
      "id": "26069534-1e41-4be3-a6d6-09f4ff85e084",
      "name": "Log request",
      "type": "n8n-nodes-base.googleSheetsTool",
      "typeVersion": 4.5,
      "position": [
        940,
        220
      ]
    },
    {
      "parameters": {
        "descriptionType": "manual",
        "toolDescription": "Alerts the front desk about bookings, requests, complaints and questions you can't answer.",
        "chatId": "YOUR_TEAM_CHAT_ID",
        "text": "={{ $fromAI('message', \"What the team needs to know, including the customer's phone\", 'string') }}",
        "additionalFields": {
          "appendAttribution": false
        }
      },
      "id": "26069534-1e41-4be3-a6d6-09f4ff85e084",
      "name": "Notify team",
      "type": "n8n-nodes-base.telegramTool",
      "typeVersion": 1.2,
      "position": [
        1110,
        220
      ]
    },
    {
      "parameters": {
        "operation": "send",
        "phoneNumberId": "YOUR_PHONE_NUMBER_ID",
        "recipientPhoneNumber": "={{ $('Get question').item.json.from }}",
        "textBody": "={{ $json.output }}"
      },
      "id": "26069534-1e41-4be3-a6d6-09f4ff85e084",
      "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": "Gym agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Gym agent": {
      "main": [
        [
          {
            "node": "Reply on WhatsApp",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Claude model": {
      "ai_languageModel": [
        [
          {
            "node": "Gym agent",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Memory": {
      "ai_memory": [
        [
          {
            "node": "Gym agent",
            "type": "ai_memory",
            "index": 0
          }
        ]
      ]
    },
    "Classes & plans": {
      "ai_tool": [
        [
          {
            "node": "Gym agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "My membership": {
      "ai_tool": [
        [
          {
            "node": "Gym agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Book trial": {
      "ai_tool": [
        [
          {
            "node": "Gym agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Log request": {
      "ai_tool": [
        [
          {
            "node": "Gym agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Notify team": {
      "ai_tool": [
        [
          {
            "node": "Gym agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    }
  },
  "pinData": {},
  "settings": {
    "executionOrder": "v1"
  },
  "meta": {
    "templateCredsSetupCompleted": false
  },
  "tags": []
}

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

نصائح

  • حدّث جدول Classes كلما تغيّر مدرب أو موعد؛ الوكيل يثق به تمامًا.

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