{ "name": "Outlevo: Weekly funnel to Microsoft Teams", "nodes": [ { "id": "7e4c57d6-55cc-4e19-a882-2763dbc1598d", "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**: `outcomes: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": "e773de94-bc13-4694-bcb9-8016d76a4dc9", "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": "e65d077b-a43e-40b3-a973-01dacf53280a", "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": "94878081-9cdd-4d35-9de3-dd4040a914d3", "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": "fbe4054b-3216-4c92-889e-7d87a608299e", "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 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 Teams", "type": "main", "index": 0 } ] ] } }, "settings": { "executionOrder": "v1" }, "pinData": {}, "meta": { "templateCredsSetupCompleted": false } }