{
  "nodes": [
    {
      "name": "On clicking 'execute'",
      "type": "n8n-nodes-base.manualTrigger",
      "disabled": true,
      "position": [
        70,
        140
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "name": "Cron",
      "type": "n8n-nodes-base.cron",
      "position": [
        70,
        320
      ],
      "parameters": {
        "triggerTimes": {
          "item": [
            {
              "hour": 8
            }
          ]
        }
      },
      "typeVersion": 1
    },
    {
      "name": "Telegram",
      "type": "n8n-nodes-base.telegram",
      "position": [
        620,
        210
      ],
      "parameters": {
        "text": "LIMPOU PACOTES TRANSPORTE-RECEBIDO PONTO MIX",
        "chatId": "REPLACE_WITH_CHATID",
        "additionalFields": {}
      },
      "typeVersion": 1
    },
    {
      "name": "Telegram1",
      "type": "n8n-nodes-base.telegram",
      "position": [
        620,
        460
      ],
      "parameters": {
        "text": "LIMPOU PACOTES TRANSPORTE-RECEBIDO OBJETIVA",
        "chatId": "REPLACE_WITH_CHATID",
        "additionalFields": {}
      },
      "typeVersion": 1
    },
    {
      "name": "Webhook",
      "type": "n8n-nodes-base.webhook",
      "position": [
        70,
        480
      ],
      "parameters": {
        "path": "limparPacotes",
        "options": {}
      },
      "typeVersion": 1
    },
    {
      "name": "limparPacoteCliente1",
      "type": "n8n-nodes-base.mySql",
      "position": [
        380,
        470
      ],
      "parameters": {
        "query": "-- LIMPAR ETIQUETAS ANTIGAS \nwith t as (\nselect token from i_objeto where modulo = 'pacoteProduto' and situacao = 'TRANSPORTE-RECEBIDO' and data <= DATE_SUB(CURDATE(), INTERVAL 1 MONTH)\n)\nupdate i_objeto \nset modulo = 'DELETE'\nwhere modulo = 'pacoteProduto' and token in (select token from t)",
        "operation": "executeQuery"
      },
      "typeVersion": 1
    },
    {
      "name": "limpaPacoteCliente0",
      "type": "n8n-nodes-base.mySql",
      "position": [
        380,
        210
      ],
      "parameters": {
        "query": "-- LIMPAR ETIQUETAS ANTIGAS \nwith t as (\nselect token from i_objeto where modulo = 'pacoteProduto' and situacao = 'TRANSPORTE-RECEBIDO' and data <= DATE_SUB(CURDATE(), INTERVAL 1 MONTH)\n)\nupdate i_objeto \nset modulo = 'DELETE'\nwhere modulo = 'pacoteProduto' and token in (select token from t)",
        "operation": "executeQuery"
      },
      "typeVersion": 1
    },
    {
      "id": "c6df030d-ecbb-5f82-bf0e-c0ef136d2913",
      "name": "Publication · Overview and setup",
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        -800,
        0
      ],
      "parameters": {
        "content": "# cron and telegram and webhook\n\n## Purpose and structure\nThis folder contains the **cron and telegram and webhook** workflow. Its executable nodes use `cron`, `manualTrigger`, `mySql`, `telegram`, `webhook`. The table and connection map below are derived from the JSON, not an inferred guarantee of behavior.\n\n## Setup\nImport inactive. Configure your own credentials and replace REPLACE_WITH_* values. Review external destinations and Code nodes before running.\n\n## Entry points\nOn clicking 'execute', Cron, Webhook\n\n## Verification\nSanitized source candidate; not runtime-tested. This overview is generated from node metadata. Read the folder README for the connection map, credential types, and license.\n\n## Attribution\nhttps://github.com/Zie619/n8n-workflows/blob/94007c1445d9258a7da116646b79473e7c7c3282/workflows/Telegram/0140_Telegram_Webhook_Automation_Webhook.json\nMIT; preserve source notices.",
        "width": 700,
        "height": 800,
        "color": 1
      }
    }
  ],
  "connections": {
    "Cron": {
      "main": [
        [
          {
            "node": "limpaPacoteCliente0",
            "type": "main",
            "index": 0
          },
          {
            "node": "limparPacoteCliente1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Webhook": {
      "main": [
        [
          {
            "node": "limpaPacoteCliente0",
            "type": "main",
            "index": 0
          },
          {
            "node": "limparPacoteCliente1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "limpaPacoteCliente0": {
      "main": [
        [
          {
            "node": "Telegram",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "limparPacoteCliente1": {
      "main": [
        [
          {
            "node": "Telegram1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "On clicking 'execute'": {
      "main": [
        [
          {
            "node": "limpaPacoteCliente0",
            "type": "main",
            "index": 0
          },
          {
            "node": "limparPacoteCliente1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "active": false
}
