{ "name": "Outlevo: Handoffs waiting for a rep to Slack", "nodes": [ { "id": "87965754-e501-4f89-9098-b9795165fd31", "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**: `handoffs: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": "017f583f-d669-4974-8cf7-5ddc33e30ef8", "name": "Every morning", "type": "n8n-nodes-base.scheduleTrigger", "typeVersion": 1.2, "position": [ 0, 0 ], "parameters": { "rule": { "interval": [ { "field": "days", "daysInterval": 1, "triggerAtHour": 9 } ] } } }, { "id": "8d037c55-97b1-4b65-94fc-72d60b15b00e", "name": "Delivered handoffs", "type": "n8n-nodes-base.httpRequest", "typeVersion": 4.2, "position": [ 240, 0 ], "parameters": { "method": "GET", "url": "=https://api.outlevo.com/v1/handoffs", "authentication": "genericCredentialType", "genericAuthType": "httpHeaderAuth", "sendQuery": true, "queryParameters": { "parameters": [ { "name": "status", "value": "delivered" }, { "name": "limit", "value": "200" } ] }, "options": {} }, "credentials": { "httpHeaderAuth": { "id": "", "name": "Outlevo API key (Authorization: Bearer olv_live_…)" } } }, { "id": "555a044a-8816-4878-b50a-de9542c41eda", "name": "Write the digest", "type": "n8n-nodes-base.code", "typeVersion": 2, "position": [ 480, 0 ], "parameters": { "mode": "runOnceForAllItems", "jsCode": "const s = (v) => (v == null ? '' : typeof v === 'string' ? v : typeof v === 'object' ? JSON.stringify(v) : String(v));\nconst person = (c) => [c.first_name, c.last_name].filter(Boolean).join(' ');\nconst when = (d) => (d ? new Date(d).toUTCString().replace(/:\\d\\d GMT$/, ' UTC') : '');\nconst all = [...($input.first().json.data || [])].sort((a, b) => Number(b.overdue === true) - Number(a.overdue === true) || String(a.due_at || '').localeCompare(String(b.due_at || '')));\nif (!all.length) return [];\nconst lines = all.slice(0, 20).map((h) => {\n const card = h.card || {};\n const co = card.company || {};\n const p = card.contact || {};\n return `• ${co.name || co.domain || 'An account'}${p.name ? `, ${p.name}` : ''}${h.overdue ? ' — overdue' : h.due_at ? ` — due ${when(h.due_at)}` : ''}`;\n});\nconst more = all.length > 20 ? `\\n…and ${all.length - 20} more` : '';\nreturn [{ json: { text: `🤝 ${all.length} handoff(s) waiting for a rep:\\n${lines.join('\\n')}${more}\\nhttps://app.outlevo.com/handoffs`, subject: `${all.length} handoff(s) waiting` } }];\n" } }, { "id": "b8a66691-1ec2-464a-babf-a7d946ac9544", "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 morning": { "main": [ [ { "node": "Delivered handoffs", "type": "main", "index": 0 } ] ] }, "Delivered handoffs": { "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 } }