{
  "id": "RjPTrQHVBJZQJIlr",
  "createdAt": "2023-08-07T22:46:24.202Z",
  "updatedAt": "2024-01-31T21:00:15.701Z",
  "name": "Base Comite a DW",
  "active": true,
  "nodes": [
    {
      "parameters": {
        "keepOnlySet": true,
        "values": {
          "string": [
            {
              "name": "operation_id",
              "value": "={{ $json['id operaci\u00f3n'] }}"
            },
            {
              "name": "condition_date",
              "value": "={{ $json['Fecha comit\u00e9'] }}"
            },
            {
              "name": "comments",
              "value": "={{ $json['Condici\u00f3n comit\u00e9'] }}"
            },
            {
              "name": "platform",
              "value": "={{ $json.plataforma }}"
            }
          ]
        },
        "options": {}
      },
      "id": "661bccce-ede0-4ca4-98ca-e49b133be8f8",
      "name": "Set1",
      "type": "n8n-nodes-base.set",
      "position": [
        540,
        200
      ],
      "typeVersion": 2
    },
    {
      "parameters": {
        "conditions": {
          "boolean": [
            {
              "value1": "={{ $json.operation_id }}",
              "operation": "notEqual",
              "value2": "={{ '' }}"
            }
          ]
        }
      },
      "id": "106c6d48-0e36-4873-ace7-8063277285ee",
      "name": "Filter1",
      "type": "n8n-nodes-base.filter",
      "position": [
        720,
        200
      ],
      "typeVersion": 1
    },
    {
      "parameters": {
        "operation": "executeQuery",
        "query": "=insert into committee_conditions (operation_id, comments, condition_date, platform)\nvalues ({{ $json[\"operation_id\"] }},'{{ $json[\"comments\"] }}','{{ $json[\"condition_date\"] }}', '{{ $json[\"platform\"] }}')\non duplicate key update comments = '{{ $json[\"comments\"] }}', condition_date = '{{ $json[\"condition_date\"] }}', platform = '{{ $json[\"platform\"] }}'",
        "options": {}
      },
      "id": "36b3a6ac-9bd3-4564-9404-23e81fd927fa",
      "name": "MySQL5",
      "type": "n8n-nodes-base.mySql",
      "position": [
        960,
        200
      ],
      "typeVersion": 2.1,
      "credentials": {
        "mySql": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "pollTimes": {
          "item": [
            {
              "hour": 18
            }
          ]
        },
        "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": 1052543507,
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1gfL6x1A6n2lbKuqaNrj-44lKxyX3HOLXtfoLcFONl6E/edit#gid=1052543507",
          "cachedResultName": "Comit\u00e9"
        },
        "options": {}
      },
      "id": "f9aadf88-5761-454b-9660-41e01163fe6a",
      "name": "Llamar Comit\u00e9",
      "type": "n8n-nodes-base.googleSheetsTrigger",
      "position": [
        120,
        200
      ],
      "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  //const moment = require('moment');\n  //const numero = items[0].json['Fecha comit\u00e9'];\n  //const fechaFormateada = moment(numero).format('YYYY-MM-DD');\n  //const fecha = new Date(numero);\n  //items[0].json['Fecha comit\u00e9'] = fechaFormateada;\n  //item.json['Fecha comit\u00e9'] = fecha;\n}\n  return $input.all();"
      },
      "id": "d2acdd44-00d5-4c50-82ad-003a07536b1a",
      "name": "Code1",
      "type": "n8n-nodes-base.code",
      "position": [
        360,
        200
      ],
      "typeVersion": 1
    }
  ],
  "connections": {
    "Set1": {
      "main": [
        [
          {
            "node": "Filter1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Filter1": {
      "main": [
        [
          {
            "node": "MySQL5",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Llamar Comit\u00e9": {
      "main": [
        [
          {
            "node": "Code1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Code1": {
      "main": [
        [
          {
            "node": "Set1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "settings": {},
  "staticData": {
    "node:Llamar Post-confirmado": {
      "documentId": "1gfL6x1A6n2lbKuqaNrj-44lKxyX3HOLXtfoLcFONl6E",
      "sheetId": 394331852,
      "lastRevision": 5706,
      "lastRevisionLink": "https://docs.google.com/spreadsheets/export?id=1gfL6x1A6n2lbKuqaNrj-44lKxyX3HOLXtfoLcFONl6E&revision=5706&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": 5706,
      "lastRevisionLink": "https://docs.google.com/spreadsheets/export?id=1gfL6x1A6n2lbKuqaNrj-44lKxyX3HOLXtfoLcFONl6E&revision=5706&exportFormat=xlsx"
    },
    "node:Llamar Comit\u00e9": {
      "documentId": "1gfL6x1A6n2lbKuqaNrj-44lKxyX3HOLXtfoLcFONl6E",
      "sheetId": 1052543507,
      "lastRevision": 10338,
      "lastRevisionLink": "https://docs.google.com/spreadsheets/export?id=1gfL6x1A6n2lbKuqaNrj-44lKxyX3HOLXtfoLcFONl6E&revision=10338&exportFormat=xlsx"
    },
    "node:Llamar Lista Pagadores": {
      "documentId": "1gfL6x1A6n2lbKuqaNrj-44lKxyX3HOLXtfoLcFONl6E",
      "sheetId": 924696945,
      "lastRevision": 5706,
      "lastRevisionLink": "https://docs.google.com/spreadsheets/export?id=1gfL6x1A6n2lbKuqaNrj-44lKxyX3HOLXtfoLcFONl6E&revision=5706&exportFormat=xlsx"
    }
  },
  "versionId": "40d1c483-708b-4674-ac6d-03547566f802",
  "triggerCount": 1,
  "tags": []
}