{
  "name": "ChatKomodo — new WhatsApp message → reply",
  "nodes": [
    {
      "parameters": {
        "httpMethod": "POST",
        "path": "chatkomodo-events",
        "responseMode": "onReceived",
        "options": {}
      },
      "name": "ChatKomodo webhook",
      "type": "n8n-nodes-base.webhook",
      "typeVersion": 2,
      "position": [
        0,
        0
      ],
      "webhookId": "chatkomodo-events"
    },
    {
      "parameters": {
        "conditions": {
          "options": {
            "caseSensitive": false,
            "leftValue": "",
            "typeValidation": "loose"
          },
          "conditions": [
            {
              "leftValue": "={{ $json.body.type }}",
              "rightValue": "message.received",
              "operator": {
                "type": "string",
                "operation": "equals"
              }
            },
            {
              "leftValue": "={{ $json.body.data.body }}",
              "rightValue": "harga",
              "operator": {
                "type": "string",
                "operation": "contains"
              }
            }
          ],
          "combinator": "and"
        },
        "options": {}
      },
      "name": "Asks for the price?",
      "type": "n8n-nodes-base.if",
      "typeVersion": 2,
      "position": [
        240,
        0
      ]
    },
    {
      "parameters": {
        "method": "POST",
        "url": "={{ 'https://api.chatkomodo.com/v1/sessions/' + $json.body.session_id + '/messages' }}",
        "authentication": "genericCredentialType",
        "genericAuthType": "httpHeaderAuth",
        "sendBody": true,
        "specifyBody": "json",
        "jsonBody": "={{ JSON.stringify({ chat_id: $json.body.data.chat_id, type: 'text', body: 'Halo! Daftar harga kami: https://example.com/harga' }) }}",
        "options": {}
      },
      "name": "Reply",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        500,
        -80
      ],
      "credentials": {
        "httpHeaderAuth": {
          "id": "",
          "name": "ChatKomodo API"
        }
      }
    },
    {
      "parameters": {
        "content": "## Reply to incoming messages\nCredential: Header Auth named \"ChatKomodo API\" with Name = Authorization and Value = Bearer <your API key>. Replace YOUR_DEVICE_ID with the device id (Devices → device → ID).\nIn ChatKomodo → Webhooks, add this workflow's production webhook URL with the event message.received (or let the ChatKomodo Trigger node do it).",
        "height": 240,
        "width": 440
      },
      "name": "Note",
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        -40,
        -300
      ]
    }
  ],
  "connections": {
    "ChatKomodo webhook": {
      "main": [
        [
          {
            "node": "Asks for the price?",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Asks for the price?": {
      "main": [
        [
          {
            "node": "Reply",
            "type": "main",
            "index": 0
          }
        ],
        []
      ]
    }
  },
  "settings": {}
}