WhatsApp sales AI agent (Arabic)

Sells on WhatsApp in the customer's own dialect: checks your catalog, answers questions and takes cash-on-delivery orders.

AI agentAdvanced Saves ~30 hours/month AI AgentsBy Flowngn team

Works with n8n · Make · Zapier

How it works

Trigger: WhatsApp — a customer sends a message
  1. A customer messages your WhatsApp Business number.
  2. The agent replies in their dialect and checks your product sheet for prices, sizes and stock.
  3. When the customer is ready, it confirms every detail and the total, then saves the order.
  4. It alerts your team on Telegram about new orders or when a person is needed.

What it can do

Unlike a fixed flow, an agent decides which of its tools to use, in what order — and remembers the conversation.

  • Chats in Egyptian, Gulf or Standard Arabic — or English
  • Checks your catalog before quoting any price or availability
  • Suggests alternatives when something is out of stock
  • Takes cash-on-delivery orders and saves them to your Orders sheet
  • Remembers each customer's conversation by phone number
  • Alerts your team on Telegram for new orders and hand-overs

System prompt

The instructions that shape the agent. It's already inside the n8n template — copy it into Make or Zapier, and adjust the YOUR_… parts.

System prompt
You are the WhatsApp sales assistant for YOUR_STORE, an online store in Egypt.

Reply in the customer's language and dialect (Egyptian Arabic, Gulf Arabic, Modern Standard Arabic or English). Be warm, short and helpful, like a good shop assistant. Use at most one emoji per message.

Tools:
- "Search products": our catalog (name, price, sizes, colors, stock). Always check it before quoting a price or availability.
- "Create order": saves a confirmed order. Use it ONLY after the customer has confirmed product, size, quantity, full name, phone, city and address, and you have repeated the total back to them.
- "Notify team": alerts our team. Use it for every new order, and when the customer asks for a person or asks something you can't answer.

Rules:
- Never invent products, prices, discounts or delivery times.
- Payment is cash on delivery. Never ask for card details in chat.
- If a product is out of stock, suggest the closest alternative from the catalog.
- If the customer asks for a human, use "Notify team" and tell them someone will reply soon.

Safety rules

Built into the prompt and the tools:

  • Never invents products, prices or discounts
  • Repeats the order and total for confirmation before saving
  • Never asks for card details — cash on delivery only

Uses your own AI key (Claude, OpenAI or another model). Cost depends on the model and conversation length — a small, fast model keeps most conversations to a fraction of a cent.

Diagram

WIncoming messageWhatsApp Trigger{ }Get questionCodeSales agentAI AgentClaude modelAnthropic Chat Mo…◷MemorySimple MemoryGSearch productsGoogle Sheets ToolGCreate orderGoogle Sheets ToolTNotify teamTelegram ToolWReply on WhatsAppWhatsApp Business Cloud
Trigger App Code AI Agent tool

Code

JavaScript used in the Code step — already included in the template below.

Get question · Code node
// 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 } }];

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. AI steps use a Claude model node — swap it for OpenAI, Gemini or Ollama if you prefer.

Workflow JSON
Show code (297 lines)
{
  "name": "WhatsApp sales AI agent (Arabic) (Flowngn)",
  "nodes": [
    {
      "parameters": {
        "content": "## WhatsApp sales AI agent (Arabic)\nSells on WhatsApp in the customer's own dialect: checks your catalog, answers questions and takes cash-on-delivery orders.\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": "3f36c28d-dcaa-4fe7-afb0-dde2cffcb7d1",
      "name": "Setup notes",
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        -420,
        -60
      ]
    },
    {
      "parameters": {
        "updates": [
          "messages"
        ]
      },
      "id": "3f36c28d-dcaa-4fe7-afb0-dde2cffcb7d1",
      "name": "Incoming message",
      "type": "n8n-nodes-base.whatsAppTrigger",
      "typeVersion": 1,
      "position": [
        0,
        0
      ],
      "webhookId": "3f36c28d-dcaa-4fe7-afb0-dde2cffcb7d1"
    },
    {
      "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": "3f36c28d-dcaa-4fe7-afb0-dde2cffcb7d1",
      "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 sales assistant for YOUR_STORE, an online store in Egypt.\n\nReply in the customer's language and dialect (Egyptian Arabic, Gulf Arabic, Modern Standard Arabic or English). Be warm, short and helpful, like a good shop assistant. Use at most one emoji per message.\n\nTools:\n- \"Search products\": our catalog (name, price, sizes, colors, stock). Always check it before quoting a price or availability.\n- \"Create order\": saves a confirmed order. Use it ONLY after the customer has confirmed product, size, quantity, full name, phone, city and address, and you have repeated the total back to them.\n- \"Notify team\": alerts our team. Use it for every new order, and when the customer asks for a person or asks something you can't answer.\n\nRules:\n- Never invent products, prices, discounts or delivery times.\n- Payment is cash on delivery. Never ask for card details in chat.\n- If a product is out of stock, suggest the closest alternative from the catalog.\n- If the customer asks for a human, use \"Notify team\" and tell them someone will reply soon."
        }
      },
      "id": "3f36c28d-dcaa-4fe7-afb0-dde2cffcb7d1",
      "name": "Sales 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": "3f36c28d-dcaa-4fe7-afb0-dde2cffcb7d1",
      "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": "3f36c28d-dcaa-4fe7-afb0-dde2cffcb7d1",
      "name": "Memory",
      "type": "@n8n/n8n-nodes-langchain.memoryBufferWindow",
      "typeVersion": 1.3,
      "position": [
        430,
        220
      ]
    },
    {
      "parameters": {
        "descriptionType": "manual",
        "toolDescription": "Returns our product catalog (name, price, sizes, colors, stock). Check it before quoting any price or availability.",
        "operation": "read",
        "documentId": {
          "__rl": true,
          "value": "YOUR_SPREADSHEET_ID",
          "mode": "id"
        },
        "sheetName": {
          "__rl": true,
          "value": "Products",
          "mode": "name"
        },
        "options": {}
      },
      "id": "3f36c28d-dcaa-4fe7-afb0-dde2cffcb7d1",
      "name": "Search products",
      "type": "n8n-nodes-base.googleSheetsTool",
      "typeVersion": 4.5,
      "position": [
        600,
        220
      ]
    },
    {
      "parameters": {
        "descriptionType": "manual",
        "toolDescription": "Saves a confirmed cash-on-delivery order. Only call after the customer confirmed every detail and the total.",
        "operation": "append",
        "documentId": {
          "__rl": true,
          "value": "YOUR_SPREADSHEET_ID",
          "mode": "id"
        },
        "sheetName": {
          "__rl": true,
          "value": "Orders",
          "mode": "name"
        },
        "columns": {
          "mappingMode": "defineBelow",
          "value": {
            "date": "={{ $now.toISO() }}",
            "phone": "={{ $('Get question').item.json.from }}",
            "name": "={{ $fromAI('name', \"Customer's full name\", 'string') }}",
            "product": "={{ $fromAI('product', \"Product name, size and color\", 'string') }}",
            "quantity": "={{ $fromAI('quantity', \"Quantity\", 'number') }}",
            "total": "={{ $fromAI('total', \"Order total in EGP\", 'number') }}",
            "city": "={{ $fromAI('city', \"Delivery city\", 'string') }}",
            "address": "={{ $fromAI('address', \"Full delivery address\", 'string') }}"
          }
        },
        "options": {}
      },
      "id": "3f36c28d-dcaa-4fe7-afb0-dde2cffcb7d1",
      "name": "Create order",
      "type": "n8n-nodes-base.googleSheetsTool",
      "typeVersion": 4.5,
      "position": [
        770,
        220
      ]
    },
    {
      "parameters": {
        "descriptionType": "manual",
        "toolDescription": "Sends a message to our team's Telegram group: new orders, requests for a human, or 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": "3f36c28d-dcaa-4fe7-afb0-dde2cffcb7d1",
      "name": "Notify team",
      "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": "3f36c28d-dcaa-4fe7-afb0-dde2cffcb7d1",
      "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": "Sales agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Sales agent": {
      "main": [
        [
          {
            "node": "Reply on WhatsApp",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Claude model": {
      "ai_languageModel": [
        [
          {
            "node": "Sales agent",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Memory": {
      "ai_memory": [
        [
          {
            "node": "Sales agent",
            "type": "ai_memory",
            "index": 0
          }
        ]
      ]
    },
    "Search products": {
      "ai_tool": [
        [
          {
            "node": "Sales agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Create order": {
      "ai_tool": [
        [
          {
            "node": "Sales agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Notify team": {
      "ai_tool": [
        [
          {
            "node": "Sales agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    }
  },
  "pinData": {},
  "settings": {
    "executionOrder": "v1"
  },
  "meta": {
    "templateCredsSetupCompleted": false
  },
  "tags": []
}

Open in the playground to edit →

Tips

  • Replies within 24 hours of the customer's message are free-form; later messages need approved templates.
  • Keep the Products sheet up to date — the agent trusts it completely.

Related flows