AutomationFlowsEmail & Gmail › Msvg Radar - Diagnose Drip

Msvg Radar - Diagnose Drip

MSVG Radar - Diagnose Drip. Uses dataTable, gmail. Scheduled trigger; 7 nodes.

Cron / scheduled trigger★★★★☆ complexity7 nodesData TableGmail
Email & Gmail Trigger: Cron / scheduled Nodes: 7 Complexity: ★★★★☆ Added:

This workflow follows the Datatable → Gmail 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": "MSVG Radar - Diagnose Drip",
  "nodes": [
    {
      "parameters": {
        "rule": {
          "interval": [
            {
              "field": "cronExpression",
              "expression": "0 8 * * *"
            }
          ]
        }
      },
      "id": "schedule",
      "name": "Taeglich",
      "type": "n8n-nodes-base.scheduleTrigger",
      "typeVersion": 1.3,
      "position": [
        0,
        0
      ]
    },
    {
      "parameters": {
        "operation": "get",
        "dataTableId": {
          "__rl": true,
          "mode": "id",
          "value": "pwALoGRqcVChOKwo",
          "cachedResultName": "Diagnose Leads"
        },
        "filters": {
          "conditions": [
            {
              "keyName": "created_at",
              "condition": "isNotEmpty"
            }
          ]
        },
        "limit": 200,
        "orderBy": true,
        "orderByColumn": "created_at"
      },
      "id": "leads_lesen",
      "name": "Leads lesen",
      "type": "n8n-nodes-base.dataTable",
      "typeVersion": 1.1,
      "position": [
        224,
        0
      ],
      "alwaysOutputData": true
    },
    {
      "parameters": {
        "operation": "get",
        "dataTableId": {
          "__rl": true,
          "mode": "id",
          "value": "ZRCcCGpZZ1KzyOC7",
          "cachedResultName": "Drip Optouts"
        },
        "filters": {
          "conditions": [
            {
              "keyName": "created_at",
              "condition": "isNotEmpty"
            }
          ]
        },
        "limit": 200
      },
      "id": "optouts_lesen",
      "name": "Optouts lesen",
      "type": "n8n-nodes-base.dataTable",
      "typeVersion": 1.1,
      "position": [
        448,
        0
      ],
      "alwaysOutputData": true
    },
    {
      "parameters": {
        "jsCode": "// Faellige Drip-Mails: Mail 2 nach >=3 Tagen, Mail 3 nach >=7 Tagen (Mail 2 muss raus sein).\n// Obergrenze 60 Tage: verhindert Nachtraegliches Anmailen alter Leads (Backlog-Schutz).\nconst OPTOUT = new Set($('Optouts lesen').all().map(i => String((i.json && i.json.email) || '').toLowerCase()).filter(Boolean));\nconst now = Date.now();\nconst DAY = 24 * 3600 * 1000;\nconst nowIso = $now.toISO();\nconst leads = $('Leads lesen').all().map(i => i.json).filter(r => r && r.email && r.created_at);\nconst out = [];\nfor (const r of leads) {\n  const email = String(r.email).toLowerCase();\n  if (OPTOUT.has(email)) continue;\n  const created = Date.parse(r.created_at);\n  if (isNaN(created)) continue;\n  const ageDays = (now - created) / DAY;\n  if (ageDays >= 60) continue;\n  let result = {};\n  try { result = JSON.parse(r.result || '{}'); } catch (e) {}\n  const drip = result.drip || {};\n  let stage = '';\n  if (ageDays >= 3 && !drip.mail2_at) stage = 'mail2';\n  else if (ageDays >= 7 && drip.mail2_at && !drip.mail3_at) stage = 'mail3';\n  if (!stage) continue;\n  let answers = {};\n  try { answers = JSON.parse(r.answers || '{}'); } catch (e) {}\n  const q4 = String(answers.q4 || 'a');\n  result.drip = Object.assign({}, drip, { [stage + '_at']: nowIso });\n  out.push({ json: {\n    email: r.email,\n    stage,\n    q4,\n    phase_label: result.phase_label || '',\n    created_at: r.created_at,\n    new_result_json: JSON.stringify(result)\n  } });\n}\nreturn out;"
      },
      "id": "faellig",
      "name": "Faellige finden",
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        672,
        0
      ]
    },
    {
      "parameters": {
        "mode": "runOnceForEachItem",
        "jsCode": "const d = $json;\nconst esc = s => String(s == null ? '' : s).replace(/&/g, '&amp;').replace(/</g, '&lt;').replace(/>/g, '&gt;').replace(/\"/g, '&quot;');\nconst email = String(d.email || '');\nconst unsub = 'https://n8n.msvg.eu/webhook/radar-unsubscribe?email=' + encodeURIComponent(email) + '&list=drip';\n\n// Mail 2: konkreter Praxis-Tipp je Schmerzpunkt (q4). Value-first, kein Pitch.\nconst TIPS = {\n  a: { titel: 'Ein Ablauf, der sich selbst erledigt', text: 'Nehmen Sie den einen Verwaltungsvorgang, der sich diese Woche am haeufigsten wiederholt hat, etwa Angebot, Rechnung oder Terminbestaetigung. Schreiben Sie die Schritte einmal sauber auf. Genau dieser dokumentierte Ablauf ist die Vorlage, aus der sich spaeter ein automatisierter Schritt bauen laesst. Ohne Vorlage automatisiert man nur das Chaos.' },\n  b: { titel: 'Ein Eingang fuer jede Anfrage', text: 'Anfragen versickern fast immer, weil sie ueber mehrere Kanaele kommen und niemand den Ueberblick behaelt. Der erste Schritt ist unspektakulaer: ein einziger definierter Eingang, durch den jede Anfrage laeuft, mit einer klaren Regel, wer sie bis wann beantwortet. Erst wenn der Weg feststeht, lohnt sich Technik darauf.' },\n  c: { titel: 'Ein Kopf, ein Dokument', text: 'Wissen, das an einzelnen Personen haengt, wird zum Risiko, sobald diese Person ausfaellt. Waehlen Sie den einen Vorgang, den nur ein Mensch im Betrieb wirklich beherrscht, und lassen Sie ihn diese Woche einmal mitschreiben, waehrend er ihn tut. Aus diesem Protokoll wird spaeter eine Anleitung, die andere uebernehmen koennen.' },\n  d: { titel: 'Ein Experiment statt einer Strategie', text: 'Digitale Chancen verpasst man selten wegen fehlender Strategie, sondern wegen fehlender erster Schritte. Waehlen Sie ein kleines Experiment, das in vier Wochen ein sichtbares Ergebnis liefert, nicht das grosse Projekt. Ein vorzeigbares Ergebnis ueberzeugt Ihr Team mehr als jeder Plan.' }\n};\n\nconst accent = '#B4472E';\nlet subject, eyebrow, titel, bodyText, ctaLabel, ctaHref, ctaSub;\n\nif (d.stage === 'mail2') {\n  const t = TIPS[d.q4] || TIPS.a;\n  subject = 'Ein erster Schritt zu Ihrem Ergebnis';\n  eyebrow = 'Digital-Diagnose &middot; Ihr naechster Schritt';\n  titel = t.titel;\n  bodyText = t.text;\n  ctaLabel = 'Ergebnis noch einmal ansehen';\n  ctaHref = 'https://markt-radar.eu/selbst-diagnose';\n  ctaSub = '';\n} else {\n  subject = 'Wo bei Ihnen der erste Hebel liegt';\n  eyebrow = 'Digital-Diagnose &middot; Kurzer Impuls';\n  titel = 'Was Betriebe in Ihrer Phase als Naechstes tun';\n  bodyText = 'Vor ein paar Tagen haben Sie die Digital-Diagnose gemacht. Die Betriebe, die danach am meisten bewegen, haben eines gemeinsam: Sie fangen mit genau einem Ablauf an, statt alles gleichzeitig zu wollen. Wenn Sie moechten, schaue ich mir Ihren konkreten Fall in einem kurzen Gespraech an und sage Ihnen, wo der erste Hebel liegt, ohne Verkaufsdruck.';\n  ctaLabel = 'Kennenlerngespraech buchen';\n  ctaHref = 'https://calendly.com/marcschraepler/15min';\n  ctaSub = '15 Minuten, unverbindlich.';\n}\n\nconst html = '<div style=\"margin:0;padding:24px 12px;background:#ffffff;\">'\n  + '<div style=\"max-width:560px;margin:0 auto;background:#ffffff;border:1px solid #E4DFD5;border-radius:12px;overflow:hidden;font-family:Arial,Helvetica,sans-serif;\">'\n  + '<div style=\"background:' + accent + ';padding:16px 28px;\"><span style=\"color:#ffffff;font-size:15px;font-weight:bold;letter-spacing:.3px;\">Markt-Radar</span></div>'\n  + '<div style=\"padding:26px 28px;\">'\n  + '<p style=\"margin:0 0 10px;font-family:monospace;font-size:11px;letter-spacing:.14em;text-transform:uppercase;color:' + accent + ';\">' + eyebrow + '</p>'\n  + '<p style=\"margin:0 0 12px;font-size:20px;line-height:1.3;font-weight:800;color:#1A1714;\">' + esc(titel) + '</p>'\n  + '<p style=\"margin:0 0 22px;font-size:14.5px;line-height:1.65;color:#3A342E;\">' + esc(bodyText) + '</p>'\n  + '<a href=\"' + ctaHref + '\" style=\"display:inline-block;background:' + accent + ';color:#ffffff;font-size:14px;font-weight:bold;text-decoration:none;padding:12px 24px;border-radius:8px;\">' + ctaLabel + ' &rarr;</a>'\n  + (ctaSub ? '<p style=\"margin:10px 0 0;font-size:12px;color:#857D73;\">' + esc(ctaSub) + '</p>' : '')\n  + '<p style=\"margin:24px 0 0;padding-top:14px;border-top:1px solid #E4DFD5;font-size:12px;color:#857D73;line-height:1.6;\">Ein Werkzeug von Marc Schraepler von Gerlach &middot; <a href=\"https://markt-radar.eu\" style=\"color:#857D73;\">markt-radar.eu</a><br><a href=\"' + unsub + '\" style=\"color:#857D73;\">Diese Folge-E-Mails abbestellen</a></p>'\n  + '</div></div></div>';\n\nreturn { json: { to: email, subject, html, created_at: d.created_at, new_result_json: d.new_result_json } };"
      },
      "id": "mail_bauen",
      "name": "Mail bauen",
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        896,
        0
      ]
    },
    {
      "parameters": {
        "sendTo": "={{ $json.to }}",
        "subject": "={{ $json.subject }}",
        "message": "={{ $json.html }}",
        "options": {
          "appendAttribution": false
        }
      },
      "id": "drip_mail",
      "name": "Drip-Mail",
      "type": "n8n-nodes-base.gmail",
      "typeVersion": 2.2,
      "position": [
        1120,
        0
      ],
      "credentials": {
        "gmailOAuth2": {
          "name": "<your credential>"
        }
      },
      "onError": "continueRegularOutput"
    },
    {
      "parameters": {
        "operation": "update",
        "dataTableId": {
          "__rl": true,
          "mode": "id",
          "value": "pwALoGRqcVChOKwo",
          "cachedResultName": "Diagnose Leads"
        },
        "matchType": "allConditions",
        "filters": {
          "conditions": [
            {
              "keyName": "created_at",
              "keyValue": "={{ $('Mail bauen').item.json.created_at }}"
            }
          ]
        },
        "columns": {
          "mappingMode": "defineBelow",
          "matchingColumns": [
            "created_at"
          ],
          "value": {
            "result": "={{ $('Mail bauen').item.json.new_result_json }}"
          },
          "schema": [
            {
              "id": "result",
              "displayName": "result",
              "type": "string",
              "required": false,
              "display": true,
              "defaultMatch": false,
              "canBeUsedToMatch": true
            }
          ]
        },
        "options": {}
      },
      "id": "status_schreiben",
      "name": "Drip-Status schreiben",
      "type": "n8n-nodes-base.dataTable",
      "typeVersion": 1.1,
      "position": [
        1344,
        0
      ],
      "onError": "continueRegularOutput"
    }
  ],
  "connections": {
    "Taeglich": {
      "main": [
        [
          {
            "node": "Leads lesen",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Leads lesen": {
      "main": [
        [
          {
            "node": "Optouts lesen",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Optouts lesen": {
      "main": [
        [
          {
            "node": "Faellige finden",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Faellige finden": {
      "main": [
        [
          {
            "node": "Mail bauen",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Mail bauen": {
      "main": [
        [
          {
            "node": "Drip-Mail",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Drip-Mail": {
      "main": [
        [
          {
            "node": "Drip-Status schreiben",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "settings": {
    "executionOrder": "v1",
    "timezone": "Europe/Vienna",
    "saveDataErrorExecution": "all",
    "saveDataSuccessExecution": "all",
    "binaryMode": "separate",
    "timeSavedMode": "fixed",
    "callerPolicy": "workflowsFromSameOwner",
    "availableInMCP": true
  }
}

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

MSVG Radar - Diagnose Drip. Uses dataTable, gmail. Scheduled trigger; 7 nodes.

Source: https://github.com/marcschraepler/markt-radar/blob/1224da14ac66e609418ece77b5c284e6fc8b82d9/n8n/diagnose-drip.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

Cold Email Automation - Safe Ramp + AI Personalization + Follow-ups. Uses googleSheets, httpRequest, gmail. Scheduled trigger; 34 nodes.

Google Sheets, HTTP Request, Gmail
Email & Gmail

This workflow runs every weekday morning to find HubSpot deals with stale proposal activity, pulls the associated contact email, enforces opt-out and follow-up limits using Google Sheets, sends a valu

HubSpot, Google Sheets, Slack +1
Email & Gmail

How it works time trigger using the cron format, every weekday at 5pm gets CentralStationCRM people updates of today checks for tag "Outreach" if true, sends message on gmail (predefine in node) waits

Gmail, HTTP Request, Slack
Email & Gmail

This n8n workflow template, "Email Outreach Automation," is designed to help you set up an automated email outreach system using tools you might already be familiar with: Google Sheets and Google Docs

Google Sheets, Google Docs, Gmail
Email & Gmail

This workflow runs on a daily schedule to monitor users currently on a trial plan. It fetches user data from MongoDB, calculates their trial stage, and assigns a trigger label such as Day 3, Day 7, Da

MongoDB, Gmail