{ "name": "Outlevo: Daily campaign totals to Gmail", "nodes": [ { "id": "c91c3dca-68c4-4d0a-adfa-727a31ff7bc9", "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**: `campaigns:read`.\n\n**Replace**: `you@example.com`.\n\nThen switch the workflow to **Active**.", "height": 300, "width": 620 } }, { "id": "c6bc82b2-6ec3-41b6-8916-3fe9de99b128", "name": "Every morning", "type": "n8n-nodes-base.scheduleTrigger", "typeVersion": 1.2, "position": [ 0, 0 ], "parameters": { "rule": { "interval": [ { "field": "days", "daysInterval": 1, "triggerAtHour": 8 } ] } } }, { "id": "6398f5cb-b8f7-4c41-afe5-88e6df92abfb", "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": "7f768fec-6329-4614-9c5c-b3533580c456", "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": "dd36f845-bd13-430a-a72b-d9035bdecddf", "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": "126d90aa-5667-403c-af87-d7019e645af0", "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": "d02e4136-6144-4e0d-bdc6-3ccc960bf017", "name": "Email it", "type": "n8n-nodes-base.gmail", "typeVersion": 2.1, "position": [ 1200, 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": "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": "Email it", "type": "main", "index": 0 } ] ] } }, "settings": { "executionOrder": "v1" }, "pinData": {}, "meta": { "templateCredsSetupCompleted": false } }