{
  "name": "Fila do dia",
  "nodes": [
    {
      "parameters": {
        "content": "## Plano B do Exercício 2\n\nNos três nós Data Table (Buscar os novos, Marcar prioridade, Marcar fila), escolha a tabela **pedidos** em Data table. Confira Settings, Timezone America/Sao Paulo. Depois: Execute workflow e abra a tabela em Overview, aba Data tables.",
        "width": 520,
        "height": 200
      },
      "id": "92a22db9-37d9-49f1-960f-bd2034e94750",
      "name": "Nota 6b08",
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        -40,
        -260
      ]
    },
    {
      "parameters": {
        "rule": {
          "interval": [
            {
              "field": "days",
              "triggerAtHour": 8
            }
          ]
        }
      },
      "id": "37cc4037-5a50-4b70-8875-17bd391fdb29",
      "name": "Todo dia às 8h",
      "type": "n8n-nodes-base.scheduleTrigger",
      "typeVersion": 1.2,
      "position": [
        0,
        0
      ]
    },
    {
      "parameters": {
        "operation": "get",
        "dataTableId": {
          "__rl": true,
          "mode": "list",
          "value": "",
          "cachedResultName": "pedidos"
        },
        "filters": {
          "conditions": [
            {
              "keyName": "status",
              "condition": "eq",
              "keyValue": "novo"
            }
          ]
        },
        "options": {}
      },
      "id": "109ec4be-d84d-4404-b846-ecd1e19cfb81",
      "name": "Buscar os novos",
      "type": "n8n-nodes-base.dataTable",
      "typeVersion": 1.1,
      "position": [
        260,
        0
      ]
    },
    {
      "parameters": {
        "conditions": {
          "options": {
            "caseSensitive": true,
            "leftValue": "",
            "typeValidation": "strict",
            "version": 2
          },
          "conditions": [
            {
              "id": "d1b5ace8-4213-4def-90f9-4bd1932a3c8b",
              "leftValue": "={{ $json.tipo }}",
              "rightValue": "Reclamação",
              "operator": {
                "type": "string",
                "operation": "equals"
              }
            }
          ],
          "combinator": "and"
        },
        "options": {}
      },
      "id": "17225e70-a846-4b7c-8011-0152cc0e5875",
      "name": "É reclamação?",
      "type": "n8n-nodes-base.if",
      "typeVersion": 2.2,
      "position": [
        520,
        0
      ]
    },
    {
      "parameters": {
        "operation": "update",
        "dataTableId": {
          "__rl": true,
          "mode": "list",
          "value": "",
          "cachedResultName": "pedidos"
        },
        "filters": {
          "conditions": [
            {
              "keyName": "protocolo",
              "condition": "eq",
              "keyValue": "={{ $json.protocolo }}"
            }
          ]
        },
        "columns": {
          "mappingMode": "defineBelow",
          "value": {
            "status": "prioridade"
          },
          "matchingColumns": [],
          "schema": [
            {
              "id": "status",
              "displayName": "status",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            }
          ]
        },
        "options": {}
      },
      "id": "2c0f3a0e-ffb3-4b86-9586-c8477be58149",
      "name": "Marcar prioridade",
      "type": "n8n-nodes-base.dataTable",
      "typeVersion": 1.1,
      "position": [
        800,
        -120
      ]
    },
    {
      "parameters": {
        "operation": "update",
        "dataTableId": {
          "__rl": true,
          "mode": "list",
          "value": "",
          "cachedResultName": "pedidos"
        },
        "filters": {
          "conditions": [
            {
              "keyName": "protocolo",
              "condition": "eq",
              "keyValue": "={{ $json.protocolo }}"
            }
          ]
        },
        "columns": {
          "mappingMode": "defineBelow",
          "value": {
            "status": "fila"
          },
          "matchingColumns": [],
          "schema": [
            {
              "id": "status",
              "displayName": "status",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            }
          ]
        },
        "options": {}
      },
      "id": "c3825507-ced5-448e-a9cd-2879f1c2070e",
      "name": "Marcar fila",
      "type": "n8n-nodes-base.dataTable",
      "typeVersion": 1.1,
      "position": [
        800,
        140
      ]
    }
  ],
  "connections": {
    "Todo dia às 8h": {
      "main": [
        [
          {
            "node": "Buscar os novos",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Buscar os novos": {
      "main": [
        [
          {
            "node": "É reclamação?",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "É reclamação?": {
      "main": [
        [
          {
            "node": "Marcar prioridade",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Marcar fila",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "settings": {
    "executionOrder": "v1",
    "timezone": "America/Sao_Paulo"
  },
  "pinData": {}
}