{ "name": "Outlevo: Weekly funnel to Slack", "nodes": [ { "id": "065ea7aa-2195-43dc-983a-4b91cb8f1595", "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**: `outcomes: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": "02c1b7e2-5db0-480c-9d75-eafa7178798d", "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": "da5b786d-cd5b-43c0-8552-f51567c57a87", "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": "9cfcdae2-8ab2-4b22-aa53-7eb3122bddc8", "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": "d91331c5-f72a-49db-bfb7-ee035706465d", "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 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": "Post to Slack", "type": "main", "index": 0 } ] ] } }, "settings": { "executionOrder": "v1" }, "pinData": {}, "meta": { "templateCredsSetupCompleted": false } }