{
  "name": "Bunge - Incidentes de Racks para WhatsApp",
  "nodes": [
    {
      "parameters": {
        "httpMethod": "POST",
        "path": "bunge-racks-incidente"
      },
      "name": "Webhook Entrada",
      "type": "n8n-nodes-base.webhook",
      "typeVersion": 1,
      "position": [
        260,
        300
      ]
    },
    {
      "parameters": {
        "functionCode": "const body = $json.body || $json; \nreturn [{ json: { destino: $env.WHATSAPP_DESTINATION || '+5581999999999', mensagem: `Bunge TI - nova ocorrência\\nRef: ${body.ref_type} ${body.ref_id}\\nTítulo: ${body.title}\\nTécnico: ${body.technician || 'N/D'}\\nDescrição: ${body.description}` } }];"
      },
      "name": "Formatar Mensagem",
      "type": "n8n-nodes-base.function",
      "typeVersion": 1,
      "position": [
        520,
        300
      ]
    },
    {
      "parameters": {
        "requestMethod": "POST",
        "url": "https://SEU_PROVEDOR_WHATSAPP/send",
        "jsonParameters": true,
        "bodyParametersJson": "={\"to\": $json.destino, \"message\": $json.mensagem}"
      },
      "name": "Enviar WhatsApp",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4,
      "position": [
        800,
        300
      ]
    }
  ],
  "connections": {
    "Webhook Entrada": {
      "main": [
        [
          {
            "node": "Formatar Mensagem",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Formatar Mensagem": {
      "main": [
        [
          {
            "node": "Enviar WhatsApp",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}