{ "name": "Outlevo: ICP visitors digest to Slack", "nodes": [ { "id": "b10fc4cc-8c4f-4049-8bab-f892ef743ade", "name": "How to set it up", "type": "n8n-nodes-base.stickyNote", "typeVersion": 1, "position": [ -40, -364 ], "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- **Slack**: connect your Slack account.\n\n**API key scopes**: `visitors:read`.\n\n**Pick in the node**:\n- **Post to Slack**: the channel (#sales by default)\n\nThen switch the workflow to **Active**.", "height": 304, "width": 620 } }, { "id": "5bb20b43-4de5-407e-9d1c-8010d94e4b81", "name": "Every morning", "type": "n8n-nodes-base.scheduleTrigger", "typeVersion": 1.2, "position": [ 0, 0 ], "parameters": { "rule": { "interval": [ { "field": "days", "daysInterval": 1, "triggerAtHour": 9 } ] } } }, { "id": "ab5ae7fd-02e0-4ea9-b9a3-7ac5c799af27", "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": "030f6a80-ce01-4c1c-8d56-d3f9db01d2b2", "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": "4c8ce4b0-f55f-4e85-a53c-f186d19a1872", "name": "Post to Slack", "type": "n8n-nodes-base.slack", "typeVersion": 2.2, "position": [ 720, 0 ], "parameters": { "resource": "message", "operation": "post", "select": "channel", "channelId": { "__rl": true, "mode": "name", "value": "#sales" }, "text": "={{ $json.text }}", "otherOptions": { "includeLinkToWorkflow": false } }, "credentials": { "slackApi": { "id": "", "name": "Slack" } } } ], "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": "Post to Slack", "type": "main", "index": 0 } ] ] } }, "settings": { "executionOrder": "v1" }, "pinData": {}, "meta": { "templateCredsSetupCompleted": false } }