{
  "name": "EcoCloud",
  "nodes": [
    {
      "parameters": {
        "httpMethod": "POST",
        "path": "aws-finops-alert",
        "options": {}
      },
      "type": "n8n-nodes-base.webhook",
      "typeVersion": 2,
      "position": [
        0,
        0
      ],
      "id": "713ee621-fafb-4a64-b5b9-6aa05c9660d1",
      "name": "Webhook"
    },
    {
      "parameters": {
        "conditions": {
          "options": {
            "caseSensitive": true,
            "leftValue": "",
            "typeValidation": "strict",
            "version": 2
          },
          "conditions": [
            {
              "id": "ff3d8ae5-eab2-46bf-aaf1-74979c1f6573",
              "leftValue": "={{ $json.body.total_economia }}",
              "rightValue": 0,
              "operator": {
                "type": "number",
                "operation": "gt"
              }
            }
          ],
          "combinator": "and"
        },
        "options": {}
      },
      "type": "n8n-nodes-base.if",
      "typeVersion": 2.2,
      "position": [
        220,
        0
      ],
      "id": "ffc477b0-807b-4555-8f7e-a7141e68a187",
      "name": "If"
    },
    {
      "parameters": {
        "resource": "message",
        "guildId": {
          "__rl": true,
          "value": "1467932350322311433",
          "mode": "id"
        },
        "channelId": {
          "__rl": true,
          "value": "1467932353132499129",
          "mode": "id"
        },
        "content": "=\u26a0\ufe0f Novo alerta de recursos ociosos detectado!\n {{ $('Webhook').item.json.body.analise_ia }}",
        "options": {},
        "embeds": {
          "values": [
            {
              "description": "=\ud83d\udccd **Regi\u00e3o:** {{ $('Webhook').item.json.body.region }}\n\ud83d\udcb0 **Economia:** $ {{ $json.body.total_economia.toFixed(2) }} /m\u00eas\n\ud83d\udce6 **Volumes EBS:** {{ $json.body.volumes.length }} unidade(s)\n\ud83c\udf10 **IPs El\u00e1sticos:** {{ $json.body.ips.length }} unidade(s)\n\n---\n\u26a0\ufe0f **A\u00e7\u00e3o Necess\u00e1ria:**\nPara autorizar a limpeza autom\u00e1tica desses recursos, clique no link abaixo:\n\ud83d\udd17 {{ $execution.resumeUrl }}"
            }
          ]
        }
      },
      "type": "n8n-nodes-base.discord",
      "typeVersion": 2,
      "position": [
        480,
        -240
      ],
      "id": "9ed66af2-107f-4d80-9a94-bc97ab5b9a0e",
      "name": "Discord",
      "credentials": {
        "discordBotApi": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "method": "POST",
        "url": "http://host.docker.internal:8000/clean",
        "sendBody": true,
        "specifyBody": "json",
        "jsonBody": "={{ $('Webhook').item.json.body }}",
        "options": {}
      },
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        740,
        -60
      ],
      "id": "4940e1c3-46e6-478b-bd4d-5eb0d0cc94a1",
      "name": "HTTP Request"
    },
    {
      "parameters": {
        "resume": "webhook",
        "options": {}
      },
      "type": "n8n-nodes-base.wait",
      "typeVersion": 1.1,
      "position": [
        480,
        -60
      ],
      "id": "60b313f6-8efb-40e9-9d81-beeb62a98734",
      "name": "Wait"
    }
  ],
  "connections": {
    "Webhook": {
      "main": [
        [
          {
            "node": "If",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "If": {
      "main": [
        [
          {
            "node": "Wait",
            "type": "main",
            "index": 0
          },
          {
            "node": "Discord",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Discord": {
      "main": [
        []
      ]
    },
    "Wait": {
      "main": [
        [
          {
            "node": "HTTP Request",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "active": false,
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "edb77ae6-8b01-4ebc-bd8d-a051d74c3107",
  "meta": {
    "templateCredsSetupCompleted": true
  },
  "id": "q0QYgEyiqdgLQJA0",
  "tags": []
}