{ "name": "Outlevo: Daily campaign totals to Slack", "nodes": [ { "id": "91139377-b1fe-4715-a0c9-746c4d6d8b51", "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**: `campaigns: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": "574e138b-e0ef-4a04-8ab9-e88bafdaec70", "name": "Every morning", "type": "n8n-nodes-base.scheduleTrigger", "typeVersion": 1.2, "position": [ 0, 0 ], "parameters": { "rule": { "interval": [ { "field": "days", "daysInterval": 1, "triggerAtHour": 8 } ] } } }, { "id": "400dc90a-457d-4a58-a804-31a40644d7f2", "name": "List campaigns", "type": "n8n-nodes-base.httpRequest", "typeVersion": 4.2, "position": [ 240, 0 ], "parameters": { "method": "GET", "url": "=https://api.outlevo.com/v1/campaigns", "authentication": "genericCredentialType", "genericAuthType": "httpHeaderAuth", "sendQuery": true, "queryParameters": { "parameters": [ { "name": "limit", "value": "100" } ] }, "options": {} }, "credentials": { "httpHeaderAuth": { "id": "", "name": "Outlevo API key (Authorization: Bearer olv_live_…)" } } }, { "id": "4f1d5d19-b328-40a4-9441-a6d60061c8c9", "name": "Active campaigns", "type": "n8n-nodes-base.code", "typeVersion": 2, "position": [ 480, 0 ], "parameters": { "mode": "runOnceForAllItems", "jsCode": "// One item per running campaign; nothing is sent when none is running.\nreturn ($input.first().json.data || []).filter((c) => c.status === 'active').map((c) => ({ json: { id: c.id, name: c.name } }));\n" } }, { "id": "8e5b834f-19b9-4e0e-82b5-57d353e5a1f9", "name": "Get the numbers", "type": "n8n-nodes-base.httpRequest", "typeVersion": 4.2, "position": [ 720, 0 ], "parameters": { "method": "GET", "url": "=https://api.outlevo.com/v1/campaigns/{{ $json.id }}/stats", "authentication": "genericCredentialType", "genericAuthType": "httpHeaderAuth", "options": {} }, "credentials": { "httpHeaderAuth": { "id": "", "name": "Outlevo API key (Authorization: Bearer olv_live_…)" } } }, { "id": "a370aa96-4218-40a6-a789-aa890b8ed39f", "name": "Write the digest", "type": "n8n-nodes-base.code", "typeVersion": 2, "position": [ 960, 0 ], "parameters": { "mode": "runOnceForAllItems", "jsCode": "const names = $('Active campaigns').all().map((i) => i.json.name);\nconst pct = (x) => (x == null ? '—' : `${(x * 100).toFixed(1)}%`);\nconst lines = $input.all().map((i, k) => {\n const st = i.json;\n return `• ${names[k]}: ${st.sent ?? 0} sent, ${st.replied ?? 0} replies (${pct(st.reply_rate)}), ${st.interested_replies ?? 0} interested, ${st.meetings ?? 0} meetings, bounces ${pct(st.bounce_rate)}`;\n});\nreturn [{ json: { text: `📊 Outlevo campaign totals:\\n${lines.join('\\n')}\\nhttps://app.outlevo.com/campaigns`, subject: 'Outlevo campaign totals' } }];\n" } }, { "id": "edc54cc1-8d61-4abb-97f0-883632ac1434", "name": "Post to Slack", "type": "n8n-nodes-base.slack", "typeVersion": 2.2, "position": [ 1200, 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": "List campaigns", "type": "main", "index": 0 } ] ] }, "List campaigns": { "main": [ [ { "node": "Active campaigns", "type": "main", "index": 0 } ] ] }, "Active campaigns": { "main": [ [ { "node": "Get the numbers", "type": "main", "index": 0 } ] ] }, "Get the numbers": { "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 } }