{ "name": "Outlevo: interested reply → Slack and HubSpot", "nodes": [ { "id": "6f1c2a10-0001-4c3e-9a51-000000000001", "name": "Outlevo webhook", "type": "n8n-nodes-base.webhook", "typeVersion": 2, "position": [0, 0], "webhookId": "6f1c2a10-0001-4c3e-9a51-0000000000aa", "parameters": { "httpMethod": "POST", "path": "outlevo-lead-classified", "responseMode": "onReceived", "options": { "rawBody": true } } }, { "id": "6f1c2a10-0002-4c3e-9a51-000000000002", "name": "Verify signature", "type": "n8n-nodes-base.code", "typeVersion": 2, "position": [220, 0], "parameters": { "mode": "runOnceForAllItems", "jsCode": "// Outlevo-Signature: t=,v1=; refuse anything older than 5 minutes.\n// Needs NODE_FUNCTION_ALLOW_BUILTIN=crypto on self-hosted n8n. Put the secret POST /v1/webhooks returned in OUTLEVO_WEBHOOK_SECRET.\nconst crypto = require('crypto');\nconst item = $input.first();\nconst raw = Buffer.from(item.binary.data.data, 'base64').toString('utf8');\nconst header = item.json.headers['outlevo-signature'] || '';\nconst parts = header.split(',').map((kv) => kv.trim().split('='));\nconst t = Number((parts.find(([k]) => k === 't') || [])[1]);\nconst sigs = parts.filter(([k]) => k === 'v1').map(([, v]) => v);\nconst want = crypto.createHmac('sha256', $env.OUTLEVO_WEBHOOK_SECRET).update(`${t}.${raw}`).digest('hex');\nif (!t || Math.abs(Date.now() / 1000 - t) > 300 || !sigs.some((s) => s && s.length === want.length && crypto.timingSafeEqual(Buffer.from(s), Buffer.from(want)))) {\n throw new Error('Outlevo signature did not verify');\n}\nconst event = JSON.parse(raw);\nreturn [{ json: { event_id: event.id, type: event.type, ...event.data } }];" } }, { "id": "6f1c2a10-0003-4c3e-9a51-000000000003", "name": "Interested?", "type": "n8n-nodes-base.if", "typeVersion": 2, "position": [440, 0], "parameters": { "conditions": { "options": { "caseSensitive": true, "leftValue": "", "typeValidation": "strict" }, "conditions": [ { "id": "c1", "leftValue": "={{ $json.type }}", "rightValue": "lead.classified", "operator": { "type": "string", "operation": "equals" } }, { "id": "c2", "leftValue": "={{ $json.class }}", "rightValue": "interested", "operator": { "type": "string", "operation": "equals" } } ], "combinator": "and" }, "options": {} } }, { "id": "6f1c2a10-0004-4c3e-9a51-000000000004", "name": "Get the contact's email", "type": "n8n-nodes-base.httpRequest", "typeVersion": 4.2, "position": [660, -100], "parameters": { "method": "GET", "url": "=https://api.outlevo.com/v1/contacts/{{ $json.contact_id }}", "authentication": "genericCredentialType", "genericAuthType": "httpHeaderAuth", "options": {} }, "credentials": { "httpHeaderAuth": { "id": "", "name": "Outlevo API key (Authorization: Bearer olv_live_…)" } } }, { "id": "6f1c2a10-0005-4c3e-9a51-000000000005", "name": "Post to Slack", "type": "n8n-nodes-base.slack", "typeVersion": 2.2, "position": [660, 100], "parameters": { "resource": "message", "operation": "post", "select": "channel", "channelId": { "__rl": true, "mode": "name", "value": "#sales" }, "text": "=:fire: {{ $json.first_name }} {{ $json.last_name }} ({{ $json.title }}) at {{ $json.company_name || $json.domain }} is interested: \"{{ $json.reason }}\" (campaign {{ $json.campaign_name }}). https://app.outlevo.com/replies", "otherOptions": {} }, "credentials": { "slackApi": { "id": "", "name": "Slack" } } }, { "id": "6f1c2a10-0006-4c3e-9a51-000000000006", "name": "Create or update in HubSpot", "type": "n8n-nodes-base.hubspot", "typeVersion": 2, "position": [880, -100], "parameters": { "authentication": "appToken", "resource": "contact", "operation": "upsert", "email": "={{ $json.email }}", "additionalFields": { "firstName": "={{ $('Interested?').item.json.first_name }}", "lastName": "={{ $('Interested?').item.json.last_name }}", "jobTitle": "={{ $('Interested?').item.json.title }}", "companyName": "={{ $('Interested?').item.json.company_name }}", "websiteUrl": "=https://{{ $('Interested?').item.json.domain }}", "leadStatus": "OPEN" } }, "credentials": { "hubspotAppToken": { "id": "", "name": "HubSpot private app" } } } ], "connections": { "Outlevo webhook": { "main": [[{ "node": "Verify signature", "type": "main", "index": 0 }]] }, "Verify signature": { "main": [[{ "node": "Interested?", "type": "main", "index": 0 }]] }, "Interested?": { "main": [[{ "node": "Get the contact's email", "type": "main", "index": 0 }, { "node": "Post to Slack", "type": "main", "index": 0 }], []] }, "Get the contact's email": { "main": [[{ "node": "Create or update in HubSpot", "type": "main", "index": 0 }]] } }, "settings": { "executionOrder": "v1" }, "pinData": {}, "active": false, "meta": { "templateCredsSetupCompleted": false }, "tags": [] }