{
  "name": "ChatKomodo — send a WhatsApp message from a webhook",
  "nodes": [
    {
      "parameters": {
        "httpMethod": "POST",
        "path": "send-whatsapp",
        "responseMode": "onReceived",
        "options": {}
      },
      "name": "Webhook (phone, message)",
      "type": "n8n-nodes-base.webhook",
      "typeVersion": 2,
      "position": [
        0,
        0
      ],
      "webhookId": "chatkomodo-send"
    },
    {
      "parameters": {
        "method": "POST",
        "url": "https://api.chatkomodo.com/v1/sessions/YOUR_DEVICE_ID/messages",
        "authentication": "genericCredentialType",
        "genericAuthType": "httpHeaderAuth",
        "sendBody": true,
        "specifyBody": "json",
        "jsonBody": "={{ JSON.stringify({ chat_id: $json.body.phone, type: 'text', body: $json.body.message }) }}",
        "options": {}
      },
      "name": "Send WhatsApp",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        260,
        0
      ],
      "credentials": {
        "httpHeaderAuth": {
          "id": "",
          "name": "ChatKomodo API"
        }
      }
    },
    {
      "parameters": {
        "content": "## Send a WhatsApp message\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).\nPOST {\"phone\":\"+62812…\",\"message\":\"Halo\"} to this workflow's webhook URL.",
        "height": 220,
        "width": 420
      },
      "name": "Note",
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        -40,
        -260
      ]
    }
  ],
  "connections": {
    "Webhook (phone, message)": {
      "main": [
        [
          {
            "node": "Send WhatsApp",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "settings": {}
}