{
  "id": "PCcENKX5QoMa0e6P",
  "createdAt": "2023-08-07T22:51:59.186Z",
  "updatedAt": "2023-08-07T22:52:39.484Z",
  "name": "Base Grupos Economicos a DW",
  "active": false,
  "nodes": [
    {
      "parameters": {
        "conditions": {
          "boolean": [
            {
              "value1": "={{ $json.document_number }}",
              "operation": "notEqual",
              "value2": "={{ '' }}"
            }
          ]
        }
      },
      "id": "eca4de2c-2c25-41c8-b354-3fdf4017eb0e",
      "name": "Filter5",
      "type": "n8n-nodes-base.filter",
      "position": [
        680,
        380
      ],
      "typeVersion": 1
    },
    {
      "parameters": {
        "keepOnlySet": true,
        "values": {
          "string": [
            {
              "name": "document_number",
              "value": "={{ $json.Rut }}"
            },
            {
              "name": "economic_group",
              "value": "={{ $json['Grupo econ\u00f3mico'] }}"
            }
          ]
        },
        "options": {}
      },
      "id": "742e5cdd-87b2-4670-8af6-409db711c49d",
      "name": "Set5",
      "type": "n8n-nodes-base.set",
      "position": [
        500,
        380
      ],
      "typeVersion": 2
    },
    {
      "parameters": {
        "operation": "executeQuery",
        "query": "=insert into enterprise_economic_group (document_number, economic_group)\nvalues ('{{ $json[\"document_number\"] }}','{{ $json[\"economic_group\"] }}')\non duplicate key update economic_group = '{{ $json[\"economic_group\"] }}'",
        "options": {}
      },
      "id": "1e9248f9-a63b-4e88-bfa5-8e60ea30074e",
      "name": "MySQL1",
      "type": "n8n-nodes-base.mySql",
      "position": [
        1040,
        380
      ],
      "typeVersion": 2.1,
      "credentials": {
        "mySql": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "pollTimes": {
          "item": [
            {
              "mode": "everyWeek",
              "hour": 10
            }
          ]
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "1gfL6x1A6n2lbKuqaNrj-44lKxyX3HOLXtfoLcFONl6E",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1gfL6x1A6n2lbKuqaNrj-44lKxyX3HOLXtfoLcFONl6E/edit?usp=drivesdk",
          "cachedResultName": "CL Panel de Riesgo"
        },
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": 924453781,
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1gfL6x1A6n2lbKuqaNrj-44lKxyX3HOLXtfoLcFONl6E/edit#gid=924453781",
          "cachedResultName": "Grupos econ\u00f3micos"
        },
        "options": {}
      },
      "id": "7b0fc7c6-4d5b-4c7f-8ba5-27658c3dba9b",
      "name": "Llamar Grupos econ\u00f3micos",
      "type": "n8n-nodes-base.googleSheetsTrigger",
      "position": [
        -20,
        380
      ],
      "typeVersion": 1,
      "credentials": {
        "googleSheetsTriggerOAuth2Api": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "jsCode": "// Loop over input items and add a new field called 'myNewField' to the JSON of each one\nfor (const item of $input.all()) {\n  item.json.Rut = item.json.Rut.toString().replace('k', 'K').replace(/[-.]/g, '');\n\n}\n  return $input.all();"
      },
      "id": "064235e4-e9f7-4cee-b3f0-e4f5e381c8d0",
      "name": "Code5",
      "type": "n8n-nodes-base.code",
      "position": [
        320,
        380
      ],
      "typeVersion": 1
    }
  ],
  "connections": {
    "Set5": {
      "main": [
        [
          {
            "node": "Filter5",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Filter5": {
      "main": [
        [
          {
            "node": "MySQL1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Code5": {
      "main": [
        [
          {
            "node": "Set5",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Llamar Grupos econ\u00f3micos": {
      "main": [
        [
          {
            "node": "Code5",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "settings": {},
  "staticData": {
    "node:Llamar Post-confirmado": {
      "documentId": "1gfL6x1A6n2lbKuqaNrj-44lKxyX3HOLXtfoLcFONl6E",
      "sheetId": 394331852,
      "lastRevision": 5704,
      "lastRevisionLink": "https://docs.google.com/spreadsheets/export?id=1gfL6x1A6n2lbKuqaNrj-44lKxyX3HOLXtfoLcFONl6E&revision=5704&exportFormat=xlsx"
    },
    "node:Llamar Lista Link": {
      "documentId": "1gfL6x1A6n2lbKuqaNrj-44lKxyX3HOLXtfoLcFONl6E",
      "sheetId": 1713282289,
      "lastRevision": 5706,
      "lastRevisionLink": "https://docs.google.com/spreadsheets/export?id=1gfL6x1A6n2lbKuqaNrj-44lKxyX3HOLXtfoLcFONl6E&revision=5706&exportFormat=xlsx"
    },
    "node:Llamar Grupos econ\u00f3micos": {
      "documentId": "1gfL6x1A6n2lbKuqaNrj-44lKxyX3HOLXtfoLcFONl6E",
      "sheetId": 924453781,
      "lastRevision": 5706,
      "lastRevisionLink": "https://docs.google.com/spreadsheets/export?id=1gfL6x1A6n2lbKuqaNrj-44lKxyX3HOLXtfoLcFONl6E&revision=5706&exportFormat=xlsx"
    },
    "node:Llamar Bloqueados": {
      "documentId": "1gfL6x1A6n2lbKuqaNrj-44lKxyX3HOLXtfoLcFONl6E",
      "sheetId": 940588543,
      "lastRevision": 5707,
      "lastRevisionLink": "https://docs.google.com/spreadsheets/export?id=1gfL6x1A6n2lbKuqaNrj-44lKxyX3HOLXtfoLcFONl6E&revision=5707&exportFormat=xlsx"
    },
    "node:Llamar Comit\u00e9": {
      "documentId": "1gfL6x1A6n2lbKuqaNrj-44lKxyX3HOLXtfoLcFONl6E",
      "sheetId": 1052543507,
      "lastRevision": 5278,
      "lastRevisionLink": "https://docs.google.com/spreadsheets/export?id=1gfL6x1A6n2lbKuqaNrj-44lKxyX3HOLXtfoLcFONl6E&revision=5278&exportFormat=xlsx"
    },
    "node:Llamar Lista Pagadores": {
      "documentId": "1gfL6x1A6n2lbKuqaNrj-44lKxyX3HOLXtfoLcFONl6E",
      "sheetId": 924696945,
      "lastRevision": 5275,
      "lastRevisionLink": "https://docs.google.com/spreadsheets/export?id=1gfL6x1A6n2lbKuqaNrj-44lKxyX3HOLXtfoLcFONl6E&revision=5275&exportFormat=xlsx"
    }
  },
  "versionId": "e40e459a-9990-448b-ac44-2fd927b1ea95",
  "triggerCount": 6,
  "tags": []
}