{ "name": "Outlevo: ICP visitors digest to Microsoft Teams", "nodes": [ { "id": "86fc3af2-84c0-41c5-8d29-f75143c6d410", "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- **Microsoft Teams**: connect your Microsoft Teams account.\n\n**API key scopes**: `visitors:read`.\n\n**Pick in the node**:\n- **Post to Teams**: the team and the channel\n\nThen switch the workflow to **Active**.", "height": 304, "width": 620 } }, { "id": "573afa37-db04-4bed-a9e7-aec4a0cf8442", "name": "Every morning", "type": "n8n-nodes-base.scheduleTrigger", "typeVersion": 1.2, "position": [ 0, 0 ], "parameters": { "rule": { "interval": [ { "field": "days", "daysInterval": 1, "triggerAtHour": 9 } ] } } }, { "id": "a5ac0aa4-6503-4b1f-a570-5db81e2f4132", "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": "e33b7b1b-8f8b-4ed9-8920-ef4d682694d4", "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": "839179bb-db52-4429-97da-8137627018fc", "name": "Post to Teams", "type": "n8n-nodes-base.microsoftTeams", "typeVersion": 2, "position": [ 720, 0 ], "parameters": { "resource": "channelMessage", "operation": "create", "teamId": { "__rl": true, "mode": "list", "value": "" }, "channelId": { "__rl": true, "mode": "list", "value": "" }, "contentType": "html", "message": "={{ $json.text.split('&').join('&').split('<').join('<').split('>').join('>').split('\\n').join('
') }}", "options": { "includeLinkToWorkflow": false } }, "credentials": { "microsoftTeamsOAuth2Api": { "id": "", "name": "Microsoft Teams" } } } ], "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 Teams", "type": "main", "index": 0 } ] ] } }, "settings": { "executionOrder": "v1" }, "pinData": {}, "meta": { "templateCredsSetupCompleted": false } }