{
  "active": false,
  "connections": {
    "TechnoGas": {
      "main": [
        [
          {
            "node": "Edit Fields",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Edit Fields": {
      "main": [
        [
          {
            "node": "Switch",
            "type": "main",
            "index": 0
          },
          {
            "node": "HTTP Request2",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Switch": {
      "main": [
        [
          {
            "node": "HTTP Request1",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Redis",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "HTTP Request1": {
      "main": [
        []
      ]
    },
    "Redis": {
      "main": [
        [
          {
            "node": "If",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "If": {
      "main": [
        [
          {
            "node": "HTTP Request",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "createdAt": "2025-06-28T03:56:00.201Z",
  "id": "qTegUvgittjSnDRc",
  "isArchived": false,
  "meta": null,
  "name": "Techno Gas",
  "nodes": [
    {
      "parameters": {
        "httpMethod": "POST",
        "path": "es-wa",
        "options": {}
      },
      "type": "n8n-nodes-base.webhook",
      "typeVersion": 2,
      "position": [
        -320,
        -80
      ],
      "id": "0ddced40-5f5b-40a4-ad6e-510e83eeb242",
      "name": "TechnoGas"
    },
    {
      "parameters": {
        "assignments": {
          "assignments": [
            {
              "id": "a5c6018a-4c67-4407-85e8-68aff5c67dc8",
              "name": "instance-key",
              "value": "={{ $json.headers[\"instance-key\"] }}",
              "type": "string"
            },
            {
              "id": "68fde312-8efc-46c7-aca9-3e58eadbce04",
              "name": "=type",
              "value": "={{ $json.body.type }}",
              "type": "string"
            },
            {
              "id": "d8566b0a-f2e4-4586-904e-ac76ea9db70d",
              "name": "id",
              "value": "={{ $json?.body?.data[\"0\"]?.id || $json.body.data.key.id }}",
              "type": "string"
            },
            {
              "id": "bfe85be5-748a-485d-9e24-a50eb3d6de22",
              "name": "chatId",
              "value": "={{ $json?.body?.data['0']?.chatId || $json.body.data.key.remoteJid }}",
              "type": "string"
            },
            {
              "id": "14baf8c4-80ee-442a-9f9b-930de1b3f8de",
              "name": "={{ $json.body.data.messageType }}",
              "value": "=conversation",
              "type": "string"
            },
            {
              "id": "75d77ca4-a8a3-4aee-bdd2-c77acc0f14c9",
              "name": "chatid",
              "value": "={{ $json.body.data[\"0\"].chatId }}",
              "type": "string"
            },
            {
              "id": "e111caba-ef09-4b40-a1b3-1c29475e26f1",
              "name": "msg",
              "value": "\u26a1 TECHNO GAS \u26a1\n\n\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\n\n\ud83c\udf10 TIENDA 100% DIGITAL\n\n\ud83d\udcf2 WhatsApp Only\n\n\ud83d\ude80 DELIVERY EXPRESS\n\u2514\u2500 \ud83c\udfd6\ufe0f Toda la costa atl\u00e1ntica\n   \ud83d\udee0\ufe0f CAT\u00c1LOGO:\n    \u251c\u2500 \ud83d\udd25 Sistemas de encendido\n    \u251c\u2500 \ud83d\udca7 Repuestos para calefones\n    \u251c\u2500 \ud83d\udd27 Accesorios para gas\n    \u2514\u2500 \ud83d\udce6 Stock variable \n\n\u23f0 24/7 | 365 d\u00edas\n\ud83d\udcaf Calidad garantizada\n\ud83d\udeab Sin llamadas telef\u00f3nicas\n\ud83d\udcac Tu consulta \ud83d\udc47",
              "type": "string"
            }
          ]
        },
        "options": {}
      },
      "type": "n8n-nodes-base.set",
      "typeVersion": 3.4,
      "position": [
        -100,
        -80
      ],
      "id": "c1a19324-9716-4944-8239-247823e16226",
      "name": "Edit Fields"
    },
    {
      "parameters": {
        "rules": {
          "values": [
            {
              "conditions": {
                "options": {
                  "caseSensitive": true,
                  "leftValue": "",
                  "typeValidation": "strict",
                  "version": 2
                },
                "conditions": [
                  {
                    "leftValue": "={{ $json.type }}",
                    "rightValue": "call",
                    "operator": {
                      "type": "string",
                      "operation": "equals"
                    },
                    "id": "0dc28710-36fa-4b53-9f10-07cbfb7cb584"
                  }
                ],
                "combinator": "and"
              }
            },
            {
              "conditions": {
                "options": {
                  "caseSensitive": true,
                  "leftValue": "",
                  "typeValidation": "strict",
                  "version": 2
                },
                "conditions": [
                  {
                    "id": "d0a6c2f0-b239-4df0-b0ff-3471c569d599",
                    "leftValue": "={{ $json.type }}",
                    "rightValue": "message",
                    "operator": {
                      "type": "string",
                      "operation": "equals",
                      "name": "filter.operator.equals"
                    }
                  }
                ],
                "combinator": "and"
              }
            }
          ]
        },
        "options": {}
      },
      "type": "n8n-nodes-base.switch",
      "typeVersion": 3.2,
      "position": [
        100,
        160
      ],
      "id": "b24270e6-2999-4b5e-b5c0-3ac930aa4d5a",
      "name": "Switch"
    },
    {
      "parameters": {
        "method": "POST",
        "url": "https://us.api-wa.me/2522xe636258b15/message/text",
        "sendHeaders": true,
        "headerParameters": {
          "parameters": [
            {
              "name": "accept",
              "value": "*/*"
            },
            {
              "name": "Content-Type",
              "value": "application/json"
            }
          ]
        },
        "sendBody": true,
        "bodyParameters": {
          "parameters": [
            {
              "name": "to",
              "value": "={{ $json.chatId }}"
            },
            {
              "name": "text",
              "value": "=\ud83d\udd34 IMPORTANTE \ud83d\udd34\n\n\u274c LLAMADAS NO DISPONIBLES \u274c\n\n\u2705 Solo mensajes de texto\n\n\ud83d\udce9 Respuesta garantizada\n\n\ud83d\udea8 Si es urgente, escriba #urgente en su mensaje"
            }
          ]
        },
        "options": {}
      },
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        300,
        -40
      ],
      "id": "ed134e5b-3370-4107-8187-27913a078be2",
      "name": "HTTP Request1"
    },
    {
      "parameters": {
        "method": "POST",
        "url": "https://us.api-wa.me/2522xe636258b15/message/text",
        "sendHeaders": true,
        "headerParameters": {
          "parameters": [
            {
              "name": "accept",
              "value": "*/*"
            }
          ]
        },
        "sendBody": true,
        "bodyParameters": {
          "parameters": [
            {
              "name": "to",
              "value": "={{ $('Switch').item.json.chatId }}"
            },
            {
              "name": "text",
              "value": "={{ $('Edit Fields').item.json.msg }}"
            }
          ]
        },
        "options": {}
      },
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        780,
        120
      ],
      "id": "f13e4d95-d76a-40fe-97fb-590b36479aec",
      "name": "HTTP Request"
    },
    {
      "parameters": {
        "operation": "incr",
        "key": "=numero:{{ $json.chatId }}",
        "expire": true,
        "ttl": 3600
      },
      "type": "n8n-nodes-base.redis",
      "typeVersion": 1,
      "position": [
        320,
        300
      ],
      "id": "08dd51cb-09a4-4ee6-901a-54b0a4775cce",
      "name": "Redis",
      "credentials": {
        "redis": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "conditions": {
          "options": {
            "caseSensitive": true,
            "leftValue": "",
            "typeValidation": "strict",
            "version": 2
          },
          "conditions": [
            {
              "id": "6b196db5-e8ba-412e-94cf-614a043047d3",
              "leftValue": "={{ $json[\"numero:5492254423359@s.whatsapp.net\"] }}",
              "rightValue": 1,
              "operator": {
                "type": "number",
                "operation": "equals"
              }
            }
          ],
          "combinator": "and"
        },
        "options": {}
      },
      "type": "n8n-nodes-base.if",
      "typeVersion": 2.2,
      "position": [
        580,
        300
      ],
      "id": "ecaf421d-e53c-49b4-8d6d-765ecf9664af",
      "name": "If"
    },
    {
      "parameters": {
        "url": "https://us.api-wa.me/2522xe636258b15/business/catalog",
        "sendHeaders": true,
        "headerParameters": {
          "parameters": [
            {
              "name": "accept",
              "value": "*/*"
            }
          ]
        },
        "options": {}
      },
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        260,
        -320
      ],
      "id": "5df7477a-7a4f-4e09-9b8b-076e90bcf145",
      "name": "HTTP Request2"
    }
  ],
  "settings": {
    "executionOrder": "v1",
    "errorWorkflow": "2kOn0Oz7c2uvczPK"
  },
  "staticData": null,
  "tags": [],
  "triggerCount": 0,
  "updatedAt": "2025-06-28T04:15:25.052Z",
  "versionId": "7a69cd93-8964-4b4a-9d7c-91b88642a4a7"
}