{ "name": "Outlevo: Weekly funnel to Gmail", "nodes": [ { "id": "7f431e91-00cb-422d-a6ac-0651b9789553", "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**: `outcomes:read`.\n\n**Replace**: `you@example.com`.\n\nThen switch the workflow to **Active**.", "height": 300, "width": 620 } }, { "id": "4fc737ba-49bd-45fe-8e1e-0b982237b7a4", "name": "Every Monday", "type": "n8n-nodes-base.scheduleTrigger", "typeVersion": 1.2, "position": [ 0, 0 ], "parameters": { "rule": { "interval": [ { "field": "weeks", "weeksInterval": 1, "triggerAtDay": [ 1 ], "triggerAtHour": 8 } ] } } }, { "id": "a819dec1-7622-451b-baae-0165528e0d30", "name": "Last week", "type": "n8n-nodes-base.httpRequest", "typeVersion": 4.2, "position": [ 240, 0 ], "parameters": { "method": "GET", "url": "=https://api.outlevo.com/v1/metrics/funnel", "authentication": "genericCredentialType", "genericAuthType": "httpHeaderAuth", "sendQuery": true, "queryParameters": { "parameters": [ { "name": "from", "value": "={{ $now.minus({ days: 7 }).toUTC().toISO() }}" }, { "name": "to", "value": "={{ $now.toUTC().toISO() }}" } ] }, "options": {} }, "credentials": { "httpHeaderAuth": { "id": "", "name": "Outlevo API key (Authorization: Bearer olv_live_…)" } } }, { "id": "4884d91b-4977-4b70-b825-5b16ff7a923d", "name": "Write the digest", "type": "n8n-nodes-base.code", "typeVersion": 2, "position": [ 480, 0 ], "parameters": { "mode": "runOnceForAllItems", "jsCode": "const stages = $input.first().json.stages || [];\nconst lines = stages.map((st) => `• ${st.label}: ${st.accounts ?? 0}${st.from_previous && st.from_previous.value != null ? ` (${(st.from_previous.value * 100).toFixed(1)}% of the step before)` : ''}`);\nreturn [{ json: { text: `📈 Outlevo funnel, last 7 days:\\n${lines.join('\\n')}\\nhttps://app.outlevo.com/dashboard`, subject: 'Outlevo funnel, last 7 days' } }];\n" } }, { "id": "771eec62-c5b8-4766-9b74-845b3559fa62", "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 Monday": { "main": [ [ { "node": "Last week", "type": "main", "index": 0 } ] ] }, "Last week": { "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 } }