AutomationFlowsData & Sheets › Actualizar Asignaciones Kimchi

Actualizar Asignaciones Kimchi

Actualizar asignaciones Kimchi. Uses mySql. Scheduled trigger; 8 nodes.

Cron / scheduled trigger★★★★☆ complexity8 nodesMySQL
Data & Sheets Trigger: Cron / scheduled Nodes: 8 Complexity: ★★★★☆ Added:

The workflow JSON

Copy or download the full n8n JSON below. Paste it into a new n8n workflow, add your credentials, activate. Full import guide →

Download .json
{
  "id": "F4JTphX0XULuFHuM",
  "createdAt": "2023-12-07T01:33:02.817Z",
  "updatedAt": "2024-02-08T02:30:27.212Z",
  "name": "Actualizar asignaciones Kimchi",
  "active": true,
  "nodes": [
    {
      "parameters": {
        "operation": "executeQuery",
        "query": "select distinct upper(c.rut_proveedor) as enterprise_document_number, o.email as representative_email from hubspot.companies c left join hubspot.owners o on c.owner_id = o.id\nwhere rut_proveedor is not null\n#and rut_proveedor in (\n#'105084935')\n#limit 0,3000\n;",
        "options": {}
      },
      "id": "e7198fac-0e6f-48de-b6bf-f8d46a3da436",
      "name": "asignaciones en HS",
      "type": "n8n-nodes-base.mySql",
      "position": [
        2800,
        1080
      ],
      "typeVersion": 2.1,
      "credentials": {
        "mySql": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "mode": "combine",
        "mergeByFields": {
          "values": [
            {
              "field1": "representative_email",
              "field2": "representative_email"
            }
          ]
        },
        "options": {}
      },
      "id": "df4629b8-c81a-4d76-b135-6c0e0a9d0863",
      "name": "empresas con ejecutivos v\u00e1lidos",
      "type": "n8n-nodes-base.merge",
      "typeVersion": 2.1,
      "position": [
        3100,
        980
      ]
    },
    {
      "parameters": {
        "operation": "executeQuery",
        "query": "select core_user.id as representative_id,\n       core_user.email as representative_email\n\nfrom api_registry_common.core_user\n         inner join api_registry_common.core_profile\n                    on core_user.id = core_profile.user_id",
        "options": {}
      },
      "id": "9fbac161-c7d1-4a97-b3e1-fb7db39a7481",
      "name": "ejecutivos en registry",
      "type": "n8n-nodes-base.mySql",
      "typeVersion": 2.1,
      "position": [
        2800,
        880
      ],
      "credentials": {
        "mySql": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "mode": "combine",
        "mergeByFields": {
          "values": [
            {
              "field1": "enterprise_document_number",
              "field2": "enterprise_document_number"
            }
          ]
        },
        "options": {}
      },
      "id": "6f8285ff-bf92-474c-bc7e-3e15a0d8e0d6",
      "name": "asignaciones v\u00e1lidas",
      "type": "n8n-nodes-base.merge",
      "typeVersion": 2.1,
      "position": [
        3400,
        1100
      ]
    },
    {
      "parameters": {
        "operation": "executeQuery",
        "query": "update internal_requests_internalrequest ir \nset ir.representative_id = $1 \nwhere ir.requester_id = $2 \nand ir.created_at >= DATE_ADD(LAST_DAY(DATE_SUB(CURDATE(), INTERVAL 1 MONTH)), INTERVAL 1 DAY) and ir.created_at < DATE_ADD(LAST_DAY(CURDATE()), INTERVAL 1 DAY)\n",
        "options": {
          "queryReplacement": "={{ $json.representative_id }}, {{ $json.enterprise_id }}"
        }
      },
      "id": "33d9e906-a891-41c0-923f-1a40f130812e",
      "name": "update en financing",
      "type": "n8n-nodes-base.mySql",
      "typeVersion": 2.1,
      "position": [
        3880,
        980
      ],
      "credentials": {
        "mySql": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "operation": "executeQuery",
        "query": "update loan_requests_loanrequest lr\nset lr.representative_id = $1\nwhere lr.requester_id = $2\n  and lr.created_at >= DATE_ADD(LAST_DAY(DATE_SUB(CURDATE(), INTERVAL 1 MONTH)), INTERVAL 1 DAY) and lr.created_at < DATE_ADD(LAST_DAY(CURDATE()), INTERVAL 1 DAY)\n",
        "options": {
          "queryReplacement": "={{ $json.representative_id }}, {{ $json.enterprise_id }}"
        }
      },
      "id": "cbc730b5-9653-4199-be55-6c085566cb39",
      "name": "update en loans",
      "type": "n8n-nodes-base.mySql",
      "typeVersion": 2.1,
      "position": [
        3880,
        1220
      ],
      "credentials": {
        "mySql": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "rule": {
          "interval": [
            {
              "field": "hours",
              "triggerAtMinute": 40
            }
          ]
        }
      },
      "id": "fb387b48-8ee8-4144-b39e-52ce99de0a87",
      "name": "Schedule Trigger1",
      "type": "n8n-nodes-base.scheduleTrigger",
      "typeVersion": 1.1,
      "position": [
        2460,
        980
      ]
    },
    {
      "parameters": {
        "operation": "executeQuery",
        "query": "select distinct upper(document_number) as enterprise_document_number,\n                ce.id                  as enterprise_id\nfrom core_enterprise ce\n         inner join loans_loan l on ce.id = l.requester_id\n         inner join loan_requests_loanrequest lr on l.loan_request_id = lr.id\n    and l.state != 'canceled'\n    and lr.created_at >= DATE_ADD(LAST_DAY(DATE_SUB(CURDATE(), INTERVAL 1 MONTH)), INTERVAL 1 DAY) and\n                                                    lr.created_at < DATE_ADD(LAST_DAY(CURDATE()), INTERVAL 1 DAY);\n#and upper(ce.name)='HIMMEL FACTORING SPA'",
        "options": {}
      },
      "id": "ab7d3580-5a78-4d1f-bc89-78ba04c85ca8",
      "name": "empresas con operaciones en loans",
      "type": "n8n-nodes-base.mySql",
      "typeVersion": 2.1,
      "position": [
        3100,
        1200
      ],
      "credentials": {
        "mySql": {
          "name": "<your credential>"
        }
      }
    }
  ],
  "connections": {
    "asignaciones en HS": {
      "main": [
        [
          {
            "node": "empresas con ejecutivos v\u00e1lidos",
            "type": "main",
            "index": 1
          }
        ]
      ]
    },
    "empresas con ejecutivos v\u00e1lidos": {
      "main": [
        [
          {
            "node": "asignaciones v\u00e1lidas",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "ejecutivos en registry": {
      "main": [
        [
          {
            "node": "empresas con ejecutivos v\u00e1lidos",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "asignaciones v\u00e1lidas": {
      "main": [
        [
          {
            "node": "update en loans",
            "type": "main",
            "index": 0
          },
          {
            "node": "update en financing",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Schedule Trigger1": {
      "main": [
        [
          {
            "node": "ejecutivos en registry",
            "type": "main",
            "index": 0
          },
          {
            "node": "asignaciones en HS",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "empresas con operaciones en loans": {
      "main": [
        [
          {
            "node": "asignaciones v\u00e1lidas",
            "type": "main",
            "index": 1
          }
        ]
      ]
    }
  },
  "settings": {
    "saveManualExecutions": true,
    "callerPolicy": "workflowsFromSameOwner",
    "executionOrder": "v0"
  },
  "staticData": {
    "node:Schedule Trigger1": {
      "recurrencyRules": []
    },
    "node:Schedule Trigger2": {
      "recurrencyRules": []
    }
  },
  "versionId": "7877c642-59b1-4e35-9d00-875abe89c9c3",
  "triggerCount": 1,
  "tags": [
    {
      "id": "aDpcKzUzGLCXMKzG",
      "createdAt": "2023-07-14T19:51:58.772Z",
      "updatedAt": "2023-07-14T19:51:58.772Z",
      "name": "kimchi"
    },
    {
      "id": "v25eD48xihLAmSfO",
      "createdAt": "2023-07-14T19:51:55.716Z",
      "updatedAt": "2023-07-14T19:51:55.716Z",
      "name": "bi"
    }
  ]
}

Credentials you'll need

Each integration node will prompt for credentials when you import. We strip credential IDs before publishing — you'll add your own.

Pro

For the full experience including quality scoring and batch install features for each workflow upgrade to Pro

About this workflow

Actualizar asignaciones Kimchi. Uses mySql. Scheduled trigger; 8 nodes.

Source: https://github.com/abdopcnet/nodemation-backups/blob/main/actualizar-asignaciones-kimchi-F4JTphX0XULuFHuM.json — original creator credit. Request a take-down →

More Data & Sheets workflows → · Browse all categories →

Related workflows

Workflows that share integrations, category, or trigger type with this one. All free to copy and import.

Data & Sheets

Actualizar asignaciones de operaciones en financing y loans. Uses googleSheets, itemLists, mySql. Scheduled trigger; 41 nodes.

Google Sheets, Item Lists, MySQL
Data & Sheets

[eliminado] HS Factura. Uses httpRequest, itemLists, mySql. Scheduled trigger; 15 nodes.

HTTP Request, Item Lists, MySQL
Data & Sheets

Two Way Sync Pipedrive and MySQL. Uses mySql, pipedrive, stopAndError. Scheduled trigger; 15 nodes.

MySQL, Pipedrive, Stop And Error
Data & Sheets

This workflow automates a two way sync of customer data between Pipedrive and MySQL. It will create new records in one source if it only exists in the other. Where matching records have different data

MySQL, Pipedrive
Data & Sheets

[Oscar] GetInvoicesFromFapro. Uses httpRequest, mySql. Scheduled trigger; 14 nodes.

HTTP Request, MySQL