{ "name": "Outlevo: ICP visitors digest to Gmail", "nodes": [ { "id": "4f29fa07-33f9-4768-b52c-83ebaa7646ef", "name": "How to set it up", "type": "n8n-nodes-base.stickyNote", "typeVersion": 1, "position": [ -40, -360 ], "parameters": { "content": "## How to set it up\n\n**Credentials** (n8n asks for each on first open):\n- **Outlevo API key**: a Header Auth credential, name `Authorization`, value `Bearer olv_live_…` (Settings → API keys in Outlevo).\n- **Gmail**: connect your Gmail account.\n\n**API key scopes**: `visitors:read`.\n\n**Replace**: `you@example.com`.\n\nThen switch the workflow to **Active**.", "height": 300, "width": 620 } }, { "id": "6d8ccd8a-ee20-4459-98b6-c7702e5d9abf", "name": "Every morning", "type": "n8n-nodes-base.scheduleTrigger", "typeVersion": 1.2, "position": [ 0, 0 ], "parameters": { "rule": { "interval": [ { "field": "days", "daysInterval": 1, "triggerAtHour": 9 } ] } } }, { "id": "c0c5bc05-1f1a-4db1-bb36-1291bd922add", "name": "ICP visitors", "type": "n8n-nodes-base.httpRequest", "typeVersion": 4.2, "position": [ 240, 0 ], "parameters": { "method": "GET", "url": "=https://api.outlevo.com/v1/visitors", "authentication": "genericCredentialType", "genericAuthType": "httpHeaderAuth", "sendQuery": true, "queryParameters": { "parameters": [ { "name": "days", "value": "1" }, { "name": "in_icp", "value": "true" } ] }, "options": {} }, "credentials": { "httpHeaderAuth": { "id": "", "name": "Outlevo API key (Authorization: Bearer olv_live_…)" } } }, { "id": "133f6511-221c-46ef-8580-b9231d76c433", "name": "Write the digest", "type": "n8n-nodes-base.code", "typeVersion": 2, "position": [ 480, 0 ], "parameters": { "mode": "runOnceForAllItems", "jsCode": "const list = [...($input.first().json.data || [])].sort((a, b) => (b.page_views ?? 0) - (a.page_views ?? 0));\nif (!list.length) return [];\nconst lines = list.slice(0, 20).map((v) => `• ${v.name || v.domain}${v.name ? ` (${v.domain})` : ''}${v.country ? `, ${v.country}` : ''}: ${v.visits} visit(s), ${v.page_views} page(s)${v.pricing ? ', looked at pricing' : ''}${(v.top_pages || [])[0] ? `, most on ${v.top_pages[0].path}` : ''}`);\nconst more = list.length > 20 ? `\\n…and ${list.length - 20} more` : '';\nreturn [{ json: { text: `👋 ${list.length} ICP compan${list.length === 1 ? 'y' : 'ies'} visited your site:\\n${lines.join('\\n')}${more}\\nhttps://app.outlevo.com/visitors`, subject: `${list.length} ICP visitor(s) yesterday` } }];\n" } }, { "id": "d8e85854-69df-4eb3-aae6-a138a1caae3e", "name": "Email it", "type": "n8n-nodes-base.gmail", "typeVersion": 2.1, "position": [ 720, 0 ], "parameters": { "sendTo": "you@example.com", "subject": "={{ $json.subject }}", "emailType": "text", "message": "={{ $json.text }}", "options": { "appendAttribution": false } }, "credentials": { "gmailOAuth2": { "id": "", "name": "Gmail" } } } ], "connections": { "Every morning": { "main": [ [ { "node": "ICP visitors", "type": "main", "index": 0 } ] ] }, "ICP visitors": { "main": [ [ { "node": "Write the digest", "type": "main", "index": 0 } ] ] }, "Write the digest": { "main": [ [ { "node": "Email it", "type": "main", "index": 0 } ] ] } }, "settings": { "executionOrder": "v1" }, "pinData": {}, "meta": { "templateCredsSetupCompleted": false } }