{
  "name": "WAHA Trigger Explanation",
  "nodes": [
    {
      "parameters": {
        "httpMethod": "POST",
        "path": "waha-qr-webhooks",
        "options": {}
      },
      "id": "a80c0049-583d-4f11-a154-7e662a863de3",
      "name": "Webhook",
      "type": "n8n-nodes-base.webhook",
      "typeVersion": 2,
      "position": [
        500,
        1020
      ],
      "webhookId": "b7453a5b-c133-40d1-a221-870b3ef3d8d0"
    },
    {
      "parameters": {
        "mode": "raw",
        "jsonOutput": "={{ $json.body }}",
        "options": {}
      },
      "id": "298ae97b-fa1b-48ba-886b-9216217afce6",
      "name": "Extract Event",
      "type": "n8n-nodes-base.set",
      "typeVersion": 3.4,
      "position": [
        660,
        1020
      ]
    },
    {
      "parameters": {
        "content": "## WAHA Webhook",
        "height": 629.9407047373624,
        "width": 327.12752630406015,
        "color": 6
      },
      "id": "ce4f6fe1-9eee-4af8-bb1c-a0d777665a69",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        1180,
        760
      ]
    },
    {
      "parameters": {},
      "id": "d965e045-faab-44d2-982c-dd9be8c58c06",
      "name": "WAHA Trigger",
      "type": "@devlikeapro/n8n-nodes-waha.wahaTrigger",
      "typeVersion": 202409,
      "position": [
        1260,
        820
      ],
      "webhookId": "71251449-2644-4325-8ba7-2a1550a81fb4"
    },
    {
      "parameters": {
        "rules": {
          "values": [
            {
              "conditions": {
                "options": {
                  "caseSensitive": true,
                  "leftValue": "",
                  "typeValidation": "strict"
                },
                "conditions": [
                  {
                    "leftValue": "={{ $json.event }}",
                    "rightValue": "session.status",
                    "operator": {
                      "type": "string",
                      "operation": "equals"
                    }
                  }
                ],
                "combinator": "and"
              },
              "renameOutput": true,
              "outputKey": "session.status"
            },
            {
              "conditions": {
                "options": {
                  "caseSensitive": true,
                  "leftValue": "",
                  "typeValidation": "strict"
                },
                "conditions": [
                  {
                    "id": "a7b7b1ea-7575-416f-87f3-c4f799c16de0",
                    "leftValue": "{{ $json.event }}",
                    "rightValue": "message",
                    "operator": {
                      "type": "string",
                      "operation": "equals",
                      "name": "filter.operator.equals"
                    }
                  }
                ],
                "combinator": "and"
              },
              "renameOutput": true,
              "outputKey": "message"
            }
          ]
        },
        "options": {}
      },
      "id": "317255c6-880e-465e-90d4-f4f7268a1e53",
      "name": "Listen for Events",
      "type": "n8n-nodes-base.switch",
      "typeVersion": 3.1,
      "position": [
        800,
        1020
      ]
    },
    {
      "parameters": {
        "content": "## Webhook Shortcut\n**WAHA Webhook** node is basically a shortcut for  operations:\n\n1. Webhook handler\n2. Extract **body** from the POST request\n3. Filter events based on `event` ",
        "height": 351.87272727272716,
        "width": 558.3138303449722
      },
      "id": "e049be6b-f44e-4f21-86d3-1f017722c9e7",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        460,
        840
      ]
    }
  ],
  "pinData": {
    "Webhook": [
      {
        "json": {
          "headers": {
            "content-type": "application/json",
            "host": "localhost:5678",
            "content-length": "267",
            "connection": "keep-alive"
          },
          "params": {},
          "query": {},
          "body": {
            "event": "session.status",
            "session": "default2",
            "metadata": {
              "user.id": "123"
            },
            "me": null,
            "payload": {
              "name": "default2",
              "status": "SCAN_QR_CODE"
            },
            "engine": "WEBJS",
            "environment": {
              "version": "2024.9.3",
              "engine": "WEBJS",
              "tier": "PLUS",
              "browser": "/usr/bin/google-chrome-stable"
            }
          },
          "webhookUrl": "http://localhost:5678/webhook-test/waha-qr-webhooks",
          "executionMode": "test"
        }
      }
    ]
  },
  "connections": {
    "Webhook": {
      "main": [
        [
          {
            "node": "Extract Event",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Extract Event": {
      "main": [
        [
          {
            "node": "Listen for Events",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "WAHA Trigger": {
      "main": [
        [],
        []
      ]
    }
  },
  "active": false,
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "30337cfe-2ce0-4a60-ac27-e4d2f488255c",
  "meta": {
    "templateCredsSetupCompleted": true,
    "instanceId": "6f24ea268994ae36b30ec537d02abd1ea604e9b986f06bb7e0e0ccb8309ddbc4"
  },
  "id": "uzY0rcEebtpzW8IF",
  "tags": []
}