{
  "name": "Classificar inbox com IA",
  "nodes": [
    {
      "parameters": {
        "pollTimes": {
          "item": [
            {
              "mode": "everyMinute"
            }
          ]
        },
        "simple": true,
        "filters": {},
        "options": {}
      },
      "id": "344e4eca-a712-407c-ade7-4a4b0d2f2536",
      "name": "Novo email",
      "type": "n8n-nodes-base.gmailTrigger",
      "typeVersion": 1.2,
      "position": [
        0,
        0
      ]
    },
    {
      "parameters": {
        "inputText": "={{ $json.Subject }}\n\n{{ $json.snippet }}",
        "categories": {
          "categories": [
            {
              "category": "Orçamento",
              "description": "Pedido de preço, proposta ou orçamento"
            },
            {
              "category": "Suporte",
              "description": "Cliente com problema ou dúvida"
            },
            {
              "category": "Fatura",
              "description": "Fatura, recibo ou nota de pagamento"
            },
            {
              "category": "Outro",
              "description": "Newsletters, publicidade e restantes"
            }
          ]
        },
        "options": {}
      },
      "id": "3e6eadc7-ee5a-4907-b8b7-c28a165eb260",
      "name": "Classificar",
      "type": "@n8n/n8n-nodes-langchain.textClassifier",
      "typeVersion": 1,
      "position": [
        240,
        0
      ]
    },
    {
      "parameters": {
        "model": "gpt-4o-mini",
        "options": {}
      },
      "id": "ccae4e22-cfc0-451b-b213-43faaad3c773",
      "name": "Modelo OpenAI",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "typeVersion": 1,
      "position": [
        240,
        220
      ]
    },
    {
      "parameters": {
        "operation": "addLabels",
        "messageId": "={{ $('Novo email').item.json.id }}",
        "labelIds": [
          "ETIQUETA_ORÇAMENTO"
        ]
      },
      "id": "9b35c52e-df85-45af-af31-acafe5a49120",
      "name": "Etiqueta Orçamento",
      "type": "n8n-nodes-base.gmail",
      "typeVersion": 2.1,
      "position": [
        480,
        -160
      ]
    },
    {
      "parameters": {
        "operation": "addLabels",
        "messageId": "={{ $('Novo email').item.json.id }}",
        "labelIds": [
          "ETIQUETA_SUPORTE"
        ]
      },
      "id": "f8a1d63d-a32e-4246-8dc6-4902d767d8d9",
      "name": "Etiqueta Suporte",
      "type": "n8n-nodes-base.gmail",
      "typeVersion": 2.1,
      "position": [
        480,
        0
      ]
    },
    {
      "parameters": {
        "operation": "addLabels",
        "messageId": "={{ $('Novo email').item.json.id }}",
        "labelIds": [
          "ETIQUETA_FATURA"
        ]
      },
      "id": "7c6621ba-b1a6-4494-9ddb-df68ff45983b",
      "name": "Etiqueta Fatura",
      "type": "n8n-nodes-base.gmail",
      "typeVersion": 2.1,
      "position": [
        480,
        160
      ]
    },
    {
      "parameters": {
        "operation": "addLabels",
        "messageId": "={{ $('Novo email').item.json.id }}",
        "labelIds": [
          "ETIQUETA_OUTRO"
        ]
      },
      "id": "8623f50a-cc8b-48c9-85c6-e4d668db1fbf",
      "name": "Etiqueta Outro",
      "type": "n8n-nodes-base.gmail",
      "typeVersion": 2.1,
      "position": [
        480,
        320
      ]
    }
  ],
  "connections": {
    "Modelo OpenAI": {
      "ai_languageModel": [
        [
          {
            "node": "Classificar",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Novo email": {
      "main": [
        [
          {
            "node": "Classificar",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Classificar": {
      "main": [
        [
          {
            "node": "Etiqueta Orçamento",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Etiqueta Suporte",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Etiqueta Fatura",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Etiqueta Outro",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "active": false,
  "settings": {
    "executionOrder": "v1",
    "timezone": "Europe/Lisbon"
  },
  "pinData": {},
  "meta": {
    "templateCredsSetupCompleted": false,
    "source": "ferramentasia"
  },
  "tags": []
}