{ "name": "Outlevo: Sheet row to a do-not-contact entry", "nodes": [ { "id": "3605ae5d-5f12-454c-8a9f-85eee3999681", "name": "How to set it up", "type": "n8n-nodes-base.stickyNote", "typeVersion": 1, "position": [ -40, -386 ], "parameters": { "content": "## How to set it up\n\n**Credentials** (n8n asks for each on first open):\n- **Google Sheets**: connect your Google Sheets account.\n- **Outlevo API key**: a Header Auth credential, name `Authorization`, value `Bearer olv_live_…` (Settings → API keys in Outlevo).\n\n**API key scopes**: `compliance:write`.\n\n**Replace**: `YOUR_SHEET_ID`.\n\n**Columns in the sheet** (first row): `Email`, `Domain`.\n\nThen switch the workflow to **Active**.", "height": 326, "width": 620 } }, { "id": "07fa772e-f971-44d6-9720-08123d524bd2", "name": "New row in the sheet", "type": "n8n-nodes-base.googleSheetsTrigger", "typeVersion": 1, "position": [ 0, 0 ], "parameters": { "pollTimes": { "item": [ { "mode": "everyMinute" } ] }, "documentId": { "__rl": true, "mode": "url", "value": "https://docs.google.com/spreadsheets/d/YOUR_SHEET_ID/edit" }, "sheetName": { "__rl": true, "mode": "name", "value": "Do not contact" }, "event": "rowAdded", "options": {} }, "credentials": { "googleSheetsTriggerOAuth2Api": { "id": "", "name": "Google Sheets" } } }, { "id": "c2ce5c31-3362-408e-8967-3ad3df30cf6d", "name": "Email or domain", "type": "n8n-nodes-base.code", "typeVersion": 2, "position": [ 240, 0 ], "parameters": { "mode": "runOnceForAllItems", "jsCode": "// An email address blocks that person; a domain blocks the whole company. Rows with neither are skipped.\nreturn $input.all().flatMap((item) => {\n const f = item.json || {};\n const keys = Object.keys(f);\n const val = (re) => { const k = keys.find((x) => re.test(x.toLowerCase()) && String(f[x] ?? '').trim()); return k ? String(f[k]).trim().toLowerCase() : ''; };\n const email = val(/e-?mail/);\n if (/^[^@\\s]+@[^@\\s]+\\.[a-z]{2,}$/.test(email)) return [{ json: { email } }];\n const m = val(/domain|website|\\bsite\\b/).match(/^(?:[a-z]+:\\/\\/)?(?:www\\.)?([a-z0-9-]+(?:\\.[a-z0-9-]+)*\\.[a-z]{2,63})(?:[/:?#]|$)/);\n return m ? [{ json: { domain: m[1] } }] : [];\n});\n" } }, { "id": "26fd6305-cf66-4437-84eb-3f57a109ac88", "name": "Block in Outlevo", "type": "n8n-nodes-base.httpRequest", "typeVersion": 4.2, "position": [ 480, 0 ], "parameters": { "method": "POST", "url": "=https://api.outlevo.com/v1/suppressions", "authentication": "genericCredentialType", "genericAuthType": "httpHeaderAuth", "sendHeaders": true, "headerParameters": { "parameters": [ { "name": "Idempotency-Key", "value": "={{ ('sheet-block-' + ($json.email || $json.domain)).slice(0, 200) }}" } ] }, "sendBody": true, "specifyBody": "json", "jsonBody": "={{ JSON.stringify($json.email ? { email: $json.email } : { domain: $json.domain }) }}", "options": {} }, "credentials": { "httpHeaderAuth": { "id": "", "name": "Outlevo API key (Authorization: Bearer olv_live_…)" } } } ], "connections": { "New row in the sheet": { "main": [ [ { "node": "Email or domain", "type": "main", "index": 0 } ] ] }, "Email or domain": { "main": [ [ { "node": "Block in Outlevo", "type": "main", "index": 0 } ] ] } }, "settings": { "executionOrder": "v1" }, "pinData": {}, "meta": { "templateCredsSetupCompleted": false } }