{
  "id": "AI5Qr4OI3Bpdn5m8",
  "createdAt": "2023-07-13T03:35:14.983Z",
  "updatedAt": "2023-08-17T17:07:19.485Z",
  "name": "[eliminado] Actualizar asignaciones en loans",
  "active": false,
  "nodes": [
    {
      "parameters": {
        "rule": {
          "interval": [
            {
              "field": "cronExpression",
              "expression": "41 * * * *"
            }
          ]
        }
      },
      "id": "2275b687-4417-4bbf-8c24-730e6a88c8b1",
      "name": "Schedule Trigger",
      "type": "n8n-nodes-base.scheduleTrigger",
      "position": [
        540,
        460
      ],
      "typeVersion": 1
    },
    {
      "parameters": {
        "authentication": "serviceAccount",
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "12-DYz4hra812PE0NvF9Mi6-C6Gkc1KJdP7Vo8vyukPE",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/12-DYz4hra812PE0NvF9Mi6-C6Gkc1KJdP7Vo8vyukPE/edit?usp=drivesdk",
          "cachedResultName": "Asignaciones Prontopago"
        },
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": 353930098,
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/12-DYz4hra812PE0NvF9Mi6-C6Gkc1KJdP7Vo8vyukPE/edit#gid=353930098",
          "cachedResultName": "Hoja 1"
        },
        "options": {}
      },
      "id": "d14c3d82-b2ea-40aa-b284-860564c35630",
      "name": "Google Sheets",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        760,
        460
      ],
      "typeVersion": 3,
      "credentials": {
        "googleApi": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "keepOnlySet": true,
        "values": {
          "string": [
            {
              "name": "rut",
              "value": "={{ String($json.enterprise_document_number) }}"
            },
            {
              "name": "ejecutivo",
              "value": "={{ String($json['propietario hs']) }}"
            }
          ]
        },
        "options": {}
      },
      "id": "0d28192b-f7da-4288-bf14-26398fdf6bf7",
      "name": "Set",
      "type": "n8n-nodes-base.set",
      "position": [
        980,
        460
      ],
      "typeVersion": 2
    },
    {
      "parameters": {
        "operation": "removeDuplicates"
      },
      "id": "446d3959-a55d-456a-8a71-75dec52782c7",
      "name": "Item Lists",
      "type": "n8n-nodes-base.itemLists",
      "position": [
        1200,
        460
      ],
      "typeVersion": 2.1
    },
    {
      "parameters": {
        "operation": "executeQuery",
        "query": "update api_loan_common.loan_requests_loanrequest lr set lr.representative_id = (select id from api_registry_common.core_user where email = $1) where lr.requester_id = (select id from api_loan_common.core_enterprise where document_number = $2) and lr.created_at between  DATE_ADD(DATE_SUB(LAST_DAY(CURDATE()), INTERVAL 2 MONTH ), INTERVAL 1 DAY) and LAST_DAY(CURDATE());\n",
        "options": {
          "queryReplacement": "={{ $json.ejecutivo }}, {{ $json.rut }}"
        }
      },
      "id": "46490e43-d60a-4685-a8bd-15bd5ef8d2d7",
      "name": "MySQL1",
      "type": "n8n-nodes-base.mySql",
      "position": [
        1440,
        460
      ],
      "typeVersion": 2.1,
      "credentials": {
        "mySql": {
          "name": "<your credential>"
        }
      }
    }
  ],
  "connections": {
    "Set": {
      "main": [
        [
          {
            "node": "Item Lists",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Item Lists": {
      "main": [
        [
          {
            "node": "MySQL1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Google Sheets": {
      "main": [
        [
          {
            "node": "Set",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Schedule Trigger": {
      "main": [
        [
          {
            "node": "Google Sheets",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "settings": {},
  "staticData": null,
  "versionId": "92322b6b-c20d-40eb-aef5-d8262aca265d",
  "triggerCount": 0,
  "tags": []
}