{
  "id": "ZBWtmHUruuIlVsQ7",
  "meta": {
    "templateCredsSetupCompleted": true
  },
  "name": "Domain Name Availability Check with WHMCS - Template",
  "tags": [],
  "nodes": [
    {
      "id": "bbef1f29-94cc-4058-a634-deb14305a2f0",
      "name": "AI Agent",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        -480,
        -144
      ],
      "parameters": {
        "text": "={{ $json.body.chatInput }}",
        "options": {
          "systemMessage": "=\nYou are an **AI-powered customer support assistant** for a domain-selling website.  \nYour role is to provide **accurate, helpful, and friendly answers** to customer queries regarding domain name availability, **strictly based on verified checks**.\n\n---\n\n## Core Responsibilities\n1. Respond concisely but with enough detail to fully answer the customer\u2019s question.  \n2. Maintain a professional, approachable, and customer-focused tone.  \n3. **Never mention, suggest, or confirm a domain name unless it has been verified first.**  \n\n---\n\n## Knowledge Sources & Tools\n- **Domain_Availability_Checker** \u2192 Used to verify domain name availability.  \n\n---\n\n## Chat Data Storage Rules\n- Each chat session is identified by a unique **Session ID**.  \n- Keep track of all **verified domain checks** during the session.  \n- Only suggest domains that are confirmed as available.  \n\n---\n\n## Strict Guidelines\n- **Always verify domain availability before mentioning it.**  \n- **Never assume availability.**  \n- **Do not suggest multiple alternatives unless each one has been individually checked and confirmed available.**  \n- Keep memory of all verified checks during the session and only recommend those domains.  \n- Do not suggest or reference tools by name in your replies.  \n- Add a slight delay in responses to mimic human typing.  \n- If a customer mentions a domain:  \n  - First, check availability.  \n  - If available \u2192 confirm positively.  \n  - If unavailable \u2192 respond with a positive tone (never apologetic) and suggest one or more **verified alternatives**.  \n- **No speculative answers. No placeholders. No unverified domains.**  \n\n---\n\n## Example Interactions\n\n### 1. Domain Name Inquiry (Available Domain)  \n**User**: \"Can you check the availability for example.com?\"  \n**Erik**: \"Let me first check the availability of <b>example.com</b> for you...  \nGreat news! example.com is available.\"\n\n---\n\n### 2. Domain Name Inquiry (Unavailable Domain \u2013 Positive Tone, Verified Alternatives)  \n**User**: \"I want to buy myshop.com\"  \n**Erik**: \"I\u2019ve checked for you \u2014 myshop.com is already taken.  \nBut no worries! I also checked a few great options: myshop.net and myshop.online \u2014 both are available right now.\"  \n\n---\n\n## Reminder\n- Always be accurate, friendly, and efficient.  \n- Your primary goal is to help the user make quick, informed decisions.  \n- **Today is {{ $now }}.**  \n"
        },
        "promptType": "define"
      },
      "typeVersion": 2.1
    },
    {
      "id": "3957adba-a083-4d80-812e-87c8ab2b66cb",
      "name": "Google Gemini Chat Model",
      "type": "@n8n/n8n-nodes-langchain.lmChatGoogleGemini",
      "position": [
        -576,
        80
      ],
      "parameters": {
        "options": {}
      },
      "credentials": {
        "googlePalmApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "c00a80f2-e5e1-4e29-b740-3be832012f46",
      "name": "Simple Memory",
      "type": "@n8n/n8n-nodes-langchain.memoryBufferWindow",
      "position": [
        -384,
        80
      ],
      "parameters": {
        "sessionKey": "={{ $('Webhook').item.json.body.sessionId }}",
        "sessionIdType": "customKey",
        "contextWindowLength": 15
      },
      "typeVersion": 1.3
    },
    {
      "id": "7a7d940b-7bad-45e0-acfb-786ec82c9aa6",
      "name": "Domain_Availability_Checker",
      "type": "n8n-nodes-base.httpRequestTool",
      "position": [
        -192,
        80
      ],
      "parameters": {
        "url": "https://your_whmcs_url.com/includes/api.php",
        "method": "POST",
        "options": {},
        "sendBody": true,
        "contentType": "form-urlencoded",
        "sendHeaders": true,
        "bodyParameters": {
          "parameters": [
            {
              "name": "identifier",
              "value": "Your_WHMCS_Identifier"
            },
            {
              "name": "secret",
              "value": "Your_WHMCS_Secret"
            },
            {
              "name": "action",
              "value": "DomainWhois"
            },
            {
              "name": "domain",
              "value": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('parameters3_Value', ``, 'string') }}"
            }
          ]
        },
        "toolDescription": "Makes an HTTP request to check the Domain Avaialbility",
        "headerParameters": {
          "parameters": [
            {
              "name": "Content-Type",
              "value": "application/x-www-form-urlencoded"
            }
          ]
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "c24c3355-4474-48fd-ad63-2b89a49a5158",
      "name": "Respond to Webhook1",
      "type": "n8n-nodes-base.respondToWebhook",
      "position": [
        -128,
        -144
      ],
      "parameters": {
        "options": {
          "responseHeaders": {
            "entries": [
              {
                "name": "Content-Type",
                "value": "application/json"
              },
              {
                "name": "Access-Control-Allow-Origin",
                "value": "*"
              },
              {
                "name": "Access-Control-Allow-Headers",
                "value": "Content-Type, x-api-key"
              },
              {
                "name": "Access-Control-Allow-Methods",
                "value": "POST, OPTIONS"
              }
            ]
          }
        }
      },
      "typeVersion": 1
    },
    {
      "id": "bf936b20-54fd-42ef-adcd-6c004cea873d",
      "name": "Webhook",
      "type": "n8n-nodes-base.webhook",
      "position": [
        -656,
        -144
      ],
      "parameters": {
        "path": "8a56ad98-d800-4296-9a12-e6472b5d46dd",
        "options": {},
        "httpMethod": "POST",
        "responseMode": "responseNode"
      },
      "typeVersion": 2
    },
    {
      "id": "cc19df99-1ede-4cef-a250-6b998bbb099d",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1200,
        -160
      ],
      "parameters": {
        "width": 512,
        "content": "## Domain Name Availability Check Workflow\n### [Live Demo](https://omerfayyaz.com/domain-name-availability-checker-with-n8n-using-whmcs-api/index.html)\nThis n8n workflow creates an **AI-powered chatbot** that automatically checks domain availability using your WHMCS system. Customers can ask about domains in natural language, and the AI will verify availability through WHMCS API and suggest alternatives if needed."
      },
      "typeVersion": 1
    },
    {
      "id": "365c63eb-9acd-49d3-8644-e925be8385ec",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1200,
        16
      ],
      "parameters": {
        "color": 5,
        "width": 512,
        "content": "### **Configure WHMCS API**\n- Open the \"Domain_Availability_Checker\" node\n- Replace `Your_WHMCS_Identifier` with your actual WHMCS API identifier\n- Replace `Your_WHMCS_Secret` with your actual WHMCS API secret\n- Update the URL to your WHMCS domain: `https://yourdomain.com/includes/api.php`"
      },
      "typeVersion": 1
    }
  ],
  "active": false,
  "settings": {
    "timezone": "Asia/Karachi",
    "callerPolicy": "workflowsFromSameOwner",
    "executionOrder": "v1"
  },
  "versionId": "853d5120-3888-42aa-9206-d749f7d5a780",
  "connections": {
    "Webhook": {
      "main": [
        [
          {
            "node": "AI Agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "AI Agent": {
      "main": [
        [
          {
            "node": "Respond to Webhook1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Simple Memory": {
      "ai_memory": [
        [
          {
            "node": "AI Agent",
            "type": "ai_memory",
            "index": 0
          }
        ]
      ]
    },
    "Google Gemini Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "AI Agent",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Domain_Availability_Checker": {
      "ai_tool": [
        [
          {
            "node": "AI Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    }
  }
}