AutomationFlowsEmail & Gmail › Scadenzario Clienti: Promemoria E Solleciti Automatici

Scadenzario Clienti: Promemoria E Solleciti Automatici

03 - Scadenzario clienti: promemoria e solleciti automatici. Uses googleSheets, gmail, telegram. Scheduled trigger; 9 nodes.

Cron / scheduled trigger★★★★☆ complexity9 nodesGoogle SheetsGmailTelegram
Email & Gmail Trigger: Cron / scheduled Nodes: 9 Complexity: ★★★★☆ Added:

This workflow follows the Gmail → Google Sheets recipe pattern — see all workflows that pair these two integrations.

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
{
  "name": "03 - Scadenzario clienti: promemoria e solleciti automatici",
  "nodes": [
    {
      "parameters": {
        "content": "## Setup in 10 minuti\n\n1. Crea un Google Sheet con tab **Scadenze** e queste intestazioni:\n`id, cliente, referente, email, scadenza_tipo, scadenza_data, documenti_attesi, documenti_ricevuti, ultimo_sollecito, solleciti_inviati`\n2. Metti l'ID del foglio nei due nodi Google Sheets (INSERISCI_ID_GOOGLE_SHEET)\n3. Nel nodo Code sostituisci INSERISCI_NOME_STUDIO e INSERISCI_FIRMA\n4. Nel nodo Telegram metti il tuo chat id\n5. Collega le credenziali Google Sheets, Gmail e Telegram\n6. Attiva il workflow\n\nIl promemoria parte 10 giorni prima e 3 giorni prima di ogni scadenza, e si ferma da solo quando scrivi 'si' nella colonna documenti_ricevuti.",
        "height": 420,
        "width": 460
      },
      "id": "a1f0c2d4-0001-4a10-9b21-0f1a2b3c4d01",
      "name": "Nota setup",
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        -820,
        -300
      ]
    },
    {
      "parameters": {
        "rule": {
          "interval": [
            {
              "field": "days",
              "triggerAtHour": 8
            }
          ]
        }
      },
      "id": "a1f0c2d4-0002-4a10-9b21-0f1a2b3c4d02",
      "name": "Ogni mattina alle 8",
      "type": "n8n-nodes-base.scheduleTrigger",
      "typeVersion": 1.2,
      "position": [
        -820,
        160
      ]
    },
    {
      "parameters": {
        "documentId": {
          "__rl": true,
          "mode": "id",
          "value": "INSERISCI_ID_GOOGLE_SHEET"
        },
        "sheetName": {
          "__rl": true,
          "mode": "name",
          "value": "Scadenze"
        },
        "options": {}
      },
      "id": "a1f0c2d4-0003-4a10-9b21-0f1a2b3c4d03",
      "name": "Leggi le scadenze",
      "type": "n8n-nodes-base.googleSheets",
      "typeVersion": 4.5,
      "position": [
        -600,
        160
      ]
    },
    {
      "parameters": {
        "jsCode": "// Promemoria scadenze e solleciti documenti\n// Legge il foglio Scadenze, tiene solo le righe che vanno sollecitate oggi\n// e prepara oggetto e corpo della mail per ogni cliente.\n\nconst STUDIO = 'INSERISCI_NOME_STUDIO';\nconst FIRMA = 'INSERISCI_FIRMA';        // es. \"Studio Rossi - segreteria - 010 1234567\"\nconst FINESTRE = [10, 3];               // giorni di preavviso: due solleciti per scadenza\n\nconst oggi = new Date();\noggi.setHours(0, 0, 0, 0);\n\n// data locale in formato AAAA-MM-GG.\n// NON usare toISOString(): su fuso orario italiano (UTC+1/+2) la mezzanotte\n// locale ricade nel giorno precedente in UTC e la data uscirebbe indietro di uno.\nfunction isoLocale(d) {\n  return d.getFullYear() + '-' +\n    String(d.getMonth() + 1).padStart(2, '0') + '-' +\n    String(d.getDate()).padStart(2, '0');\n}\nconst oggiISO = isoLocale(oggi);\n\nfunction leggiData(v) {\n  const s = String(v || '').trim();\n  if (!s) return null;\n  let d;\n  if (s.includes('/')) {\n    const p = s.split('/');\n    if (p.length !== 3) return null;\n    d = new Date(Number(p[2]), Number(p[1]) - 1, Number(p[0]));\n  } else {\n    d = new Date(s);\n  }\n  if (isNaN(d.getTime())) return null;\n  d.setHours(0, 0, 0, 0);\n  return d;\n}\n\nconst out = [];\n\nfor (const item of $input.all()) {\n  const r = item.json;\n\n  if (!r.email || !r.scadenza_data) continue;\n\n  // documenti gia' arrivati: niente sollecito\n  const ricevuti = String(r.documenti_ricevuti || '').trim().toLowerCase();\n  if (ricevuti === 'si' || ricevuti === 's\u00ec' || ricevuti === 'x') continue;\n\n  const d = leggiData(r.scadenza_data);\n  if (!d) continue;\n\n  const giorni = Math.round((d - oggi) / 86400000);\n  if (!FINESTRE.includes(giorni)) continue;\n\n  // gia' sollecitato oggi: non mandare due volte\n  if (String(r.ultimo_sollecito || '').trim().slice(0, 10) === oggiISO) continue;\n\n  const tipo = String(r.scadenza_tipo || 'scadenza').trim();\n  const referente = String(r.referente || '').trim();\n  const apertura = referente ? 'Buongiorno ' + referente + ',' : 'Buongiorno,';\n  const quando = giorni === 1 ? 'domani' : 'tra ' + giorni + ' giorni';\n  const mancanti = String(r.documenti_attesi || '').trim();\n  const elenco = mancanti\n    ? '\\n\\nCi servono ancora: ' + mancanti + '.'\n    : '';\n\n  const corpo =\n    apertura + '\\n' +\n    'un promemoria dallo studio: la scadenza ' + tipo + ' e\\' ' + quando + ', il ' + String(r.scadenza_data).trim() + '.' +\n    elenco + '\\n\\n' +\n    'Se avete gia\\' inviato tutto, ignorate pure questa mail: il promemoria parte in automatico e si ferma appena registriamo i documenti.\\n\\n' +\n    'Grazie,\\n' + FIRMA;\n\n  out.push({\n    json: {\n      id: r.id,\n      cliente: r.cliente || '',\n      email: String(r.email).trim(),\n      scadenza_tipo: tipo,\n      scadenza_data: String(r.scadenza_data).trim(),\n      giorni_mancanti: giorni,\n      oggetto: tipo + ': mancano ' + giorni + ' giorni (' + STUDIO + ')',\n      corpo: corpo,\n      ultimo_sollecito: oggiISO,\n      solleciti_inviati: Number(r.solleciti_inviati || 0) + 1\n    }\n  });\n}\n\nreturn out;\n"
      },
      "id": "a1f0c2d4-0004-4a10-9b21-0f1a2b3c4d04",
      "name": "Chi va sollecitato oggi",
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        -380,
        160
      ]
    },
    {
      "parameters": {
        "conditions": {
          "options": {
            "caseSensitive": false,
            "leftValue": "",
            "typeValidation": "loose"
          },
          "conditions": [
            {
              "id": "b2e1d3c5-1111-4b20-8c32-1a2b3c4d5e11",
              "leftValue": "={{ $json.email }}",
              "rightValue": "",
              "operator": {
                "type": "string",
                "operation": "notEmpty",
                "singleValue": true
              }
            }
          ],
          "combinator": "and"
        },
        "options": {}
      },
      "id": "a1f0c2d4-0005-4a10-9b21-0f1a2b3c4d05",
      "name": "C'e' qualcosa da mandare?",
      "type": "n8n-nodes-base.if",
      "typeVersion": 2.2,
      "position": [
        -160,
        160
      ]
    },
    {
      "parameters": {
        "sendTo": "={{ $json.email }}",
        "subject": "={{ $json.oggetto }}",
        "emailType": "text",
        "message": "={{ $json.corpo }}",
        "options": {
          "appendAttribution": false
        }
      },
      "id": "a1f0c2d4-0006-4a10-9b21-0f1a2b3c4d06",
      "name": "Manda il promemoria al cliente",
      "type": "n8n-nodes-base.gmail",
      "typeVersion": 2.1,
      "position": [
        80,
        60
      ]
    },
    {
      "parameters": {
        "operation": "update",
        "documentId": {
          "__rl": true,
          "mode": "id",
          "value": "INSERISCI_ID_GOOGLE_SHEET"
        },
        "sheetName": {
          "__rl": true,
          "mode": "name",
          "value": "Scadenze"
        },
        "columns": {
          "mappingMode": "defineBelow",
          "value": {
            "id": "={{ $json.id }}",
            "ultimo_sollecito": "={{ $json.ultimo_sollecito }}",
            "solleciti_inviati": "={{ $json.solleciti_inviati }}"
          },
          "matchingColumns": [
            "id"
          ],
          "schema": []
        },
        "options": {}
      },
      "id": "a1f0c2d4-0007-4a10-9b21-0f1a2b3c4d07",
      "name": "Segna il sollecito sul foglio",
      "type": "n8n-nodes-base.googleSheets",
      "typeVersion": 4.5,
      "position": [
        300,
        60
      ]
    },
    {
      "parameters": {
        "chatId": "INSERISCI_CHAT_ID",
        "text": "=Sollecito inviato\nCliente: {{ $json.cliente || '-' }}\nScadenza: {{ $json.scadenza_tipo }} del {{ $json.scadenza_data }}\nMancano {{ $json.giorni_mancanti }} giorni\nSollecito numero {{ $json.solleciti_inviati }}",
        "additionalFields": {}
      },
      "id": "a1f0c2d4-0008-4a10-9b21-0f1a2b3c4d08",
      "name": "Avvisa lo studio",
      "type": "n8n-nodes-base.telegram",
      "typeVersion": 1.2,
      "position": [
        520,
        60
      ]
    },
    {
      "parameters": {},
      "id": "a1f0c2d4-0009-4a10-9b21-0f1a2b3c4d09",
      "name": "Oggi nessun sollecito",
      "type": "n8n-nodes-base.noOp",
      "typeVersion": 1,
      "position": [
        80,
        300
      ]
    }
  ],
  "connections": {
    "Ogni mattina alle 8": {
      "main": [
        [
          {
            "node": "Leggi le scadenze",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Leggi le scadenze": {
      "main": [
        [
          {
            "node": "Chi va sollecitato oggi",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Chi va sollecitato oggi": {
      "main": [
        [
          {
            "node": "C'e' qualcosa da mandare?",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "C'e' qualcosa da mandare?": {
      "main": [
        [
          {
            "node": "Manda il promemoria al cliente",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Oggi nessun sollecito",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Manda il promemoria al cliente": {
      "main": [
        [
          {
            "node": "Segna il sollecito sul foglio",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Segna il sollecito sul foglio": {
      "main": [
        [
          {
            "node": "Avvisa lo studio",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "active": false,
  "settings": {
    "executionOrder": "v1"
  },
  "tags": []
}
Pro

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

About this workflow

03 - Scadenzario clienti: promemoria e solleciti automatici. Uses googleSheets, gmail, telegram. Scheduled trigger; 9 nodes.

Source: https://github.com/dabiH2/Automazioni-n8n/blob/main/03-scadenzario-solleciti.json — original creator credit. Request a take-down →

More Email & Gmail workflows → · Browse all categories →

Related workflows

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

Email & Gmail

Template - SSL Expiry Alert System. Uses googleSheets, scheduleTrigger, httpRequest, stickyNote. Scheduled trigger; 21 nodes.

Google Sheets, HTTP Request, Gmail +2
Email & Gmail

This workflow is ideal for administrators or IT professionals responsible for monitoring SSL certificates of multiple websites to ensure they do not expire unexpectedly.

Google Sheets, HTTP Request, Gmail +2
Email & Gmail

url-uptime-monitor. Uses scheduleTrigger, splitOut, googleSheets, summarize. Scheduled trigger; 18 nodes.

Google Sheets, Gmail, HTTP Request +1
Email & Gmail

Sign up for Decodo — get better pricing here

Google Sheets, @Decodo/N8N Nodes Decodo, Google Calendar +2
Email & Gmail

MPE Kleinanzeigen Unified (Reminder + Poster). Uses gmail, httpRequest, telegram, googleSheets. Scheduled trigger; 15 nodes.

Gmail, HTTP Request, Telegram +1